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
// Update O(log(N)) | |
// Query O(Log^2(N)) | |
//Problema de teste : https://tinyurl.com/y95bucb5 | |
#include <bits/stdc++.h> | |
#define N 100050 | |
#define f first | |
#define s second | |
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
// Wifi - OBI 2018 P2F2 | |
// Complexidade O( N*log(N) ) | |
#include <bits/stdc++.h> | |
#define N 200050 | |
#define f first | |
#define s second | |
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
// Fuga - OBI 2018 P2 F2 | |
// Complexidade O( 2^ ceil((n*m)/4) ) | |
#include <bits/stdc++.h> | |
#define N 100050 | |
using namespace std; | |
int n, m, xf, yf, xo, yo, dx[4] = {1, -1, 0, 0}, dy[4] = {0, 0, 1, -1}; | |
int ans = 0, ini[6][6]; |
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
// Palindromic Partitions - CEOI 2017 | |
// Complexidade O(N) | |
#include <bits/stdc++.h> | |
#define X 145443351LL | |
#define mod 1000000007LL | |
using namespace std; | |
typedef long long ll; | |
ll Hash[1000010], n, pot[1000010]; |
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
// Building bridges - CEOI 2017 | |
// Complexidade O(N*sqrt(N)) | |
#include <bits/stdc++.h> | |
#define inf 2000000000000000000LL | |
#define N 100050 | |
#define f first | |
#define s second | |
using namespace std; | |
typedef long long ll; |
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
// Robots - IOI 2013 | |
// Complexidade O(T*log²(T)) | |
#include <bits/stdc++.h> | |
#define f first | |
#define s second | |
#define N 1000050 | |
#define inf 2000000010 | |
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
// Passeio - Seletiva IOI 2013 | |
// Complexidade O(N*log²(N)) | |
// Matheus Leal V | |
#include <bits/stdc++.h> | |
#define mid ((a + b)/2) | |
#define inf 10000000 | |
#define N 100050 | |
#define f first | |
#define s second |
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 N 100050 | |
#define mid ((a + b)/2) | |
using namespace std; | |
typedef long long ll; | |
int A, B, n, v[N], tree[4*N]; | |
int mdc(int a, int b) | |
{ | |
if(!a) return b; |
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
// Doce de Banana - Seletiva IOI 2014 | |
// Complexidade O(N*log(N)) | |
// Matheus Leal V :D | |
#include <bits/stdc++.h> | |
#define N 100050 | |
#define int long long | |
using namespace std; | |
int n, D[N], P[N], B[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
// Doença - Seletiva IOI 2015 | |
// Complexidade O(N*log(N)) | |
// Matheus Leal V | |
#include <bits/stdc++.h> | |
#define N 100050 | |
using namespace std; | |
int n, Viz[N], Tempo[N][2], resp; | |
bool doente[N]; |
NewerOlder