source_code
stringlengths
26
62k
lang_cluster
stringclasses
11 values
src_uid
stringlengths
32
32
code_uid
stringlengths
32
32
difficulty
int32
-1
3.5k
exec_outcome
stringclasses
1 value
/* the vast starry sky, bright for those who chase the light. */ #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx") #pragma GCC optimize("unroll-loops") #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; #define mk make_pair const i...
C++
a31e897ea206ad040df20d4852f7712b
5624e8a902f4c9507415abae5bbc4de0
3,300
PASSED
/* the vast starry sky, bright for those who chase the light. */ #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx") #pragma GCC optimize("unroll-loops") #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; #define mk make_p...
C++
a31e897ea206ad040df20d4852f7712b
2a902d0b17edd52ddc7bd8c8ba9772c8
3,300
PASSED
#include<bits/stdc++.h> #define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++) #define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--) #define pii pair<int,int> #define fi first #define se second #define PB push_back #define ll long long #define ull unsigned long long #define pll pair<ll,ll> #define y1 orzk...
C++
a31e897ea206ad040df20d4852f7712b
b87f7c50a8f70b39132a1056d7c4988c
3,300
PASSED
#include<bits/stdc++.h> #define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++) #define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--) #define pii pair<int,int> #define fi first #define se second #define PB push_back #define ll long long #define ull unsigned long long #define pll pair<ll,ll> #define y1 orzk...
C++
a31e897ea206ad040df20d4852f7712b
69147fbcf837f9bc7f53174badbabed1
3,300
PASSED
/** ____ ____ ____ ____ ____ ||a |||t |||o |||d |||o || ||__|||__|||__|||__|||__|| |/__\|/__\|/__\|/__\|/__\| **/ #include <bits/stdc++.h> using namespace std; typedef long long ll; const int NM_MAX = 200002; const int AB_MAX = 1000003; const int BITS = 20; const int AB = 1000000; int n, m...
C++
a31e897ea206ad040df20d4852f7712b
be3e3c1d1ff6377a629a05efe0352c0e
3,300
PASSED
/** ____ ____ ____ ____ ____ ||a |||t |||o |||d |||o || ||__|||__|||__|||__|||__|| |/__\|/__\|/__\|/__\|/__\| **/ #include <bits/stdc++.h> using namespace std; typedef long long ll; const int NM_MAX = 200002; const int AB_MAX = 1000003; const int BITS = 20; const int AB = 1000000; int n, m...
C++
a31e897ea206ad040df20d4852f7712b
45fa7b17e31b59f323ab7587af1c2e69
3,300
PASSED
#include <iostream> #include <vector> #include <cassert> #include <cmath> #include <algorithm> #include <set> using ll = long long; #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #define MAX(a, b) (((a) < (b)) ? (b) : (a)) class FenwickTree{ private: int n; std::vector<ll> aib; public: FenwickTree(int n_) { n ...
C++
a31e897ea206ad040df20d4852f7712b
d9dac1d4045424539b853283055d8dd8
3,300
PASSED
//starusc #include<bits/stdc++.h> using namespace std; #define int long long inline int read(){ int x=0,f=1,c=getchar(); while(!isdigit(c)){if(c=='-')f=-1;c=getchar();} while(isdigit(c)){x=(x<<1)+(x<<3)+(c^48);c=getchar();} return f==1?x:-x; } const int N=2e5+4,MX=1e6,inf=0x3f3f3f3f3f3f3f3f; int n,m,Q,k,...
C++
a31e897ea206ad040df20d4852f7712b
a4919ce99b527fe91e1e3ca7b2fa335d
3,300
PASSED
#include <bits/stdc++.h> #define ios ios::sync_with_stdio(0) using namespace std; const int N = 234567; #define ll long long int t, n, m, w; #define arr array<int, 2> int a[N], b[N], ans[N]; map<int, vector<int>> mp; ll c[N]; void dfs(int u, int d, ll ls) { ls += a[u]; d++; c[d] = c[d - 1] +...
C++
8629aa74df60537987611c6c1ef1a140
f416169613e394db0c269069c38a95a6
1,700
PASSED
#include <bits/stdc++.h> #define ios ios::sync_with_stdio(0) using namespace std; const int N = 234567; #define ll long long int t, n, m, w; #define arr array<int, 2> int a[N], b[N], ans[N]; map<int, vector<int>> mp; ll c[N]; void dfs(int u, int d, ll ls) { ls += a[u]; d++; c[d] = c[d - 1] +...
C++
8629aa74df60537987611c6c1ef1a140
15d69d8f8abceae10ff2f22541b3b3a0
1,700
PASSED
#include <bits/stdc++.h> #define ios ios::sync_with_stdio(0) using namespace std; const int N = 234567; #define ll long long int t, n, m, w; #define arr array<int, 2> int a[N], b[N], ans[N]; map<int, vector<int>> mp; ll c[N]; void dfs(int u, int d, ll sum) { d++; c[d] = c[d - 1] + b[u]; sum ...
C++
8629aa74df60537987611c6c1ef1a140
995b86decb3ed642077e7ba829870740
1,700
PASSED
#include <bits/stdc++.h> #define ios ios::sync_with_stdio(0) using namespace std; const int N = 234567; #define ll long long int t, n, m, k; int mod = 998244353; #define arr array<int, 2> int main() { // 这题用到了一个很强的技巧。。就是共用的数组。。 // 用层数代表当前层数在数组的位置。。 // 然后用二分 去找出来合法的位置 // 他的录入方式总是少一个节点信息。。默...
C++
8629aa74df60537987611c6c1ef1a140
9abad30d6252eedf9936b5e3ea34257c
1,700
PASSED
#include <bits/stdc++.h> #define ios ios::sync_with_stdio(0) using namespace std; const int N = 234567; #define ll long long int t, n, m, k; int mod = 998244353; #define arr array<int, 2> int main() { // 这题用到了一个很强的技巧。。就是共用的数组。。 // 用层数代表当前层数在数组的位置。。 // 然后用二分 去找出来合法的位置 // 他的录入方式总是少一个节点信息。。默...
C++
8629aa74df60537987611c6c1ef1a140
488d240e770cf0e68a9c71765ef5e7fb
1,700
PASSED
#include <bits/stdc++.h> #define ios ios::sync_with_stdio(0) using namespace std; const int N = 234567; #define ll long long int t, n, m, w; #define arr array<int, 2> int a[N], b[N], ans[N]; ll sum[N]; map<int, vector<int>> mp; void dfs(int u, int d, ll cur) { cur += a[u]; d++; sum[d] = sum[...
C++
8629aa74df60537987611c6c1ef1a140
cef8eb36773263d2de143e5cef8c37c2
1,700
PASSED
#include <bits/stdc++.h> #define ios ios::sync_with_stdio(0) using namespace std; const int N = 234567; #define ll long long int t, n, m, w; #define arr array<int, 2> ll a[N], b[N], sum[N], ans[N]; map<int, vector<int>> mp; void dfs(int u, int d, ll cur) { cur += a[u]; d++; sum[d] = sum[d - 1...
C++
8629aa74df60537987611c6c1ef1a140
99b52a31f0bc7bd9b1ce7bfc5b27104f
1,700
PASSED
#include <bits/stdc++.h> #define ios ios::sync_with_stdio(0) using namespace std; const int N = 234567; #define ll long long int t, n, m, w; #define arr array<int, 2> ll a[N], b[N], c[N], ans[N]; map<int, vector<int>> mp; void dfs(int u, int d, ll sum) { sum += a[u]; d++; c[d] = c[d - 1] + b[...
C++
8629aa74df60537987611c6c1ef1a140
eca142977e49e6627d4a36670f62792a
1,700
PASSED
#include <bits/stdc++.h> #define ios ios::sync_with_stdio(0) using namespace std; const int N = 234567; #define ll long long int t, n, m, w; #define arr array<int, 2> ll a[N], b[N], c[N], ans[N]; map<int, vector<int>> mp; void dfs(int u, int d, ll sum) { sum += a[u]; d++; c[d] = c[d - 1] + b[...
C++
8629aa74df60537987611c6c1ef1a140
ed692d0fcc5666a3e45c1c6ae330713a
1,700
PASSED
#include <bits/stdc++.h> #define ios ios::sync_with_stdio(0) using namespace std; const int N = 234567; #define ll long long int t, n, m, w; #define arr array<int, 2> ll a[N], b[N], c[N], ans[N]; map<int, vector<int>> mp; void dfs(int u, int d, ll sum) { sum += a[u]; d++; // 实际上感觉层数 也可以直接用cnt 来 就可...
C++
8629aa74df60537987611c6c1ef1a140
3520cf7e98c4ba49fe95f086d1d954d6
1,700
PASSED
//#include <iostream> #include <bits/stdc++.h> using namespace std; vector<int>::iterator it; void is_big_minute(int &h,int &m){ if(m>=60){ h++; m = m-60; } if(h>=24) h= 24-h; } int find_num_position(vector<int>v, int val){ // Element to be searched it = find (v...
C++
ce0579e9c5b4c157bc89103c76ddd4c3
6ec005fdf904f74b98e8edc1b99c37e1
900
PASSED
#include<iostream> using namespace std; int main() { int t; cin>>t; while(t--) { int n,h,m; cin>>n>>h>>m; int sum=0,as=10000; while(n--){ int x,y; cin>>x>>y; sum=60*x+y-60*h-m; if(sum<0)sum+=24*60; if(as>sum){ as=sum; } } cout<<as/60<<" "<<as%60<<endl; } } ...
C++
ce0579e9c5b4c157bc89103c76ddd4c3
94300e364d389e97d0ebf32542889ee7
900
PASSED
#include<iostream> using namespace std; int main() { int t; cin>>t; while(t--) { int n; cin>>n; int T,H,M; cin>>H>>M; T=H*60+M; int hi,mi; int mn=10101010; int x; for(int i=0;i<n;i++) { cin>>hi>>mi; ...
C++
ce0579e9c5b4c157bc89103c76ddd4c3
72d9dcc0487c8cb797ad983cdbd76af0
900
PASSED
#include<iostream> #include<algorithm> #include<math.h> using namespace std; struct timej{ int ho,min; }e[100]; int node( timej x, timej y) { if(x.ho==y.ho) return x.min<y.min; return x.ho<y.ho; } int main() { int t; cin>>t; while(t--) { int n,h,m; cin>>n>>h>>m; for(int i=1;i<=n;i++) { cin>>e[...
C++
ce0579e9c5b4c157bc89103c76ddd4c3
124d4a9d59bdfa7895ad52de5cba954b
900
PASSED
#include<iostream> #include<algorithm> #include<math.h> using namespace std; struct timej{ int ho,min; }e[100]; int node(const timej x,const timej y) { if(x.ho==y.ho) return x.min<y.min; return x.ho<y.ho; } int main() { int t; cin>>t; while(t--) { int n,h,m; cin>>n>>h>>m; for(int i=1;i<=n;i++) { ...
C++
ce0579e9c5b4c157bc89103c76ddd4c3
371f3324040c53e176e5528c5e94e5e0
900
PASSED
#include<iostream> #include<algorithm> #include<math.h> using namespace std; struct timej{ int ho,min; }e[100]; int node(const timej x,const timej y) { if(x.ho==y.ho) return x.min<y.min; return x.ho<y.ho; } int main() { int t; cin>>t; while(t--) { int n,h,m; cin>>n>>h>>m; for(int i=1;i<=n;i++) { ...
C++
ce0579e9c5b4c157bc89103c76ddd4c3
44adf1e30df4ec0c8b58ab3e5551d934
900
PASSED
#include<iostream> using namespace std; int main() { int n; cin>>n; while(n--) { int time,m,H,F,t; cin>>m>>H>>F; time=H*60+F; int sum=24*60; while(m--) { int N,M; cin>>N>>M; t=(N*60+M-time+1440)%1440; sum=min(...
C++
ce0579e9c5b4c157bc89103c76ddd4c3
fe2d55ace238caba26fb3409b7510f09
900
PASSED
#include<iostream> using namespace std; int main() { int n; cin>>n; while(n--) { int time,m,H,F,t; cin>>m>>H>>F; time=H*60+F; int sum=24*60; while(m--) { int N,M; cin>>N>>M; t=(N*60+M-time+1440)%1440; sum=min(...
C++
ce0579e9c5b4c157bc89103c76ddd4c3
dfd7bce7623b6a3b7bfa3eb47517e26f
900
PASSED
#include <iostream> using namespace std; int main() { int T; cin >> T; while (T--) { int n; cin >> n; int time, h, m; cin >> h >> m; time = 60 * h + m; int ans = 24 * 60; for (int i = 0; i < n; i++) { cin >> h >> m; int t = 60 * h + m - time; if (t < 0) t += 24 * 60; ans = min(ans, ...
C++
ce0579e9c5b4c157bc89103c76ddd4c3
ef36fc1f2cdb20ee85ae9f8448a4a9fd
900
PASSED
#include <iostream> using namespace std; int main() { int T; cin >> T; while (T--) { int n, h, m; cin >> n >> h >> m; int ans = 1440; int cur = h * 60 + m; for (int i = 0; i < n; i++) { int x, y; cin >> x >> y; int res = (x * 60 + y - cur + 1440) % 1440; ans = min(ans, res); } cout ...
C++
ce0579e9c5b4c157bc89103c76ddd4c3
625d767e7c92388cd886cdb63ab3d1b7
900
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2e5 + 5; pair<int, int> range[105]; void solve() { memset(range, 0, sizeof range); string t; int n; string s[15]; cin >> t >> n; for (int i = 0; i < n; ++i) cin >> s[i]; for (int i = 0; ...
C++
c08933fdaceb220f4ef3ba8c5f09fe12
3a46c82eb72777dd2cd79a86e08e6d37
1,600
PASSED
// Problem: D. Color with Occurrences // Contest: Codeforces - Codeforces Round #811 (Div. 3) // URL: https://codeforces.com/contest/1714/problem/D // Memory Limit: 256 MB // Time Limit: 2000 ms // // Powered by CP Editor (https://cpeditor.org) #include <cstdio> #include <iostream> #include <cstring> #incl...
C++
c08933fdaceb220f4ef3ba8c5f09fe12
130c449c52ba7e8742bcf994b9ca8189
1,600
PASSED
#include<bits/stdc++.h> using namespace std; int t; string s,a[15]; int n; vector<pair<int,int>> vt; void make() { for(int i=1; i<=n; i++) { for(int j=0; j+a[i].size()-1<s.size(); j++) { if(s.substr(j,a[i].size())==a[i]) { vt.push_back(make_pair(j,i)); } } } } bool cmp(pair<int,...
C++
c08933fdaceb220f4ef3ba8c5f09fe12
5a94a316ba31ad20aefb03b2c49ee3d8
1,600
PASSED
#include<bits/stdc++.h> using namespace std; //priority_queue //ll gcd(ll x,ll y){return ((y==0)?x,gcd(y,x%y));} int n; string s[200]; string t; int vis[20]; void solve(){ cin>>t; map<string ,int >mp; stack<pair<int,int> >st; // cout<<"*"<<t<<"*\n"; cin>>n;memset(vis,0,sizeof vis); for(int i=1;...
C++
c08933fdaceb220f4ef3ba8c5f09fe12
1051208a942c9a2744d32100d9c7bf84
1,600
PASSED
#include<bits/stdc++.h> #define rep(i,s,t) for(int i=(s);i<=(t);i++) using namespace std; const int N=110; int q,n; string t,s[N]; int f[N],use[N],lst[N]; signed main(){ //freopen("color.in","r",stdin); //freopen("color.out","w",stdout); cin>>q; while(q--){ cin>>t>>n; rep(i,1,n)cin>>s[i]; int m...
C++
c08933fdaceb220f4ef3ba8c5f09fe12
1fd9008f5991873bafc402a936c29f99
1,600
PASSED
#include<bits/stdc++.h> using namespace std; typedef pair<int,int> PII; const int N = 110; string t; int n; string s[15]; int r[N], id[N]; //pos[i] 从第 i 个位置开始某子串最右能到达的位置 vector<PII>res; void solve() { res.clear(); memset(r, -1, sizeof(r)); cin >> t >> n; int len = t.size(); ...
C++
c08933fdaceb220f4ef3ba8c5f09fe12
1fc5fa08e246c7cb6fa96a381689678d
1,600
PASSED
#include<bits/stdc++.h> using namespace std; const int MAXN = 100000; struct node{ int l,r,pos; node(){} node(int _l,int _r,int _pos){ l = _l,r = _r,pos = _pos; } }a[MAXN],ans[MAXN]; int sz_t,cnt,sz_s[11]; char t[MAXN],s[11][MAXN]; bool cmp(node l,node r){ return l.l < r.l; } void work(){ //求解最小...
C++
c08933fdaceb220f4ef3ba8c5f09fe12
07714db9020932006eb9a4e860de738f
1,600
PASSED
#include<bits/stdc++.h> #define pb push_back #define all(x) x.begin(), x.end() using namespace std; typedef long long ll; typedef pair<int, int> PII; const int N = 2e5 + 10, P = 1e9 + 7, mod = 998244353; PII pr[110]; int dp[110]; void solve(){ string t; int n; cin >> t >> n; vector<string> s(n); for(...
C++
c08933fdaceb220f4ef3ba8c5f09fe12
8e0086a5f8f6f572794e81b2f66025b7
1,600
PASSED
#include<bits/stdc++.h> #define ll int #define rg register #define rll rg ll #define maxn 101 using namespace std; static inline ll read() { rll f=0,x=0;rg char ch=getchar(); while(ch<'0'||ch>'9') f|ch=='-',ch=getchar(); while(ch>='0'&&ch<='9') x=(x<<3)+(x<<1)+(ch^48),ch=getchar(); return f?-x:x; } sta...
C++
c08933fdaceb220f4ef3ba8c5f09fe12
d377b5dd71e89693cefc565a957964ee
1,600
PASSED
#include <bits/stdc++.h> using namespace std; #define inf 0x3f3f3f3f #define INF 0x7fffffff #define me(x,y) memset(x,y,sizeof x) #define ll long long #define PII pair<int,int> #define vc vector #define fi first #define se second #define sc scanf #define pr printf inline int re(){ int s =0,w = 1; ...
C++
c08933fdaceb220f4ef3ba8c5f09fe12
4cd6f26d64d9394384981b36ee39b2b8
1,600
PASSED
#include<iostream> #include<set> using namespace std; int main(){ int a,b,i; cin>>a; while(a--){ cin>>b; int arr[b]; for(i=0;i<b;i++){ cin>>arr[i]; } set<int>c; for(i=b-1;i>=0;i--){ if(c.find(arr[i])!=c.end()){ bre...
C++
4aaa33f77fe1c89ae477bd5cfa04f0bf
fc941669a542064e0cee11f0f76920bf
800
PASSED
#include<bits/stdc++.h> using namespace std; const int N = 1e5 + 100; void solve(){ int n; scanf("%d", &n); vector<int> a(n + 5), vis(n + 5); for(int i = 1; i <= n; i ++ ){ scanf("%d", &a[i]); } for(int i = n; i; i -- ){ if(vis[a[i]]){ printf("%d\n", i); return ; } vis[a[...
C++
4aaa33f77fe1c89ae477bd5cfa04f0bf
511225c61eeabd9cc5a889a89e0119cc
800
PASSED
#include<bits/stdc++.h> using namespace std; const int N = 1e5 + 100; void solve(){ int n; cin >> n; vector<int> a(n), cnt(n + 5); for(int i = 0; i < n; i ++ ) cin >> a[i]; int i; for(i = n - 1; i >= 0; i -- ){ if(cnt[a[i]]) break; else cnt[a[i]] ++; } cout << i + 1 << endl; } i...
C++
4aaa33f77fe1c89ae477bd5cfa04f0bf
2a97cd860ec78b1269f56290c4b02141
800
PASSED
#include <iostream> #include<list> #include <vector> #include <set> #include <iterator> using namespace std; int main() { int t; cin>>t; while(t--) { int n; cin>>n; set<int> st; vector<int> v(n); for(int i = 0; i < n; i++) { cin...
C++
4aaa33f77fe1c89ae477bd5cfa04f0bf
d1b45d94bff7d08b34d734d269ecec2e
800
PASSED
#define fast ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr); #define ll long long #define yes cout<<"yes\n"; #define no cout<<"no\n"; #define Yes cout<<"Yes\n"; #define No cout<<"No\n"; #define YES cout<<"YES\n"; #define NO cout<<"NO\n"; const int N=1e6+2; #include <bits/stdc++.h> using name...
C++
4aaa33f77fe1c89ae477bd5cfa04f0bf
ca997c52c11b2e2c644fdafeac1ad7d3
800
PASSED
#include <bits/stdc++.h> using namespace std; #define forn(i, n) for (int i = 0; i < int(n); i++) int main() { int t; cin >> t; forn(tt, t) { int n; cin >> n; vector<int> a(n); forn(i, n) cin >> a[i]; bool yes = false; set<int> c...
C++
4aaa33f77fe1c89ae477bd5cfa04f0bf
b070fe9177a9d0d24a511cabfe30f92a
800
PASSED
#include <bits/stdc++.h> using namespace std; #define int long long int32_t main(){ int t,n,i,m; cin>>t; while(t--){ cin>>n; vector<int> v(n); set<int> s; for(i=0;i<n;i++){ cin>>v[i]; } for(i=n-1;i>=0;i--){ s.insert(v[i])...
C++
4aaa33f77fe1c89ae477bd5cfa04f0bf
2caa2f62580206f308c6c3ed27a3d0d6
800
PASSED
#include <bits/stdc++.h> using namespace std; #define ll long long #define loop(i,a,n) for (int i=a; i<n; i++) #define loopdown(i,n,a) for(int i=n-1; i>=a; i--) #define vint vector<int> ll modulo = 1000000007; void solve() { int n; cin>>n; vint arr(n); vint count(n,0); int temp; loo...
C++
4aaa33f77fe1c89ae477bd5cfa04f0bf
5ee47247b354ddbfc84149e90d63c6bc
800
PASSED
#include <iostream> #include <algorithm> typedef long long int ll; using namespace std; void solve() { ll a; cin>>a; ll arr[a+1];arr[0]=0; for(ll i=1;i<a+1;i++) cin>>arr[i]; ll dup[300000]={0};ll counter=0; for(ll i=a;i>0;i--) { if(dup[arr[i]]==0) { ...
C++
4aaa33f77fe1c89ae477bd5cfa04f0bf
2d97b9c5d4109bf67f6f1af876f0700b
800
PASSED
#include <bits/stdc++.h> using namespace std; int main(){ int t; cin>>t; for(int i=0;i<t;i++){ int n; cin>>n; vector<int>vec; for(int j=0;j<n;j++){ int h; cin>>h; vec.push_back(h); } set <int> st; int m; for( m=n-1;m>-1;m--){ if(st.find(vec[m])==st.end()){ st.insert(vec[m]); } else{ ...
C++
4aaa33f77fe1c89ae477bd5cfa04f0bf
0ef3f8c98d91952da82a4c6ab51da105
800
PASSED
#include <iostream> #include <vector> #include <set> #include <map> #include <cmath> #include <stack> #include <queue> #include <algorithm> #include <iomanip> #include <cassert> #include <unordered_set> #define ll long long #define pip pair <int, int> #define strings pair <string, string> #define mp(a,b) make_pair(a,b)...
C++
4750029f0a5e802099a6dd4dff2974d5
f1de1b881170ffdd50a10e3dd454dbb8
1,900
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef long double ld; #define M 100000007 #define endl '\n' #define print(vec) \ for (auto &x : vec) \ cout << x << ' '; \ cout << endl; #define scan(vec) \ for (auto &x : vec) \ cin >> x #def...
C++
4750029f0a5e802099a6dd4dff2974d5
5f380a5a35f92882632b453f306da832
1,900
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef long double ld; #define M 100000007 #define endl '\n' #define print(vec) \ for (auto &x : vec) \ cout << x << ' '; \ cout << endl; #define scan(vec) \ for (auto &x : vec) \ cin >> x #def...
C++
4750029f0a5e802099a6dd4dff2974d5
ef63f7cc53f3f0579c814cd2e3f30360
1,900
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef long double ld; #define M 100000007 #define endl '\n' #define print(vec) \ for (auto &x : vec) \ cout << x << ' '; \ cout << endl; #define scan(vec) \ for (auto &x : vec) \ cin >> x #def...
C++
4750029f0a5e802099a6dd4dff2974d5
ac4cb6f8b78d25197208ee34191895e8
1,900
PASSED
#include <iostream> #include <vector> #include <set> #include <algorithm> #include <queue> #include <cmath> #include <stack> #include <map> #include <string> #include <iomanip> #include <unordered_set> #include <unordered_map> #define all(A) (A).begin(), (A).end() #define read(A) for (auto &now : A) cin ...
C++
4750029f0a5e802099a6dd4dff2974d5
a246a2314c26c65b2a82fa3fdbcc38f1
1,900
PASSED
#include<iostream> #include<vector> #include<algorithm> using namespace std; pair<int, int>a[3];//0 d12 1 d23 2 d31 int u[3] = { 1,2,3 }, v[3] = { 2,3,1 }, k[3] = { 3,1,2 }, p[3] = { 2,0,1 }; vector<pair<int, int>>ans; int n; inline void solve() { for (int i = 0; i ^ 3; ++i) cin >> a[i].first, a[i].second ...
C++
4750029f0a5e802099a6dd4dff2974d5
4a14e5f0601856775c039338572907db
1,900
PASSED
#include<iostream> #include<vector> #include<algorithm> using namespace std; pair<int, int>a[3];//0 d12 1 d23 2 d31 int u[3] = { 1,2,3 }, v[3] = { 2,3,1 }, k[3] = { 3,1,2 }, p[3] = { 2,0,1 }; vector<pair<int, int>>ans; int n; int fa[200001]; int find(int x) { return fa[x] == x ? x : fa[x] = find(fa[x]); } ...
C++
4750029f0a5e802099a6dd4dff2974d5
ce3ef662e73d32dce44273a9c26d961c
1,900
PASSED
#include <bits/stdc++.h> //#include <ext/pb_ds/assoc_container.hpp> //#include <ext/pb_ds/tree_policy.hpp> using namespace std; //using namespace __gnu_pbds; #define U unsigned #define I long long int #define S string #define C char #define D long double #define A auto #define B bool #define pb push_back #...
C++
4750029f0a5e802099a6dd4dff2974d5
fd62d285d7bcba85d67a371ebfc127e2
1,900
PASSED
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define ll long long #define all(x) ((x).begin()), ((x).end()) #define allr(x) ((x).rbegin()), ((x).rend()) #define sz(x) ((int)((x).size())) #define clr(x, d) memset(x, d, sizeof...
C++
4750029f0a5e802099a6dd4dff2974d5
30a3959a8569897068ffa405676d34d7
1,900
PASSED
#include <bits/stdc++.h> using namespace std; #define endl '\n' #define ll long long #define all(x) ((x).begin()), ((x).end()) #define allr(x) ((x).rbegin()), ((x).rend()) #define sz(x) ((int)((x).size())) #define clr(x, d) memset(x, d, sizeof...
C++
4750029f0a5e802099a6dd4dff2974d5
7bf3fb47b4cabf0899a03e95bc378956
1,900
PASSED
#include <bits/stdc++.h> #include <conio.h> using namespace std; #define mp make_pair #define pb push_back typedef long long ll; const int mxN = ll(2e5); const int INF = INT_MAX / 2; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int t; cin >> t; while(t--){ ...
C++
2d27f3530aa140be0add639a1edfd880
2b907a2ee0de0b2d309409c196e5a221
1,400
PASSED
#include <bits/stdc++.h> #include <conio.h> using namespace std; #define mp make_pair #define pb push_back typedef long long ll; const int mxN = ll(2e5); const int INF = INT_MAX / 2; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int t; cin >> t; while(t--){ ...
C++
2d27f3530aa140be0add639a1edfd880
bce1350dfd959fa45d7962708168a344
1,400
PASSED
#include <bits/stdc++.h> using namespace std; /*固定型define*/ #define min(a, b) (((a) < (b)) ? (a) : (b)) #define max(a, b) (((a) > (b)) ? (a) : (b)) #define case (num) printf("Case #%lld: ", ++num) #define IOS \ ios::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(...
C++
2d27f3530aa140be0add639a1edfd880
ba30addbf1a508401045ee503d46627c
1,400
PASSED
#include <bits/stdc++.h> using namespace std; /*固定型define*/ #define min(a, b) (((a) < (b)) ? (a) : (b)) #define max(a, b) (((a) > (b)) ? (a) : (b)) #define case (num) printf("Case #%lld: ", ++num) #define IOS \ ios::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0) #define...
C++
2d27f3530aa140be0add639a1edfd880
c29d0f17e575e7336335cbf378c2efd1
1,400
PASSED
#include <bits/stdc++.h> using namespace std; /*固定型define*/ #define min(a, b) (((a) < (b)) ? (a) : (b)) #define max(a, b) (((a) > (b)) ? (a) : (b)) #define case (num) printf("Case #%lld: ", ++num) #define IOS \ ios::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0) #define...
C++
2d27f3530aa140be0add639a1edfd880
a17312c956e2f77a09df06f4e68c0094
1,400
PASSED
#include <bits/stdc++.h> using namespace std; /*固定型define*/ #define min(a, b) (((a) < (b)) ? (a) : (b)) #define max(a, b) (((a) > (b)) ? (a) : (b)) #define case (num) printf("Case #%lld: ", ++num) #define IOS \ ios::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0) #define...
C++
2d27f3530aa140be0add639a1edfd880
9f42c7b54a8a9dcd9937a2498bbe8d2c
1,400
PASSED
#include <bits/stdc++.h> using namespace std; /*固定型define*/ #define min(a, b) (((a) < (b)) ? (a) : (b)) #define max(a, b) (((a) > (b)) ? (a) : (b)) #define case (num) printf("Case #%lld: ", ++num) #define IOS \ ios::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0) #define...
C++
2d27f3530aa140be0add639a1edfd880
cfd86ba6299b32aef3b84bc6078ba0af
1,400
PASSED
#include <iostream> #include <vector> #include <algorithm> #include<set> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; set<int>st; vector<int>numbers(n); for (int i = 0; i < n; i++) { cin >> numbers[i]; numbers[i] += numbers[i] % 10; if(numbers[i]...
C++
2d27f3530aa140be0add639a1edfd880
0701b11cb0ce70ab4e179fb600811543
1,400
PASSED
#include <iostream> #include <vector> #include <algorithm> #include<set> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; set<int>st; vector<int>numbers(n); for (int i = 0; i < n; i++) { cin >> numbers[i]; numbers[i] += numbers[i] % 10; if (numbers[i...
C++
2d27f3530aa140be0add639a1edfd880
a0d7a36ac0db28ecdd1b70ab05956f6b
1,400
PASSED
#include<iostream> #include<vector> #include<algorithm> #include<set> using namespace std; void solve(){ int n; cin>>n; vector<int>v(n); set<int>st; for(int i = 0;i<n;i++){ cin>>v[i]; v[i]+=v[i]%10; if(v[i]%10==2){ v[i]+=20; v[i]%=20;...
C++
2d27f3530aa140be0add639a1edfd880
7e6b138bc7d45a04dcf7f08573c48101
1,400
PASSED
t=int(input()) for i in range(t): n,q=input().split() n,q=int(n),int(q) a=list(map(int,input().split())) if q>=max(a) or q>=n: print('1'*n) continue bad=[j for j in range(len(a)) if a[j]>q] if len(bad)==1 and bad[0]==n-1: print('1'*n) continue ...
Python
62a90c34a7df8fb56419aa5a1cf2a75b
07ed0215241bd3f8e53318053b990db2
1,600
PASSED
from collections import defaultdict t = int(input()) for _ in range(t): n, q = map(int, input().split()) a = list(map(int, input().split())) Q = 0 out = [] for x in reversed(a): if x <= Q: out.append('1') else: if Q < q: Q += 1 ...
Python
62a90c34a7df8fb56419aa5a1cf2a75b
c20afb93ba59745f03c04de646a1eba9
1,600
PASSED
t = int(input()) for k in range(t): n, q = (int(num) for num in input().split(" ")) contests = [int(num) for num in input().split(" ")] ans = [0] * n # for i, c in enumerate(contests): # if c <= q: # ans[i] = 1 # min_q = 0 # for i in range(n-1, -1, -1): # if ans[i] ...
Python
62a90c34a7df8fb56419aa5a1cf2a75b
bc850094b84ea81d3c1dae419398381d
1,600
PASSED
import os import sys from io import BytesIO, IOBase from collections import Counter, defaultdict from sys import stdin, stdout import io import math import heapq import bisect import collections from collections import deque def ceil(a, b): return (a + b - 1) // b inf = float('inf') def get(): return s...
Python
62a90c34a7df8fb56419aa5a1cf2a75b
e1be6bba16955a58f91b955f3a473ddd
1,600
PASSED
import os import sys from io import BytesIO, IOBase from collections import Counter, defaultdict from sys import stdin, stdout import io import math import heapq import bisect import collections from collections import deque def ceil(a, b): return (a + b - 1) // b inf = float('inf') def get(): return s...
Python
62a90c34a7df8fb56419aa5a1cf2a75b
0ea4d975794ff0cf359560c23777348a
1,600
PASSED
#Fast I/O import sys,os import math # sys.setrecursionlimit(10**6) # To enable the file I/O i the below 2 lines are uncommented. # read from in.txt if uncommented if os.path.exists('in.txt'): sys.stdin=open('in.txt','r') # will print on Console if file I/O is not activated #if os.path.exists('out.txt'): sys.std...
Python
62a90c34a7df8fb56419aa5a1cf2a75b
4cd31a3d6fc1ff4d1f36b9dc59d5c287
1,600
PASSED
# Ver 1.02 def prnt(data): for i in data: print(i, end='') print() for _ in range(int(input())): n, q = map(int, input().split()) a = list(map(int, input().split())) if n <= q: b = [1] * n prnt(b) continue b = [0] * n for i in range(n): ...
Python
62a90c34a7df8fb56419aa5a1cf2a75b
175e5ee486dd1e7f1653ff21005bf1e6
1,600
PASSED
# Ver 1.02 def prnt(data): for i in data: print(i, end='') print() for _ in range(int(input())): n, q = map(int, input().split()) a = list(map(int, input().split())) if n <= q: b = [1] * n prnt(b) continue b = [0] * n for i in range(n): ...
Python
62a90c34a7df8fb56419aa5a1cf2a75b
0c5341ef4169a4d5c16cd7a642f81447
1,600
PASSED
# Ver 1.02 def prnt(data): for i in data: print(i, end='') print() for _ in range(int(input())): n, q = map(int, input().split()) a = list(map(int, input().split())) if n <= q: b = [1] * n prnt(b) continue b = [0] * n for i in range(n): ...
Python
62a90c34a7df8fb56419aa5a1cf2a75b
452ad2d125c6e790afa91623fb5e7706
1,600
PASSED
import sys,io,os from os import path from collections import Counter,defaultdict if(path.exists('input.txt')): sys.stdin = open('input.txt','r') sys.stdout = open('output.txt','w') else: input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline def main(): n,q=list(map(int,input().split())...
Python
62a90c34a7df8fb56419aa5a1cf2a75b
d6ce33d6002337b5a3bc9b637ba28fad
1,600
PASSED
#include<bits/stdc++.h> #define ll long long using namespace std; int read() { int x; scanf("%d",&x);return x; } int a[200010],n; void work() { n=read(); for(int i=1;i<=n;i++) a[i]=read(); for(int i=n;i>1;i--) { sort(a+1,a+1+i); if(a[i]==0) ...
C++
499b1440d8bb528d089724910e37e226
d5021363f0f924c861055f9da1dd100b
1,900
PASSED
#include<iostream> #include<cstdio> #include<cstring> #include<unordered_map> #include<vector> #include<set> #include<queue> using namespace std; int T; int n; int a[500005]; struct Node{ int a; int cnt; Node(){} Node(int aa,int cc){ a=aa,cnt=cc; } bool operator<(const ...
C++
499b1440d8bb528d089724910e37e226
aab5d34a02827a88c4ba9f12770e83da
1,900
PASSED
#define _CRT_SECURE_NO_WARNINGS 1 #include <algorithm> #include <iostream> #include <cstring> #include <cstdio> #include <map> #include<queue> #include<set> #include<math.h> #define FOR(a,b) for(int i=a;i<=b;i++) #define ROF(a,b) for(int i=a;i>=b;i--) #define FORj(a,b) for(int j=a;j<=b;j++) #define FORk(a,b...
C++
499b1440d8bb528d089724910e37e226
13a07786c80f6d23043a7bf9fb6c934c
1,900
PASSED
#include<iostream> #include<cstring> #include<algorithm> using namespace std; typedef long long LL; const int maxn = 1e5 + 5, INF = 0x3f3f3f3f; int a[maxn]; int main(){ cin.tie(0); cout.tie(0); ios::sync_with_stdio(0); int T; cin >> T; while(T--){ int n; cin ...
C++
499b1440d8bb528d089724910e37e226
5979a8298126071bbbf7119639503195
1,900
PASSED
#include<iostream> #include<cstring> #include<algorithm> using namespace std; typedef long long LL; const int maxn = 1e5 + 5, INF = 0x3f3f3f3f; int a[maxn]; int main(){ cin.tie(0); cout.tie(0); ios::sync_with_stdio(0); int T; cin >> T; while(T--){ int n; cin ...
C++
499b1440d8bb528d089724910e37e226
86958ac28b2d998ffd5bd863d124b3a6
1,900
PASSED
#include<cstdio> #include<cstring> #include<stdlib.h> #include<algorithm> #include<iostream> #include<vector> #include<set> #include<string> #include<map> #include<queue> #include<stack> #include<math.h> #define ll long long using namespace std; const int mod=1e9+7; const int INF=0x3f3f3f3f; in...
C++
499b1440d8bb528d089724910e37e226
af78b199b31eeef618e31de7c68932ae
1,900
PASSED
#include<cstdio> #include<cstring> #include<stdlib.h> #include<algorithm> #include<iostream> #include<vector> #include<set> #include<string> #include<map> #include<queue> #include<stack> #include<math.h> #define ll long long using namespace std; const int mod=1e9+7; const int INF=0x3f3f3f3f; inline i...
C++
499b1440d8bb528d089724910e37e226
e2692b0d741b1b4328ad37f15eb79de0
1,900
PASSED
#include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #define ch() getchar() #define pc(x) putchar(x) using namespace std; template<typename T>void read(T&x){ static char c;static int f; for(c=ch(),f=1;c<'0'||c>'9';c=ch())if(c=='-')f=-f; for(x=0;c>='0'&&c<='9';c=ch())x=x*10+(c&15);x*=f;...
C++
499b1440d8bb528d089724910e37e226
294c95e7aa1658e5915626c5245c7792
1,900
PASSED
#include <bits/stdc++.h> using std::cout; using std::cin; using std::vector; using std::set; using std::multiset; using std::pair; using std::greater; using std::sort; using std::max; using std::min; #define ll long long #define db double #define pii pair<int,int> #define inf 0x3f3f3f3f #define oo puts("...
C++
499b1440d8bb528d089724910e37e226
313dd7107e82079f1f164a4bad29dde5
1,900
PASSED
#include<bits/stdc++.h> using namespace std; const int N=1e5+100; int T,n; int a[N],b[N]; int main() { /* */ int t; cin>>t; while(t--) { int n; cin>>n; int cnt=0; int len=0; memset(a,0,sizeof(a)); memset(b...
C++
499b1440d8bb528d089724910e37e226
23e89433acec48ee1e2b827d2114748b
1,900
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; #define rep(i,a,n) for (ll i=a;i<(ll)n;i++) #define per(i,a,n) for (ll i=n;i-->(ll)a;) #define pb push_back ll read(){ll r;scanf("%lld",&r);return r;} // read const int N = 100000; const int PLEN = 19; // power length math...
C++
c445b61bfb982ac5dd128d1ad21af9fe
9015f30e2072b939c1507ebdbf65e175
3,500
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; #define rep(i,a,n) for (ll i=a;i<(ll)n;i++) #define per(i,a,n) for (ll i=n;i-->(ll)a;) #define pb push_back ll read(){ll r;scanf("%lld",&r);return r;} // read const int N = 100000; const int PLEN = 18; // power length cons...
C++
c445b61bfb982ac5dd128d1ad21af9fe
658692774332f374121c3cb0f4f34c89
3,500
PASSED
#include <bits/stdc++.h> using namespace std; const int N = 100000, L = 17, H = 17 * 2; struct rmq { int n; pair<int, int> st[L][N]; pair<int, int> f(pair<int, int> a, pair<int, int> b) { return make_pair(min(a.first, b.first), max(a.second, b.second)); } void init(int n_, int *ll, int *rr)...
C++
c445b61bfb982ac5dd128d1ad21af9fe
c9dc5dd5b844cec4d5912f70b44fb883
3,500
PASSED
#include <bits/stdc++.h> using namespace std; const int N = 100000, L = 18; struct rmq { int n; pair<int, int> st[L][N]; pair<int, int> f(pair<int, int> a, pair<int, int> b) { return make_pair(min(a.first, b.first), max(a.second, b.second)); } void init(int n_, int *ll, int *rr) { n = ...
C++
c445b61bfb982ac5dd128d1ad21af9fe
3beba89586a2f6eb0984fe65979b0cdd
3,500
PASSED
#include <bits/stdc++.h> using namespace std; const int N = 100000, L = 18; struct rmq { int n; pair<int, int> st[L][N]; pair<int, int> f(pair<int, int> a, pair<int, int> b) { return make_pair(min(a.first, b.first), max(a.second, b.second)); } void init(int n_, int *ll, int *rr) { n = ...
C++
c445b61bfb982ac5dd128d1ad21af9fe
af24117b022ac14af69309e111bcc53d
3,500
PASSED
#include <bits/stdc++.h> using namespace std; const int N = 100000, L = 18; struct rmq_min { int n, st[L][N]; void init(int n_, int *aa) { n = n_; copy(aa, aa + n, st[0]); for (int h = 1; 1 << h <= n; h++) { for (int i = 0; i + (1 << h) <= n; i++) st[h][i] = min(st[h - 1][i...
C++
c445b61bfb982ac5dd128d1ad21af9fe
03158588ca921c24f39e3b93c03f8c88
3,500
PASSED
#include <bits/stdc++.h> using namespace std; const int N = 100000, L = 18; struct rmq_min { int n, st[L][N]; void init(int n_, int *aa) { n = n_; copy(aa, aa + n, st[0]); for (int h = 1; 1 << h <= n; h++) { for (int i = 0; i + (1 << h) <= n; i++) st[h][i] = min(st[h - 1][i...
C++
c445b61bfb982ac5dd128d1ad21af9fe
70846c1ba10595e912a5bf71eec9280b
3,500
PASSED
#include <bits/stdc++.h> using namespace std; const int N = 200000, L = 18; struct rmq_min { int n, st[L][N]; void init(int n_, int *aa) { n = n_; copy(aa, aa + n, st[0]); for (int h = 1; 1 << h <= n; h++) { for (int i = 0; i + (1 << h) <= n; i++) st[h][i] = min(st[h - 1][i...
C++
c445b61bfb982ac5dd128d1ad21af9fe
67ce4d7bcb15e85eabfca8d2d3f6dd78
3,500
PASSED
// Author: wsyear // Problem: E. Replace // Contest: Codeforces - Codeforces Round #808 (Div. 1) // Memory Limit: 1024 MB // Time Limit: 1500 ms // // Powered by CP Editor (https://cpeditor.org) #include<bits/stdc++.h> #pragma GCC optimize("O3,unroll-loops") #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") ...
C++
c445b61bfb982ac5dd128d1ad21af9fe
9f56828fa0d4da644cb66f92a91f9f9e
3,500
PASSED
// Author: wsyear // Problem: E. Replace // Contest: Codeforces - Codeforces Round #808 (Div. 1) // Memory Limit: 1024 MB // Time Limit: 1500 ms // // Powered by CP Editor (https://cpeditor.org) #include<bits/stdc++.h> #pragma GCC optimize(2,3,"Ofast") using namespace std; #define rep(i,j,k) for(int i=(j);...
C++
c445b61bfb982ac5dd128d1ad21af9fe
7bc9af73754da2251ac8a84d889a6848
3,500
PASSED
#define ssh(x)<x> #include ssh(bits/stdc++.h) #define rfor(x...)for(register x) #define rep(i,l,r)rfor(ll i=l;i<=r;i++) #define ref(i,l,r)rfor(ll i=l;i<r;i++) #define per(i,l,r)rfor(ll i=l;i>=r;i--) #define rev(i,u,v)rfor(ll i=head[u],v;v=to[i],i;i=next[i]) #define rej(i,s)rfor(ll i=s;i;i=(i-1)&(s)) #define red(i,n)rfo...
C++
b7cbf0465cac777120f2a1ad52964a46
c197676ade7129323d9838003a174860
3,500
PASSED
#include <algorithm> #include <iostream> #include <sstream> #include <string> #include <vector> #include <queue> #include <set> #include <map> #include <cstdio> #include <cstdlib> #include <cctype> #include <cmath> #include <cstring> #include <list> #include <cassert> #include <...
C++
b7cbf0465cac777120f2a1ad52964a46
25a2dfef3dd8e64e919a40877ba548cb
3,500
PASSED