This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <algorithm> // sort | |
#include <string.h> // memset | |
using namespace std; | |
class Aresta | |
{ | |
int vertice1, vertice2, peso; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstdio> | |
#define maxV 10000 | |
using namespace std; | |
int cnt, lbl[maxV], movimentos, cont=0, V, A,G; | |
int adj[100][100]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
g++ -framework OpenGL -framework GLUT -o lookAtThis helloPeople.cpp ; ./lookAtThis | |
gcc main.c -framework OpenGL -framework GLUT <É necessário adicionar a biblioteca "#include <GLUT/glut.h>"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// C++ includes used for precompiling -*- C++ -*- | |
// Copyright (C) 2003-2013 Free Software Foundation, Inc. | |
// | |
// This file is part of the GNU ISO C++ Library. This library is free | |
// software; you can redistribute it and/or modify it under the | |
// terms of the GNU General Public License as published by the | |
// Free Software Foundation; either version 3, or (at your option) | |
// any later version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int partition( int a[], int l, int r) { | |
int pivot, i, j, t; | |
pivot = a[l]; | |
i = l; j = r+1; | |
while(1){ | |
do ++i; while( a[i] <= pivot && i <= r ); | |
do --j; while( a[j] > pivot ); | |
if( i >= j ) break; | |
t = a[i]; a[i] = a[j]; a[j] = t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* C implementation QuickSort */ | |
#include<stdio.h> | |
// A utility function to swap two elements | |
void swap(int* a, int* b) | |
{ | |
int t = *a; | |
*a = *b; | |
*b = t; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
#define endl '\n' | |
#define DV(value) cout << "[" << value << "]"; | |
#define DPI(p) cout << "[" << p.first << "," << p.second << "]"; | |
#define MAX 10000 | |
using namespace std; | |
typedef pair<int,int> pii; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// C implementation of search and insert operations | |
// on Trie | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdbool.h> | |
#define ARRAY_SIZE(a) sizeof(a)/sizeof(a[0]) | |
// Alphabet size (# of symbols) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
typedef long long ll; | |
typedef vector<ll> vi; | |
ll N; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Star (URI1233): [ Intermediario / Matematica ] É possivel ver que se um numero K tem algum fator comum com N, entao ele ira voltar para a posicao inicial em alguma rodada. Alem disso, para cada coprimo X de N, as estrelas formadas por X e N - X sao iguais. Dessa forma, o resultado final é phi(N) / 2. |
OlderNewer