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
#include<bits/stdc++.h> using namespace std; #define pi pair<ll,ll> #define pii pair<pi,ll> #define fr freopen("in.txt","r",stdin) #define pb push_back #define rep(i,n) for(int i=0;i<n;i++) #define frep(i,n) for(int i=1;i<=n;i++) #define ll long long #define f first #define s second int maxval[3111][3111]; int ind[3111...
C++
7fdf7b0c58189aac64051b696259965f
bdeacdd0ed593328b422a6751c9daefd
2,300
PASSED
#include "bits/stdc++.h" #define MAXN 100009 #define INF 1000000007 #define mp(x,y) make_pair(x,y) #define all(v) v.begin(),v.end() #define pb(x) push_back(x) #define wr cout<<"----------------"<<endl; #define ppb() pop_back() #define tr(ii,c) for(__typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++) #define ff firs...
C++
7fdf7b0c58189aac64051b696259965f
7c03abae027535269559bc7c87b974a3
2,300
PASSED
#include<cstdio> #include<cstring> #include<ctime> #include<algorithm> using namespace std; #define to ed[p] #define each(x) for (int p=son[x];p;p=next[p]) #define add(x,y,z) ed[++l]=y,data[l]=z,next[l]=son[x],son[x]=l #define N 200005 int v[N],son[N],ed[N],data[N],next[N],s[N],f[N],g[N],f0[N],g0[N],q[N],w[N]; int n,l,...
C++
a895bffc17239ad05e3ca9be40ee97a7
0f8abc2404f122df3acf332fd75beca1
3,000
PASSED
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; #define to ed[p] #define each(x) for (int p=son[x];p;p=next[p]) #define add(x,y,z) ed[++l]=y,data[l]=z,next[l]=son[x],son[x]=l #define N 200005 int v[N],son[N],ed[N],data[N],next[N],s[N],f[N],g[N],f0[N],g0[N],q[N]; int n,l,r,mid,x,y,z,V,L,R,S,T...
C++
a895bffc17239ad05e3ca9be40ee97a7
235eefed840044a14d3ecc8a7fa64cc2
3,000
PASSED
#include<cstdio> #include<cstring> #include<ctime> #include<algorithm> using namespace std; #define to ed[p] #define each(x) for (int p=son[x];p;p=next[p]) #define add(x,y,z) ed[++l]=y,data[l]=z,next[l]=son[x],son[x]=l #define N 200005 int v[N],son[N],ed[N],data[N],next[N],s[N],f[N],g[N],f0[N],g0[N],q[N],w[N]; int n,l,...
C++
a895bffc17239ad05e3ca9be40ee97a7
9aa4fa1e59d347e9ddb818db2044005b
3,000
PASSED
#include<cstdio> #include<cstring> #include<ctime> #include<algorithm> using namespace std; #define to ed[p] #define each(x) for (int p=son[x];p;p=next[p]) #define add(x,y,z) ed[++l]=y,data[l]=z,next[l]=son[x],son[x]=l #define N 200005 int v[N],son[N],ed[N],data[N],next[N],s[N],f[N],g[N],f0[N],g0[N],q[N]; int n,l,r,mid...
C++
a895bffc17239ad05e3ca9be40ee97a7
bac3bc64641b2edb039143a5d1ef3d38
3,000
PASSED
#include<cstdio> #include<cstring> #include<algorithm> #define MAXN 101000 int x[2*MAXN],y[2*MAXN],z[2*MAXN],T(2),f[MAXN],n,L,R, s[MAXN],F[MAXN],D[MAXN],b[MAXN],Peo[MAXN],Max[MAXN], Stack[MAXN],_Stack[MAXN],StackT,Mid, Seqt,D2Max,_D2[MAXN],_D[MAXN],Ansx,Ansy,D2[MAXN]; struct pt{int f,y,d,z;}Seq[20*MAXN]; bool cmp...
C++
a895bffc17239ad05e3ca9be40ee97a7
0539ddd683898c97515170975e0375ca
3,000
PASSED
// Author:Arturia #include<cstdio> #include<cstring> #include<algorithm> #include<cctype> #include<ctime> #include<cstdlib> #include<string> #include<queue> #include<cmath> #include<set> #include<map> #include<bitset> #include<vector> #define rep(x,a,b) for (int x=a;x<=(int)b;x++) #define drp(x,a,b) for (int x=a;x>=(...
C++
a895bffc17239ad05e3ca9be40ee97a7
011eb8fc62f6fe99d504a40c522eaeb1
3,000
PASSED
// Author:Arturia #include<cstdio> #include<cstring> #include<algorithm> #include<cctype> #include<ctime> #include<cstdlib> #include<string> #include<queue> #include<cmath> #include<set> #include<map> #include<bitset> #include<vector> #define rep(x,a,b) for (int x=a;x<=(int)b;x++) #define drp(x,a,b) for (int x=a;x>=(...
C++
a895bffc17239ad05e3ca9be40ee97a7
fd8d306d2fa43badb8f4e532ef523bf0
3,000
PASSED
// Author:Arturia #include<cstdio> #include<cstring> #include<algorithm> #include<cctype> #include<ctime> #include<cstdlib> #include<string> #include<queue> #include<cmath> #include<set> #include<map> #include<bitset> #include<vector> #define rep(x,a,b) for (int x=a;x<=(int)b;x++) #define drp(x,a,b) for (int x=a;x>=(...
C++
a895bffc17239ad05e3ca9be40ee97a7
fd6ec24d02e4674e7e37910785cdba05
3,000
PASSED
#include<cstdio> #include<cstring> #include<algorithm> #include<queue> #include<iostream> #include<cmath> #include<cstdlib> #include<cctype> #include<vector> #define pb push_back using namespace std; typedef long long ll; inline ll read() { char ch = getchar(); ll x = 0; int op = 1; for(; !isdigit(ch); ch = getchar(...
C++
a895bffc17239ad05e3ca9be40ee97a7
87f2af70c0be721a06bf1be000b9ba1c
3,000
PASSED
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; int n,Llimit,Rlimit,xx,yy,ans,mid,v[200010],w[200010],next[200010],head[100010],f[100010],ff[100010],who[100010]; int who2[100010],s[100010],fr[100010],ma[100010],q[100010],qh,qt,vt,cut[100010],id[100010],tot,limit,to[100010],wei[100010],inf=10...
C++
a895bffc17239ad05e3ca9be40ee97a7
ba0665ff8ff5a2d72799352168b539a4
3,000
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long lint; struct ImplicitSegmentTree { struct Node { lint value; Node* left; Node* right; Node(): value(0), left(NULL), right(NULL) {} Node(lint value_): value(value_), left(NULL), right(NULL) {} }; lint start, end; No...
C++
8d0f569359f655f3685c68fb364114a9
13eaff3d4775e0a7da7700dcb0e8f184
2,000
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long lint; struct Node { Node *left; Node *right; lint value; Node(): left(NULL), right(NULL), value(0) {} Node(lint value_): left(NULL), right(NULL), value(value_) {} }; lint get(Node* node) { if (!node) return 0; return node->...
C++
8d0f569359f655f3685c68fb364114a9
71a54d7d8676081795323ed1716f980a
2,000
PASSED
#include <bits/stdc++.h> using namespace std; const int MAX = 1e9; template<typename T> struct DynamicSegmentTree { struct Node { T val; Node *left, *right; Node(): val(T()), left(NULL), right(NULL) {} Node(long long _val): val(_val), left(NULL), right(NULL) {} }; long long start,...
C++
8d0f569359f655f3685c68fb364114a9
7526299dcd9b90689aa9563391f362ac
2,000
PASSED
#include<cstdio> #include<cstring> #include <algorithm> using namespace std; const int N=110000; struct node1{ int a,b; int h; }a[N]; int n,num=0; long long ans=0; long long tree[4*N]; bool cmp1(node1 a,node1 b){ return a.b==b.b?a.a>b.a:a.b>b.b; } struct node2{ int x,y,z; }b[2*N]; bool cmp2(node2 a,node2 b){ retu...
C++
8d0f569359f655f3685c68fb364114a9
46df0453447a5be8204a94cbbb36439e
2,000
PASSED
#include<cstdio> #include<algorithm> #include<stack> #define N 110000 using namespace std; inline char gc(){ static char now[1<<16], *S, *T; if(S==T){T=(S=now)+fread(now, 1, 1<<16, stdin); if(S==T)return EOF;} return *S++; } inline int read(){ int x=0;char ch=gc(); while (ch<'0'||ch>'9') ch=gc(); ...
C++
8d0f569359f655f3685c68fb364114a9
81dd8f102bd3f8613e2352038ade2bce
2,000
PASSED
#include<cstdio> #include<algorithm> #include<vector> #define N 110000 using namespace std; inline char gc(){ static char now[1<<16], *S, *T; if(S==T){T=(S=now)+fread(now, 1, 1<<16, stdin); if(S==T)return EOF;} return *S++; } inline int read(){ int x=0;char ch=gc(); while (ch<'0'||ch>'9') ch=gc(); ...
C++
8d0f569359f655f3685c68fb364114a9
53935fb27b93d4debdd9957a1b34224f
2,000
PASSED
#include <bits/stdc++.h> #define ll long long #define str string #define pll pair<ll, ll> #define fi first #define se second #define pb push_back #define SET(a, b) memset(a, b, sizeof(a)) #define pq priority_queue #define ff fflush(stdout) using namespace std; struct data { ll i, o, h; }; data ring[100005]; bool cmp (...
C++
8d0f569359f655f3685c68fb364114a9
db6ff76f045e10e12ea3d9820d5891bc
2,000
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long int ll; struct node{ ll a,b,h; bool operator<(const node& p)const{ if(p.b==b)return p.a<a; return p.b<b; } }; const int N=2*1e6; vector<node>v; map<ll,int>mp; vector<ll>vp; ll T[N]; void update(int n,int b,int e,int i,ll val){ ...
C++
8d0f569359f655f3685c68fb364114a9
952f7421e8c981d9b7540941c5d141ef
2,000
PASSED
#include <bits/stdc++.h> #include <stdio.h> #include <cstdio> /*#include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/detail/standard_policies.hpp>*/ #define pb push_back #define mp make_pair #define sz(s) ((int)(s.size())) #define all(s) s.begin(),s.end() #define rep(i,a,n...
C++
8d0f569359f655f3685c68fb364114a9
e02c1c2d61be0f3fbf61d2ff4775f82d
2,000
PASSED
#include <stdio.h> #include <iostream> #include <math.h> #include <stack> #include <memory.h> #include <algorithm> #include <vector> #include <string> #include <queue> #include <climits> #include <map> #include <set> using namespace std; #define int long long struct Circle { Circle() {} Circle(int R, int r, i...
C++
8d0f569359f655f3685c68fb364114a9
9e87e9c7d5c87611d4e4011964b95a17
2,000
PASSED
#include <vector> #include <iostream> #include <algorithm> #include <unordered_map> using namespace std; const int maxn = 100000 + 10; int n, a[maxn], tar, ax[2], mx = 0, c[2]; vector<int> e[maxn]; unordered_map<int, int> m[2]; void dfs(int x, int u) { ax[u] ^= a[x]; mx = max(mx, a[x]); c[u]++; if (m[u].count(a[...
C++
6ecf80528aecd95d97583dc1aa309044
5eb41bd017c2c998ea5822d2be22b3fa
2,300
PASSED
#include <vector> #include <iostream> #include <algorithm> using namespace std; const int maxn = 100000 + 10, maxai = 10000000 + 10; int n, a[maxn]; int m[2][maxai], tar, ax[2], mx = 0, c[2]; vector<int> e[maxn]; void dfs(int x, int u) { ax[u] ^= a[x]; mx = max(mx, a[x]); c[u]++; m[u][a[x]]++; tar = u; for (i...
C++
6ecf80528aecd95d97583dc1aa309044
04e533325c7e65e911e33cb15f80e433
2,300
PASSED
#include <iostream> #include <set> using namespace std; long long blue[10000002]; long long red[10000002]; long long parent[100002]; long long a[100002]; bool flag[100002]; bool isBlue[100002]; set<long long> r,b; int main() { long long x=0,maxa=-1,ans=0; long long cntBlue=0,cntRed=0; long long n,i,j; cin...
C++
6ecf80528aecd95d97583dc1aa309044
c8e29f288c7989b7a00c8561311bbc78
2,300
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long LL; map<int,LL> odd; map<int,LL> even; const int N=1e5+5; int n; vector<int> adj[N]; LL a[N]; int p[N]; LL s; LL ans; int flag; void dfs(int cur,int tag) { if(tag==flag) s=s^a[cur]; // printf("cur=%d,s=%d..............\n",cur,s); if(tag==0) even[a[cur]...
C++
6ecf80528aecd95d97583dc1aa309044
e0d0d4ec00a308697e24f5ec0994f937
2,300
PASSED
#include <bits/stdc++.h> using namespace std; #define int64 long long const int RAN = 1e5 + 5; const int RAN1 = 1e7 + 5; int64 nd, p, a, sol, V[RAN]; vector <int64> v[RAN], P; map <int64, int64> T; void dfs(int64 nod){ p = 0; int t = v[nod].size(); for (int i = 0; i < t; i++) dfs (v[nod][i]...
C++
6ecf80528aecd95d97583dc1aa309044
4e16619c6c594f03164486748cea09ef
2,300
PASSED
#include <bits/stdc++.h> #define mx 100005 using namespace std; typedef long long lli; lli a[mx]; vector <int> node[mx]; int lvl[mx], mm; lli blue[10000007], red[10000007]; void dfs(int x, int y){ lvl[x]=y; int xx=node[x].size(); if(!xx) mm=y; for(int i=0; i<xx; i++){ dfs(node[x][i], y+1); } } i...
C++
6ecf80528aecd95d97583dc1aa309044
c6d4954515c57a8d0220cb70030b7f02
2,300
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 100005; int a[N], used[N], tot, cnt; vector<int> g[N]; int dfs(int u){ int t = 1; for(int v : g[u]){ t = dfs(v); } if(t) used[u] = 1, tot ^= a[u], cnt++; return t ^ 1; } int occ[20000007]; int main(){ int n; scanf("%d", ...
C++
6ecf80528aecd95d97583dc1aa309044
0a46081668c754dcb281c39183f17cf1
2,300
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 100005; int a[N], used[N], tot, cnt; vector<int> g[N]; int dfs(int u){ int t = 1; for(int v : g[u]){ t = dfs(v); } if(t) used[u] = 1, tot ^= a[u], cnt++; return t ^ 1; } int main(){ int n; scanf("%d", &n); for(int i = 1...
C++
6ecf80528aecd95d97583dc1aa309044
4fda89deae931db8d2a7e04f2d0770b8
2,300
PASSED
//created by missever #include<bits/stdc++.h> #define MAX 1000000007 using namespace std; typedef long long LL; const int maxn = 1e5 + 5; vector<int> g[maxn]; int a[maxn],tot = 1; vector<int> f1,f2; map<int,int> q; bool dfs(int u) { bool vis = 1; for(auto v:g[u]) vis = dfs(v) ^ 1; if(vis) f1.push_back(a[...
C++
6ecf80528aecd95d97583dc1aa309044
b5dc84d168ba0d74e9fdc8b7f32e29a9
2,300
PASSED
#include <cstdio> #include <cstring> #include <algorithm> #include <iostream> #include <vector> #include <map> using namespace std; const int MAXN = 100005; int n; vector<int> edges[MAXN]; long long val[MAXN]; int dep[MAXN]; long long xov[2]; int leaf; long long cnt[2]; map<long long, long long> cc[2]; void dfs(int...
C++
6ecf80528aecd95d97583dc1aa309044
d83ea1838a7d206f07c043750323c148
2,300
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long ll; vector<int>freq(int(1e7+500)),acc(int(1e7+500)); vector<int>prime; bitset<int(1e7)>is_not_prime; void sieve(); int main() { ios_base::sync_with_stdio(false); cin.tie(0);cout.tie(0); //freopen("in.txt","r",stdin); //freopen("out.txt","w",...
C++
fe42c7f0222497ce3fff51b3676f42d1
3384d262a006d35e505ce18d83b909ec
1,700
PASSED
#include <bits/stdc++.h> using namespace std; #define mod 1000000007 #define crap ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0) #define rgod(i,a,b) for(int i=a;i>=b;i--) #define god(i,a,b) for(int i=a;i<b;i++) #define sote(a) sort(a.begin(),a.end()) #define pb push_back #define mp make_pair #define lli long long...
C++
fe42c7f0222497ce3fff51b3676f42d1
8bfaa10fc255a8b0eabdfba3653e82aa
1,700
PASSED
#include<bits/stdc++.h> #define maxy 10000005 #define maxx 10000000 using namespace std; int main() { ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0); vector<int>primesf(maxy,0),af(maxy,0); vector<bool>p(maxy,0); int ans=0; int n; cin>>n; for(int i=0;i<n;++i){ int a; cin>>a; ...
C++
fe42c7f0222497ce3fff51b3676f42d1
55c82222e127a18595fcb7a58ba0c0d7
1,700
PASSED
#include<bits/stdc++.h> using namespace std; vector<int> getPrimes(vector<int>&a,int x){ vector<int>res; if(x==1){ return res; } if(!a[x]){ res.push_back(x); return res; } while(x){ if(!a[x]){ if(res.size()){ int sz=res.size(); if(res[sz-1]==x){ break; } else{ res.pu...
C++
fe42c7f0222497ce3fff51b3676f42d1
0f67565f5964fb433ebd2c73cf06c87d
1,700
PASSED
#include<bits/stdc++.h> using namespace std; vector<int> getPrimes(vector<int>&a,int x){ vector<int>res; if(x==1){ return res; } if(!a[x]){ res.push_back(x); return res; } while(x){ if(!a[x]){ if(res.size()){ int sz=res.size(); if(res[sz-1]==x){ break; } else{ res.pu...
C++
fe42c7f0222497ce3fff51b3676f42d1
055f0acf3b853e65fb97fe3bfef2710a
1,700
PASSED
#include<bits/stdc++.h> using namespace std; vector<int> getPrimes(vector<int>&a,int x){ vector<int>res; if(x==1){ return res; } if(!a[x]){ res.push_back(x); return res; } while(x){ if(!a[x]){ if(res.size()){ int sz=res.size(); if(res[sz-1]==x){ break; } else{ res.pu...
C++
fe42c7f0222497ce3fff51b3676f42d1
74faf5872ab2299a6d57ccab11db2a86
1,700
PASSED
//By Vasu Agrawal #include<iostream> #include<bits/stdc++.h> typedef long long int ll; #define pb push_back #define pob pop_back #define mk make_pair #define fr first #define sc second #define pu push #define ins insert #define mod 1000000007 #define mem(a,val) memset(a,val,sizeof(a)) #define V(a) vector<a> #define pp...
C++
fe42c7f0222497ce3fff51b3676f42d1
b31ddc8b7957e126ce8d407e27170c72
1,700
PASSED
#include <iostream> #include <map> using namespace std; const int N = 1e7 + 10; int n, m, l, r, k; unsigned long long answ[N], mp[N]; bool prim[N]; int main(){ scanf("%d", &n); for (int i = 0; i < n; i++){ cin >> k; mp[k]++; } for (int i = 2; i < N; i++){ if (!prim[i]){ ...
C++
fe42c7f0222497ce3fff51b3676f42d1
7d0fbd65acdde99af9cc90bf6dbcddc3
1,700
PASSED
#include <iostream> #include <iomanip> #include <vector> #include <map> #include <set> #include <unordered_set> #include <queue> #include <stack> #include <cmath> #include <string> #include <bits/stdc++.h> #include <chrono> #define lli long long int #define ld long double using namespace std; using namespace std::ch...
C++
fe42c7f0222497ce3fff51b3676f42d1
ac4163e5bea4941c57074e62028c7580
1,700
PASSED
#include <iostream> #include<stdio.h> #include<vector> using namespace std; int mas[10000002]; long long sum[1000000]; long long S[1000000]; int pod[10000001]; vector<int> lt; long long ans(int l, int r) { if (!l) { return S[r]; } return S[r] - S[l - 1]; } int main() { int n, m, numb, ind = 0, l, r; ...
C++
fe42c7f0222497ce3fff51b3676f42d1
336f20f809256f966622ab6758797e84
1,700
PASSED
#include<stdio.h> #include<stdlib.h> void swap(int *v1,int *v2) { int t; t=*v1; *v1=*v2; *v2=t; } int main() { int n,i,j,pos,count=0; int *p,*t; scanf("%d %d",&n,&pos); p=(int*)malloc(n*sizeof(int)); t=(int*)malloc(n*sizeof(int)); for(i=0;i<n;i++) scanf("%d %d",&p[i],&t[i]); for(i=0;i<n-1;i++) { for...
C
63e03361531999db408dc0d02de93579
a366ecdd7ef11572423837636ef362cc
1,100
PASSED
#include<stdio.h> #define swap(a,b) a^=b; b^=a; a^=b; int main () { int s=0,i,j,n,k,r[51][2]; scanf("%d%d",&n,&k); k--; for(i=0;i<n;i++) scanf("%d %d",&r[i][0],&r[i][1]); for(i=0;i<n;i++) { for(j=0;j<n-i-1;j++) { if( r[j][0]<r[j+1][0] || (r[j][0]==r[j+1][0] && r[j][1]>r[j+1][1]) ) { swap(r[j][0],r...
C
63e03361531999db408dc0d02de93579
47610a9d06b7e9d613472a33d53cca48
1,100
PASSED
#include <stdio.h> int main(){ int temp,n,k,max,count,i,j; scanf("%d%d",&n,&k); int p[n]; int t[n]; for(i=0;i<n;i++) scanf("%d%d",&p[i],&t[i]); for(i=0;i<n;i++){ max = i; for(j=i;j<n;j++){ if(p[j]>p[max]) max = j; else if(p[j]==p[max] && t[j]<t[max]) max = j; } temp = p[i]; p[i] = p[...
C
63e03361531999db408dc0d02de93579
389d170079e8a6675d820cae067a51c3
1,100
PASSED
#include <stdio.h> #include <stdlib.h> int main() { int i, a[51][51], num, k, p, t, maxP = 0, count = 0, j, maxT = 0, test = 0; for (i = 0; i < 51; i++){ for (j = 0; j < 51; j++){ a[i][j] = 0; } } scanf("%d %d", &num, &k); for (i = 0; i < num; i++){ scanf("%d %d"...
C
63e03361531999db408dc0d02de93579
641fc962b29886538d6c84c53fa09b3b
1,100
PASSED
#include <stdio.h> #include <stdlib.h> struct team { int prob ; int penality; }; int main() { int n , k , i , counter = 0 , j ; scanf("%d%d",&n ,&k); struct team array[n]; struct team temp ; for(i=0 ; i < n ; i++) { scanf("%d",&array[i].prob); scanf("%d",&array[i].pe...
C
63e03361531999db408dc0d02de93579
2179421f0c33c5027e0439e1da13551f
1,100
PASSED
#include"stdio.h" #include"ctype.h" #include"stdlib.h" #include"string.h" struct pair{ long first; long second; }; int bm=0; int k; struct node{ int c; struct pair p; struct node *left; struct node *right; }; int compare(struct pair p1,struct pair p2){ if((p1.first>p2.first)|| (p1.first==p2.first && p1.second<p2...
C
63e03361531999db408dc0d02de93579
4cb04944b3a610155e35501710bf8a6f
1,100
PASSED
#include<stdio.h> void merge_sort(int,int); struct result { int prob; int time; }; struct result score[100]; struct result dummy[100]; int main() { int i,n,k,j,shared; shared=-1; scanf("%d %d",&n,&k); k--; for(i=0;i<n;i++) { scanf("%d %d",&score[i].prob,&score[i].time); } merge_sort(0,n-1); // for(i=0;i<n;i...
C
63e03361531999db408dc0d02de93579
9eb60777375cc9e69b14a5b6033e7f98
1,100
PASSED
#include<stdio.h> void sort(int a[][2],int n) {int i,j,max,temp; for(i=0;i<n;i++) {max=i; for(j=i+1;j<n;j++) { if(a[max][0]<a[j][0]) max=j; else if(a[max][0]==a[j][0]) { if(a[max][1]>a[j][1]) max=j; } ...
C
63e03361531999db408dc0d02de93579
f823fee174d069899b8321c32017f9bc
1,100
PASSED
#include<stdio.h> int main() { int n,k,i,j,c=0,temp,p[50],t[50]; scanf("%d%d",&n,&k); for(i=0;i<n;i++) scanf("%d%d",&p[i],&t[i]); for(i=0;i<n;i++){ for(j=i+1;j<n;j++){ if(p[i]<p[j] || (p[i]==p[j] && t[i]>t[j])){ temp=p[i]; p[i]=p[j]; ...
C
63e03361531999db408dc0d02de93579
a8f0874a7e04d80bd744b2e1f3a135e3
1,100
PASSED
#include<stdio.h> #include<stdlib.h> struct Team{ int num; int time; }team[60]; int cmp1(const void *a,const void *b) { struct Team *c=(struct Team*)a; struct Team *d=(struct Team*)b; if(c->num!=d->num) return d->num-c->num; else return c->time-d->time; } int main() { int i,j...
C
63e03361531999db408dc0d02de93579
c8d4c1f51103e72f7728720cda5c7423
1,100
PASSED
#include <bits/stdc++.h> using namespace std; double n; double m; double a[10000]; double b[10000]; bool F(double x){ double w = x + m; w = w - (w / a[0]); for(int i=1 ; i < n ;i++){ w = w - (w / a[i]); w = w - (w / b[i]); } w = w - (w / b[0]); // cout << w; if(w >= m){ return true; } if(w < m){ return ...
C++
d9bd63e03bf51ed87ba73cd15e8ce58d
ec7e370979b682dc57d52b5f90983069
1,500
PASSED
#include<bits/stdc++.h> #define ll long long int #define pb push_back using namespace std; int main(){ ll n,m,i,x,flag=0,j; cin>>n>>m; double a[n],b[n]; for(i=0;i<n;i++){ cin>>a[i]; } for(i=0;i<n;i++){ cin>>b[i]; } vector<double> vi; for(i=0;i<n-1;i++){ vi.pb(a[i]); vi.pb(b[i+1]); } vi.pb(a[n-1]); ...
C++
d9bd63e03bf51ed87ba73cd15e8ce58d
c1d9ad4f1a08c58f2ccf02055781430c
1,500
PASSED
#include<bits/stdc++.h> #define ll long long int #define pb push_back using namespace std; int main(){ ll n,m,i,x,flag=0,j; cin>>n>>m; double a[n],b[n]; for(i=0;i<n;i++){ cin>>a[i]; } for(i=0;i<n;i++){ cin>>b[i]; } vector<double> vi; for(i=0;i<n-1;i++){ vi.pb(a[i]); vi.pb(b[i+1]); } vi.pb(a[n-1]); ...
C++
d9bd63e03bf51ed87ba73cd15e8ce58d
bec56fb59a499032a51adb188c9f09f4
1,500
PASSED
#include<bits/stdc++.h> #define ll long long int #define mp make_pair #define pb push_back using namespace std; int main(){ ll n,m,i,x,flag=0,j; cin>>n>>m; double a[n],b[n]; for(i=0;i<n;i++){ cin>>a[i]; } for(i=0;i<n;i++){ cin>>b[i]; } vector<double> vi; for(i=0;i<n-1;i++){ vi.pb(a[i]); vi.pb(b[i+1]);...
C++
d9bd63e03bf51ed87ba73cd15e8ce58d
8bdf1bc6258d43d3f8f474b6a804f517
1,500
PASSED
/// Source : https://leetcode.com/problems/two-sum/description/ /// Author : liuyubobobo /// Time : 2018-07-29 #include <iostream> #include <vector> #include <iomanip> using namespace std; /// Mathematic /// Time Complexity: O(n) /// Space Complexity: O(1) class Solution{ public: double minFuel(int m, const ...
C++
d9bd63e03bf51ed87ba73cd15e8ce58d
6b5b92afa7ea9d33f72cee9a78c797e4
1,500
PASSED
#include <bits/stdc++.h> using namespace std; #define ll long long int #define rep(i,n) for(i=0;i<(n);i++) #define pb push_back #define mp make_pair #define ff first #define ss second #define all(c) c.begin(),c.end() #define endl "\n" typedef pair< ll, ll > lpair; bool poss(double f,vector< ll > a, vector< ll > b,ll ...
C++
d9bd63e03bf51ed87ba73cd15e8ce58d
5ab23ed221ba48c57d1f97ed74313bfa
1,500
PASSED
#include <bits/stdc++.h> using namespace std; #define ll long long int #define rep(i,n) for(i=0;i<(n);i++) #define pb push_back #define mp make_pair #define ff first #define ss second #define all(c) c.begin(),c.end() #define endl "\n" typedef pair< ll, ll > lpair; bool poss(double f,vector< ll > a, vector< ll > b,ll ...
C++
d9bd63e03bf51ed87ba73cd15e8ce58d
134769746cd9a463a28106e0b378356f
1,500
PASSED
#include<bits/stdc++.h> using namespace std; int main() { int n; double m; cin>>n>>m; double a[n],b[n]; for(int i=0;i<n;i++) { cin>>a[i]; if(a[i]<=1) { cout<<-1; return 0; } } for(int i=0;i<n;i++) { cin>>b[...
C++
d9bd63e03bf51ed87ba73cd15e8ce58d
ea14a3f280a0f3fdeb6233ff64f2609f
1,500
PASSED
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double int main() { #ifndef ONLINE_JUDGE freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n,m; cin>>n>>m; ld a1[n],a2[n]; for(i...
C++
d9bd63e03bf51ed87ba73cd15e8ce58d
de8bea67038712d94cf260b3335d901f
1,500
PASSED
#include<bits/stdc++.h> using namespace std; int n; long double m; long double a[1005] , b[1005]; bool canTravel(long double fuel) { for(int i=1;i<=n;i++) { if( (m+fuel)/a[i] <= fuel ) fuel -= (m+fuel)/a[i]; else return false; if(i<n) { if((m+fuel)/b[i+1] <= fuel) fuel -= (m+fuel)/b[i+1]; else return ...
C++
d9bd63e03bf51ed87ba73cd15e8ce58d
cda78077d2eeebc2f99c02ea1ea1983d
1,500
PASSED
#include <iostream> #include <cstdio> #include <cstring> #include <vector> #include <cmath> #include <queue> #include <algorithm> using namespace std; typedef long long ll; const int maxn = 500000 + 10; const int maxm = 2000000 + 10; const ll INF = 2e18; int a[maxn]; ll cnt[maxm],sum[maxm]; int main(){ int n,x,y,...
C++
41a1b33baa83aea57423b160247adcb6
484a90532b684c0b8d80f9ee65fc7365
2,100
PASSED
#include <iostream> #include <algorithm> #include <cstdlib> #include <cstdio> #include <cmath> #include <cstring> #include <queue> #include <set> #include <vector> #include <map> using namespace std; typedef long long LL; typedef pair <int,int> II; const int maxn = 5e5+10; const int maxint = 0x3f3f3f3f; const int mod...
C++
41a1b33baa83aea57423b160247adcb6
c76177308eea6f6e77e5781f94d8698e
2,100
PASSED
//in the name of Allah #include <bits/stdc++.h> using namespace std ; #define F first #define S second typedef long long ll ; const ll INF = 1e10 ; const ll N = 1000100 ; ll n , a[N] , sum[2*N] , qu[2*N] , ans = INF , x , y ; int main() { std::ios::sync_with_stdio(0) ; cin.tie(0) ; cout.tie(0); cin >> n >> x >> y ; for...
C++
41a1b33baa83aea57423b160247adcb6
6608e13481228230a9f942cf14f120d7
2,100
PASSED
#include<bits/stdc++.h> using namespace std; int n,x,y,tmp,max1; long long cnt[2000010],sum[2000010]; long long res,ans=0x3f3f3f3f3f3f3f3f; int main() { scanf("%d%d%d",&n,&x,&y); for(int i=1;i<=n;i++) scanf("%d",&tmp),cnt[tmp]++,sum[tmp]+=tmp,max1=max(max1,tmp); for(int i=1;i<=2000000;i++) cnt[i]=cnt[i-1]...
C++
41a1b33baa83aea57423b160247adcb6
ce3d77acbf9d6ce4e00af75ccb7a7b70
2,100
PASSED
#include<bits/stdc++.h> using namespace std; const int maxn = 1e6 + 10; typedef __int64 LL; #define INF __INT64_MAX__ LL n,x,y; LL sum[maxn]; LL a[maxn]; bool vis[maxn]; int main() { cin>>n>>x>>y; for(int i=1; i<=n; i++) { cin>>a[i]; sum[a[i]]++; } LL ans = INF; for(int i=2; i<m...
C++
41a1b33baa83aea57423b160247adcb6
5aeb8923afd476dc8cd3dc5d08e2d62c
2,100
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int MAXN = 5e5 + 1; const int MAXA = 2e6; int n, lef, rig, mid, head, tail, pos; ll x, y, a[MAXN], sum[MAXN], res = 1e18, tmp; bool not_prime[MAXA + 1]; int main(){ //freopen("in.txt", "r", stdin); scanf("%d %lld %lld", &n, &x, &y); ...
C++
41a1b33baa83aea57423b160247adcb6
4d6388a9d885685c42326cb260045646
2,100
PASSED
#include<iostream> #include<cstdio> #include<cmath> #include<ctime> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; #define ll long long #define N 500010 char getc(){char c=getchar();while ((c<'A'||c>'Z')&&(c<'a'||c>'z')&&(c<'0'||c>'9')) c=getchar();return c;} int gcd(int n,int m){return m...
C++
41a1b33baa83aea57423b160247adcb6
0d204a8f0fc85c4b936a97cbfc480e33
2,100
PASSED
#include<iostream> #include<cstdio> #include<cmath> #include<ctime> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; #define ll long long #define N 500010 char getc(){char c=getchar();while ((c<'A'||c>'Z')&&(c<'a'||c>'z')&&(c<'0'||c>'9')) c=getchar();return c;} int gcd(int n,int m){return m...
C++
41a1b33baa83aea57423b160247adcb6
72244098e4169446ca0a16c8e1cb58f9
2,100
PASSED
#include<vector> #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> //#include<cmath> //#include<queue> //#include<stack> //#include<map> //#include<set> using namespace std; typedef long long ll; #define x first #define y second #define pb push_back #define mp make_pair #define all(a) (a).begin(...
C++
41a1b33baa83aea57423b160247adcb6
cceb8381de16ba6ec4d007d86b31a6b5
2,100
PASSED
#include<vector> #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> //#include<cmath> //#include<queue> //#include<stack> //#include<map> //#include<set> using namespace std; typedef long long ll; #define x first #define y second #define pb push_back #define mp make_pair #define all(a) (a).begin(...
C++
41a1b33baa83aea57423b160247adcb6
62dbe86913fc76ac1352bf5d0c750f0a
2,100
PASSED
#include<cstdio> #include<algorithm> using namespace std; int n,i,Max; int a[100010],f[100010]; inline int read() { int x=0,f=1; char ch=getchar(); while (ch>'9'||ch<'0') { if (ch=='-') f=-1; ch=getchar(); } while (ch<='9'&&ch>='0') x=x*10+ch-'0',ch=getchar(); return x*f; } inline void write(int x) { ...
C++
e544ed0904e2def0c1b2d91f94acbc56
5ad9d0703a6eb29b013c6cdf5cf1e221
1,100
PASSED
#include <bits/stdc++.h> using namespace std; int main(){ int num_casas, i, casas[100005], maximo; scanf("%d", &num_casas); for(i=0; i<num_casas; i++) scanf("%d", &casas[i]); maximo = casas[num_casas-1]; casas[num_casas-1] = 0; for(i=num_casas-2; i>=0; i--){ if(maximo < casas[i]){ maximo = casa...
C++
e544ed0904e2def0c1b2d91f94acbc56
6bb22fa9754ef1a5c37f44b212da8422
1,100
PASSED
#include <bits/stdc++.h> using namespace std; int main() { int i,j=0,n,a[1000000],m=0,b[1000000]; cin>>n; for(i=0;i<n;i++) cin>>a[i]; for(i=n-1;i>=0;i--) { if(a[i]>m) b[i]=0; else b[i]=m-a[i]+1; m=max(m,a[i]); } for(i=0;i<n;i++) cout<<b[i]<<" "; }
C++
e544ed0904e2def0c1b2d91f94acbc56
2ff3646a87e12eb1b12a266c5f1214ae
1,100
PASSED
#include <bits/stdc++.h> using namespace std; #define imp() ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0) #define pb push_back #define endl "\n" #define lli long long int #define ll long long int main() { ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL); int n;cin>>n; int x;vector<int...
C++
e544ed0904e2def0c1b2d91f94acbc56
e94472c157b82f243e0ff56dce380f51
1,100
PASSED
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define ll long long #define MOD 1000000007 #define ull unsigned long long using namespace std; int main() { bool testing = false; std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); if(testing) { freopen("test.txt","rt",stdin); /...
C++
e544ed0904e2def0c1b2d91f94acbc56
3b73d449def2d6fe9240768bcdd3e24e
1,100
PASSED
#include<bits/stdc++.h> using namespace std; #define ll long long int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};//king move int fy[]={-1,+1,+0,+0,+1,+1,-1,-1}; vector<ll>v; int main() { ios::sync_with_stdio(false); cin.tie(0); ll n; cin>>n; ll arr[n]; ll arr2[n]; for(int i=0;i<n;i++) { ci...
C++
e544ed0904e2def0c1b2d91f94acbc56
d0efa994a239cf520df7dc3306e170a0
1,100
PASSED
#include <bits/stdc++.h> using namespace std; const int NN=101010; int a[NN]; int b[NN]; int main(){ #ifndef ONLINE_JUDGE freopen("in.in","r",stdin); #endif int n; cin>>n; for(int i=1;i<=n;i++)scanf("%d",a+i); int mx = 0; for(int i=n;i;i--){ if(a[i] > mx) mx = a[i]; else b[i] = mx - a[i] +1; } for(in...
C++
e544ed0904e2def0c1b2d91f94acbc56
a3d895db06e5c693ffd5afbbc12e9c04
1,100
PASSED
#include<bits/stdc++.h> using namespace std; #define NN 101010 int a[NN], ans[NN]; int main() { int n; scanf("%d", &n); for(int i=1; i<=n; i++) { scanf("%d", a+i); } int mx=0; for(int i=n; i>=1; i--) { if(mx<a[i]) ans[i]=0; else ans[i]=mx+1-a[i]; if(a[i]>mx) mx=a[i]; } for(int i=1; i<=n; i++) { pr...
C++
e544ed0904e2def0c1b2d91f94acbc56
2ed00b732b9440beb325e740fa297d06
1,100
PASSED
#include <bits/stdc++.h> using namespace std; #define NN 110000 int a[NN], b[NN]; int main(){ #ifndef ONLINE_JUDGE freopen("test.in", "r", stdin); freopen("test.out", "w", stdout); #endif int n; scanf("%d", &n); for(int i = 0; i < n; i++) scanf("%d", &a[i]); a[n] = 0; for(int i = n - 1; i >= 0; i--) b[i] = max(b[...
C++
e544ed0904e2def0c1b2d91f94acbc56
848fc3887184275986e63a63f663378b
1,100
PASSED
#include <bits/stdc++.h> using namespace std; #define NN 110000 int a[NN], b[NN]; int main(){ #ifndef ONLINE_JUDGE freopen("test.in", "r", stdin); freopen("test.out", "w", stdout); #endif int n; scanf("%d", &n); for(int i = 0; i < n; i++) scanf("%d", &a[i]); a[n] = 0; for(int i = n - 1; i >= 0; i--) b[i] = max(b[...
C++
e544ed0904e2def0c1b2d91f94acbc56
dc2f8221e61bfea79166869af44522fd
1,100
PASSED
//package round647; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.InputMismatchException; import java.util.Random; public class B { InputStream is; PrintWriter out; String INPUT = ""; void solve()...
Java
ff4fce15470e5dbd1153bd23b26896f1
a7d7e0175741f784bf75577ec90af753
1,900
PASSED
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.util.Arrays; import java.io.BufferedWriter; import java.util.InputMismatchException; import java.io.IOException; import java.util.HashSet; import java.io.Writer; impo...
Java
ff4fce15470e5dbd1153bd23b26896f1
5c5dfe06a416b035d5e72dde00585140
1,900
PASSED
import java.io.IOException; import java.io.InputStream; import java.util.*; public class TestClass { static final class InputReader { private final InputStream stream; private final byte[] buf = new byte[1024]; private int curChar; private int numChars; public InputReader...
Java
ff4fce15470e5dbd1153bd23b26896f1
8dc2d7b391df9d4ea4b803ed7d20f533
1,900
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll INF = 1e6+100; const ll mod = ll(1e9)+7; ll fexp (ll a, int e) { ll ret = 1LL; while (e>0) { if (e%2==1) ret = ret * a % mod; a = a*a % mod; e/=2; } return ret; } int main () { int t; scanf ("%d", &t); for (int test = 0; test ...
C++
ff4fce15470e5dbd1153bd23b26896f1
a81bba5412f09aa418bd9962fe84df02
1,900
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long LL; #define maxn 1000101 #define Mod 1000000007 typedef pair<int,int> PII; typedef map<int,int> MII; typedef vector<int> VI; typedef vector<LL> VL; typedef vector<vector<int>> VII; #define For(i,a,b) for(int i = a; i < b; ++i) #define Rep(i,b,a) for(int i...
C++
ff4fce15470e5dbd1153bd23b26896f1
faafa73e96410126fca7e7325d56cb3e
1,900
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long LL; #define maxn 1000101 #define Mod 1000000007 typedef pair<int,int> PII; typedef map<int,int> MII; typedef vector<int> VI; typedef vector<LL> VL; typedef vector<vector<int>> VII; #define For(i,a,b) for(int i = a; i < b; ++i) #define Rep(i,b,a) for(int i...
C++
ff4fce15470e5dbd1153bd23b26896f1
421b1aa2f6cb6aa5c66cd1efe839e6dc
1,900
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long LL; #define maxn 1000101 #define Mod 1000000007 typedef pair<int,int> PII; typedef map<int,int> MII; typedef vector<int> VI; typedef vector<LL> VL; typedef vector<vector<int>> VII; #define For(i,a,b) for(int i = a; i < b; ++i) #define Rep(i,b,a) for(int i...
C++
ff4fce15470e5dbd1153bd23b26896f1
94d88d2a75dc4e975d8e6d3bc6bfba1b
1,900
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long LL; #define maxn 1000101 #define Mod 1000000007 typedef pair<int,int> PII; typedef map<int,int> MII; typedef vector<int> VI; typedef vector<LL> VL; typedef vector<vector<int>> VII; #define For(i,a,b) for(int i = a; i < b; ++i) #define Rep(i,b,a) for(int i...
C++
ff4fce15470e5dbd1153bd23b26896f1
38301e43065443f9f489cf5378f10f85
1,900
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long LL; #define maxn 1000101 #define Mod 1000000007 typedef pair<int,int> PII; typedef map<int,int> MII; typedef vector<int> VI; typedef vector<LL> VL; typedef vector<vector<int>> VII; #define For(i,a,b) for(int i = a; i < b; ++i) #define Rep(i,b,a) for(int i...
C++
ff4fce15470e5dbd1153bd23b26896f1
ef4ed38b9f2295393d248c8bc6abf2b5
1,900
PASSED
#include "bits/stdc++.h" #pragma GCC optimize "03" using namespace std; #define int long long int #define ld long double #define pi pair<int, int> #define pb push_back #define fi first #define se second #define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0) #ifndef LOCAL #define endl '\n' #endif const int...
C++
ff4fce15470e5dbd1153bd23b26896f1
fd7109ba011e72110f2c7355f33da334
1,900
PASSED
#include <bits/stdc++.h> using namespace std; const int INF = INT_MAX; int a[200001]; int main(){ #ifdef ONLINE_JUDGE // freopen("ancestor.in", "r", stdin); // freopen("ancestor.out", "w", stdout); #endif int n, s; cin >> n >> s; s--; for(int i = 0; i < n; ++i) { cin >> a[i]; ...
C++
3def8503f4e7841d33be5b4890065526
3e2887b648367cca440d0a882d099105
1,900
PASSED
#include <iostream> #include <algorithm> #include <vector> int main() { std::ios::sync_with_stdio(false); int n, s; std::cin >> n >> s; int count; std::vector <std::pair <int, int> > id(n + 1, {0, 0}); for (int i = 1; i <= n; ++i) { std::cin >> id[i].first; id[i].second = i; ...
C++
3def8503f4e7841d33be5b4890065526
27f1bfd285275dd24aea1410b8d04993
1,900
PASSED
#include<bits/stdc++.h> #define ll long long #define pb push_back using namespace std; int n,s,ans,tec,r; int a[200001]; int kol[200001]; int main() { cin>>n>>s; for(int i=1;i<=n;++i) { cin>>a[i]; } if(a[s]!=0) { ans++; a[s]=0; } tec=1; for(int i=1;i<=n;++...
C++
3def8503f4e7841d33be5b4890065526
d2d50c1d133f476a89e8534bcf72cc28
1,900
PASSED
#include <stdio.h> #include <algorithm> using std::min; using std::max; const int MAX_N = 200000; int v[MAX_N]; int count[MAX_N]; int sumCount[MAX_N + 1]; int lipsa[MAX_N]; int main() { int n, s; scanf("%d%d", &n, &s); s--; for(int i = 0; i < n; i++) scanf("%d", &v[i]); for(int i = 0; i < n; i++) ...
C++
3def8503f4e7841d33be5b4890065526
adad3c596091c5000880824e749c2b17
1,900
PASSED
#include <bits/stdc++.h> using namespace std; const int INF = 2e9; const int N = 2e5 + 11; bool used[N]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, s, p_ans = 0; cin >> n >> s; s--; vector<int> cnt(n); vector<pair<int, int> > arr(n); for (int i = 0; i < n; ++i) { cin >> arr[i].f...
C++
3def8503f4e7841d33be5b4890065526
c170987d8fa5f3838be169c7e77df0b6
1,900
PASSED
#include <bits/stdc++.h> #define mp make_pair #define pb push_back #define F first #define S second #define all(x) x.begin(),x.end() #define MAXN 200005 typedef long long ll; using namespace std; int n,s; int niz[MAXN]; int kolko[MAXN]; int res=0,nule; int main(){ scanf("%d %d", &n, &s); for(int i=1;i<=n;i++...
C++
3def8503f4e7841d33be5b4890065526
c17240865a3a719a1a23df30e20fd041
1,900
PASSED
#include <bits/stdc++.h> #define mp make_pair #define pb push_back #define F first #define S second #define all(x) x.begin(),x.end() #define MAXN 200005 typedef long long ll; using namespace std; int n,s; int niz[MAXN]; int kolko[MAXN]; int res=0,nule; int main(){ scanf("%d %d", &n, &s); for(int i=1;i<=n;i++...
C++
3def8503f4e7841d33be5b4890065526
3958471dbcb3e9a6aa2a69917d6e9668
1,900
PASSED
#include <bits/stdc++.h> #define ld long double #define ll long long #define ull unsigned long long #define f first #define s second #define endl '\n' #define pii pair <ll, ll> #define ios ios_base::sync_with_stdio(0), cin.tie() #define pb push_back #define mp make_pair #define pi 3.14159265358979323846264 #define...
C++
3def8503f4e7841d33be5b4890065526
e949addbcf343d6bf1e8553cfcfa4018
1,900
PASSED