Manual

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 2

1 Template Padrão
Template padrão pra todo código, com as bibliotecas mais utilizadas e defines úteis.
1#include <iostream>
2#include <cstdio>
3#include <vector>
4
5using namespace std;
6
7#define foreach(i, c) for(__typeof( (c).begin()) i=(c).begin(); i != (c).end(); i++)
8#define all(x) (x).begin(),(x).end
9#define fori(i, n) for(int i = 0; i < (n); i++)
10
11 typedef long long ll;
12 typedef pair<int,int> ii;
13 typedef vector<int> vi;
14 typedef vector<ii> vii;
15
16 #define INF
17 double const PI = 2 *acos(0,0);
18 double const EPS = 1e-10;
2 STL
2.1 misc
3 Graph
4 Geometry
5 Misc
5.1 Entrada
Parar quando as entradas forem 0 ou nulas:
1int a, b;
2while(scanf("%d %d", &a, &b), (a || b){}
3while(scanf("%d %d", &a, &b) == 2){}
4while(scanf("%d %d", &a, &b) != EOF){}
5.2 Limites
<= 10: O(n!), O(n)
<= 18: O(2n·n)
<= 22: O(2n·n)
<= 100: O(n)
1
<= 400: O(n)
<= 2K: O(n·log2n)
<= 10K: O(n)
<= 1M: O(nlog2n)
<= 100M: O(n), O(log2n), O(1)
2

Navigation menu