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; | |
const int maxn = 2e5+10; | |
queue<int> dia[maxn]; | |
vector<int>adj[3*maxn]; | |
int id[3*maxn]; | |
int valido[maxn], qnt[3*maxn]; | |
int n,m; |
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; | |
#define int long long | |
const int mod = 1e9 + 7; | |
vector<int> pot; | |
int calcula(int x){ | |
if(x == 0) return 0; |
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; | |
const int maxn = 1e5 + 5; | |
vector<pair<int,int>> adj[maxn]; | |
ll soma[maxn]; | |
vector<int> res; |
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; | |
int main(){ | |
int n, k; | |
cin >> n >> k; | |
vector<pair<int,int>> aux,A; |
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; | |
int main(){ | |
int N; cin >> N; | |
vector<int> palitos; | |
for(int i=0; i<N; i++){ |
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; | |
int main(){ | |
int N; cin >> N; | |
int anterior = 0; | |
int menorDif = 1e9; |
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; | |
int main(){ | |
ios_base::sync_with_stdio(false); | |
int n,k; cin >> n >> k; | |
vector<int> v(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
#include <bits/stdc++.h> | |
using namespace std; | |
#define int long long | |
const int MOD = 1000000007; | |
signed main(){ | |
ios_base::sync_with_stdio(false); | |
cin.tie(NULL); |
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; | |
int main(){ | |
int n; | |
cin >> n; | |
vector<pair<int,int>> v; |
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> //O(max(MAX_Pi, N)) | |
using namespace std; | |
const int MAX = 1e5 + 5; | |
//solução usando prefsum | |
int instante[MAX]; | |
int main(){ | |
int n; |
NewerOlder