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
Chat Fun() // #A Wrapper type Chat containing the promise type | |
{ | |
co_yield "Olá!\n"s; // #B Calls promise_type.yield_value | |
std::cout << co_await std::string{}; // #C Calls promise_type.await_transform | |
co_return "Aqui!\n"s; // #D Calls promise_type.return_value | |
} | |
int main() |
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; | |
string s; | |
cin >> n; | |
cin >> s; |
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 MID ((l + r)/2) | |
struct node | |
{ | |
node *left, *right; | |
int sum; |
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 MID ((l + r)/2) | |
#define LEFT ((2*no)) | |
#define RIGHT ((2*no) + 1) | |
const int MAXN = 3e5 + 10; | |
struct node | |
{ |
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 = 1e5; | |
#define LEFT (2*node) | |
#define RIGHT ((2*node) + 1) | |
#define MID ((l + r)/2) | |
int tree[3*maxn], v[maxn]; |
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 = 1e4 + 10; | |
#define int long long | |
typedef pair<int, int> pi; | |
typedef pair<int, pi> pii; | |
int vis[maxn], min_len[maxn], n, m, k; | |
pi dist[maxn]; |
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; | |
mt19937 rd(random_device{}()); | |
ll mul(ll a, ll b, ll c) | |
{ | |
return __int128(a)*b%c; | |
} |
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
bool checa_primalidade(int n) | |
{ | |
for(int i = 2; i*i <= n; i++) | |
{ | |
if(n % i == 0) return false; | |
} | |
return true; | |
} |
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 = 1e6 + 10; | |
bool composto[maxn]; | |
int n; | |
vector<int> p[maxn]; | |
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 = 5e5 + 10; | |
int n, q, pref[maxn], v[maxn]; | |
int main() | |
{ | |
ios::sync_with_stdio(false), cin.tie(nullptr); |
NewerOlder