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;
int main(){
int n;cin>>n;
int it = n%2==0?n/2-1:n/2;
vector<int> num;
while(cin>>n){
num.push_back(n);
}
sort(num.begin(),num.end());
cout << num[it];
} | C++ | f93a8bd64a405233342f84542fce314d | 0967bf6de8ec56707c6627fa7ecd6351 | 800 | PASSED |
//****************************Bismillahir Rahmanir Rahim***************************//
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef p... | C++ | f93a8bd64a405233342f84542fce314d | ba10edd73db063bb82cbab3f5db584a4 | 800 | PASSED |
//****************************Bismillahir Rahmanir Rahim***************************//
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef p... | C++ | f93a8bd64a405233342f84542fce314d | d117fc21e3ccea8df023be7441689dd2 | 800 | PASSED |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
// Policy based data structure
typedef tree<int, null_type,
less_equal<int>, rb_tree_tag,
tree_order_statistics_node_update>
indexed_set;
#define ll long long int
#define pii pair<ll,ll>
#de... | C++ | 13ffa0ddaab8a41b952a3c2320bd0c02 | 7836d6038d412a5d732051ad08f694f9 | 1,600 | PASSED |
/*
ID: bradyawn
PROG: contest
LANG: C++11
*/
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <utility>
#include <algorithm>
#include <set>
#include <ctime>
#include <queue>
#include <stack>
#include <bitset>... | C++ | 13ffa0ddaab8a41b952a3c2320bd0c02 | fa79e185dfdbe7ef8e953e4716b86aa7 | 1,600 | PASSED |
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <queue>
#define ll long long
#define mod 1000000007
#define pii pair<int, int>
#define fr(n) for (int i = 0; i < n; i++)
#define fr1(n) for (int i = 1; i <= n; i++)
using namespace std;
int main() {
int n, a[1000... | C++ | 13ffa0ddaab8a41b952a3c2320bd0c02 | 6d5778f6666b47d78a22b0a8bb26de0f | 1,600 | PASSED |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define M 1000000007
#define inf 1e15
#define all(a) (a).begin(),(a).end()
int main()
{
boost
int t,k,i,j... | C++ | 13ffa0ddaab8a41b952a3c2320bd0c02 | 7ed43a1d20dcb9a5fb9d63eb38f460f1 | 1,600 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vb vector< bool >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#defi... | C++ | 13ffa0ddaab8a41b952a3c2320bd0c02 | 7445e0dab1b673ade3ffc5ba80f74cd3 | 1,600 | PASSED |
//keshavkr_1013
#include <bits/stdc++.h>
#include<random>
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define loop(i,a,b) for(ll i=a;i<=b;i++)
#define vi vector <... | C++ | 13ffa0ddaab8a41b952a3c2320bd0c02 | 0ea2078719cd5bb3ba19bfe39f479340 | 1,600 | PASSED |
#include<bits/stdc++.h>
#define inf 99999999
using namespace std;
int n;
int arr[100100];
int dp[100100];
int cal(int idx)
{
if(dp[idx]!=-1) return dp[idx];
if(idx==0) return 0;
int f1=inf;
int f2=inf;
int f3=inf;
int sum=0;
f1=20+cal(idx-1);
for(int i=idx-1;i>=1;i--)
{
su... | C++ | 13ffa0ddaab8a41b952a3c2320bd0c02 | b803126dbd6575b2bf0aaccb5f454149 | 1,600 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int const N = 1e5 + 5;
int n, t[N], f[N];
int main()
{
//freopen("task.inp","r",stdin);
scanf("%d", &n);
for(int i = 1; i <= n; ++i)
{
scanf("%d", &t[i]);
}
f[1] = 20;
printf("%d\n", f[1]);
for(int i = 2; i <= n; ++i)
{
... | C++ | 13ffa0ddaab8a41b952a3c2320bd0c02 | 999751fa806331702b25882803440e19 | 1,600 | PASSED |
//Hi
#include <cstdio>
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
#define MAX 100001
int n;
int times[MAX];
int bests[MAX];
int main()
{
ios::sync_with_stdio(false);
//freopen... | C++ | 13ffa0ddaab8a41b952a3c2320bd0c02 | 6ec842499c3275f4fcdc384b106d433c | 1,600 | PASSED |
/*
PROG: cf756b
LANG: C++
*/
#include <cstdlib>
#include <csignal>
#include <csetjmp>
#include <cstdarg>
#include <typeinfo>
#include <bitset>
#include <functional>
#include <utility>
#include <ctime>
#include <cstddef>
#include <new>
#include <memory>
#include <climits>
#include <cfloat>
#include <limits>
#include <e... | C++ | 13ffa0ddaab8a41b952a3c2320bd0c02 | e6ab0294db81e67e69c7d9acb9a3edee | 1,600 | PASSED |
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<set>
#include<stack>
using namespace std;
const int N = 100000+10;
struct node{
int v,id;
node(){}
node(int v,int id):v(v),id(id){}
};
vector<node> G[N];
int pre[N], low[N], ... | C++ | be83ef61283f104dcb00612ae11f2e93 | 702dc9e65611e89bf3d610d4593de800 | 2,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define MAXN 100005
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define COST F.F
#define ID F.S
#define SOURCE S.F
#define DEST S.S
typedef pair<int, int> ii;
typedef pair<ii, ii> iiii;
vector<iiii> E;
vector<vector<ii> > G(MAXN);... | C++ | be83ef61283f104dcb00612ae11f2e93 | 0d4678f94049c78ca545e48bcadd8e9f | 2,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define MAXN 1000005
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define COST F.F
#define ID F.S
#define SOURCE S.F
#define DEST S.S
typedef pair<int, int> ii;
typedef pair<ii, ii> iiii;
vector<iiii> E;
vector<vector<ii> > G(MAXN)... | C++ | be83ef61283f104dcb00612ae11f2e93 | 87e7f7ee79095bb1065509599175bae8 | 2,300 | PASSED |
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
const int N=2e5+1e3+7;
int cnt,totw,cnte,cntt,size[N],st[N],ed[N],top[N],fa[N],Fa[N],fae[N],son[N],ans[N],w[N],rev[N],head[N],dep[N];
struct Edge{
int fr,to,w,id;
}e[N*2+1];
struct node{
int ne,to,w,id;
}edg[N*2+1];
vo... | C++ | be83ef61283f104dcb00612ae11f2e93 | 6f567d86f1afe025c5095be8f17aa1c8 | 2,300 | PASSED |
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
const int N=2e5+1e3+7;
int cnt,totw,cnte,cntt,size[N],st[N],ed[N],top[N],fa[N],Fa[N],fae[N],son[N],ans[N],w[N],rev[N],head[N],dep[N];
struct Edge{
int fr,to,w,id;
}e[N*2+1];
struct node{
int ne,to,w,id;
}edg[N*2+1];
vo... | C++ | be83ef61283f104dcb00612ae11f2e93 | 0f1ae215e9fb4e9dc64371c35bbe77a3 | 2,300 | PASSED |
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
const int N=2e5+1e3+7;
int cnt,totw,cnte,cntt,size[N],st[N],ed[N],top[N],fa[N],Fa[N],fae[N],son[N],ans[N],w[N],rev[N],head[N],dep[N];
struct Edge{
int fr,to,w,id;
}e[N*2+1];
struct node{
int ne,to,w,id;
}edg[N*2+1];
vo... | C++ | be83ef61283f104dcb00612ae11f2e93 | 2ba9cb7fce79b4d857191c73a3b8096d | 2,300 | PASSED |
#include<cstdio>
#include<cstring>
#include<queue>
#include<algorithm>
#include<map>
#include<utility>
#include<assert.h>
using namespace std;
const int NV=300005;
const int LNV=11;//log2 of NV
const int NE=300005;
const int NQ=1000005;
const int intmax=0x7fffffff;
int ty[NE],go[NE];
struct Edge
{
int ne,y,v;
};
st... | C++ | be83ef61283f104dcb00612ae11f2e93 | 848c691cca7e91b2c72a5e30f3bbaac0 | 2,300 | PASSED |
#include<cstdio>
#include<cstring>
#include<queue>
#include<algorithm>
#include<map>
#include<utility>
#include<assert.h>
using namespace std;
const int NV=300005;
const int LNV=11;//log2 of NV
const int NE=300005;
const int NQ=1000005;
const int intmax=0x7fffffff;
int ty[NE],go[NE];
struct Edge
{
int ne,y,v;
};
st... | C++ | be83ef61283f104dcb00612ae11f2e93 | 747eda513ac269c446a96789719617cf | 2,300 | PASSED |
//By Lin
#include<cstdio>
#include<cstring>
#include<algorithm>
#define maxn 100005
using namespace std;
int n , m, p[maxn], cnt,num[maxn],belong[maxn][2],mm,temp;
bool mark[maxn];
struct Edge{
int to , w , id,size,root;
Edge *next;
}*mat[2][maxn] , edges[maxn*2];
struct Line{
int x , y , w, mark;
int num,id;
... | C++ | be83ef61283f104dcb00612ae11f2e93 | 0e7d4ef2eb82ba90ed50f49ffec6b4bc | 2,300 | PASSED |
// in the name of God
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define F first
#define S second
#define pb push_back
#define mp make_pair
const int MAX_N = 1000 * 100 + 10;
vector <pair <int, int> > v[MAX_N], edge2;
int parent[MAX_N], dist[MAX_N], cutedge[MAX_N], low[MAX_N];
p... | C++ | be83ef61283f104dcb00612ae11f2e93 | 01006675af0c572039c8faa346cd83c9 | 2,300 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin>>n;
int num[n];
for(int i=0;i<n;i++){
cin>>num[i];
}
sort(num,num+n);
int small=num[0];
for(int i=0;i<n;i++){
if(num[i]!=small){
cout<<num[i];
return 0;
}
}
cout<<"NO";
return 0;
} | C++ | 930be5ec102fbe062062aa23eac75187 | 650192171e250a9a1d02edc4dd7a53db | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int a[n+1],i;
for (i=1;i<=n;i++)
{
cin>>a[i];
}
sort(a+1,a+n+1);
for(i=1;i<=n;i++)
{
if(a[i]>a[1])
{
cout<<a[i];
return 0;
}
}
cout<<"NO";
return 0;
} | C++ | 930be5ec102fbe062062aa23eac75187 | 46168706701132e88d45682d9fd44b50 | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int s[305],kk=0;
int main(){
int k;
cin>>k;
for(int i=1;i<=k;i++)
scanf("%d",&s[i]);
sort(s+1,s+k+1);
for(int i=1;i<=k;i++){
if(s[i]!=s[i-1])kk++;
if(kk==2)cout<<s[i],exit(0);
}
cout<<"NO";
} | C++ | 930be5ec102fbe062062aa23eac75187 | 33bb2d22d95d757cf7ed865d708c6f18 | 800 | PASSED |
#include<algorithm>
#include<iostream>
using namespace std;
int main()
{
int n;
cin>>n;
int a[200];
for(int i=1;i<=n;i++)
cin>>a[i];
sort(a+1,a+1+n);
for(int i=2;i<=n;i++)
{
if(a[i] != a[i-1])
{
cout<<a[i];
return 0;
}
}
cout<<"NO";
return 0;
} | C++ | 930be5ec102fbe062062aa23eac75187 | f2e88a56c3202c0da72ecd1f65c48a79 | 800 | PASSED |
#include <bits/stdc++.h>
using namespace std;
int n,x;
set<int> s;
int main ()
{
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>x;
s.insert(x);
}
s.erase(s.begin());
if(s.empty())
cout<<"NO";
else
cout<<*s.begin()<<endl;
return 0;
} | C++ | 930be5ec102fbe062062aa23eac75187 | 41aaf4849e03702fad1745bab066ad82 | 800 | PASSED |
#include<bits/stdc++.h>
using namespace std;
int a[101];
int b[101];
int main()
{
int n,x,ans[2]={-200,-200},j=0;
cin>>n;
for(int i=1;i<=n;i++)
{
cin>>x;
if(x>=0) a[x]=1;
else b[-x]=1;
}
for(int i=100;i>=1;i--)
{
if(b[i]==1)
{
ans[j]=-i;
j++;
}
if(j==2) break;
}
for(int i=0;i<=100;i++)
{
... | C++ | 930be5ec102fbe062062aa23eac75187 | 4cde77666e891f28172be779b221d639 | 800 | PASSED |
#include<cstdio>
#include<string.h>
#include<algorithm>
using namespace std;
int main(){
int a[1001],n,s=0;
scanf("%d",&n);
for(int i=1;i<=n;i++)
scanf("%d",&a[i]);
sort(a+1,a+1+n);
for(int i=1;i<=n;i++){
if(a[i]==a[i+1])
a[i]=0;
}
for(int i=1;i<=n;i++){
if(a[i]!=... | C++ | 930be5ec102fbe062062aa23eac75187 | 483db46c337c09e7785257f9429b306c | 800 | PASSED |
#include<cstdio>
#include<algorithm>
using namespace std;
int f[1000];
int k;
int main()
{
scanf("%d",&k);
for(int i=1;i<=k;i++){
scanf("%d",&f[i]);
}
sort(f+1,f+1+k);
int x=1;
while(f[x]==f[x+1]) x++;
if(x+1<=k) printf("%d",f[x+1]);
else printf("NO");
return 0;
} | C++ | 930be5ec102fbe062062aa23eac75187 | 598765e70dcdd79a473a23bf608ee302 | 800 | PASSED |
/*(^-^)*/
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<cmath>
#include<ctime>
#include<cstdio>
#include<vector>
#include<cctype>
#include<string>
#include<iomanip>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
#define ll long long
ll n,a[105];
i... | C++ | 930be5ec102fbe062062aa23eac75187 | b03a41fd0e2a320c8721c61e9904b37c | 800 | PASSED |
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<stdio.h>
using namespace std;
int n,s[11111];
bool cmp(int cl,int cr)
{return cl>cr;
}
int main()
{
scanf("%d",&n);
for(int i=1;i<=n;i++) scanf("%d",&s[i]);
sort(s+1,s+1+n,cmp);
for(... | C++ | 930be5ec102fbe062062aa23eac75187 | e61564c0dab080774d4b3c787e336f17 | 800 | PASSED |
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <set>
struct str{
int x0;
int y0;
int start;
int type;
int index;
};
bool cmp(str a, str b)
{
if(a.x0==b.x0)
{
return a.start<b.start;
}
return a.x0<b.x0;
}
std::vector<str> V;
std::set< std::pair<int,int> > S[5];
int check[200010];
int main... | C++ | 3ea1f3b2634fe32e8e0f7ee33033591a | c7eb570577e59c4f0b2dad2b3c00a1bc | 2,600 | PASSED |
#include <bits/stdc++.h>
#define debug(x) cout << #x << " = " << x << endl
#define REP(i,n) for(Long i = 0; i < (Long)n; i++)
#define pb push_back
using namespace std;
typedef long long Long;
const Long MX = 4e5 + 1;
Long combine(Long x , Long y) {
return max(x , y);
}
struct SegmentTree{
Long t[2 * MX];
Long laz... | C++ | 3ea1f3b2634fe32e8e0f7ee33033591a | de3140f20adf56319be7af28e16051ec | 2,600 | PASSED |
#include <bits/stdc++.h>
#define debug(x) cout << #x << " = " << x << endl
#define REP(i,n) for(Long i = 0; i < (Long)n; i++)
#define pb push_back
using namespace std;
typedef long long Long;
const Long MX = 4e5 + 1;
Long combine(Long x , Long y) {
return max(x , y);
}
struct SegmentTree{
Long t[2 * MX];
Long laz... | C++ | 3ea1f3b2634fe32e8e0f7ee33033591a | cee4d91d9d1f0555343319c0eb71cab7 | 2,600 | PASSED |
#include <bits/stdc++.h>
#define endl '\n'
#define LL long long
#define LD long double
#define pb push_back
#define sz(a) (int)a.size()
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define debug(x) cerr << #x << " is " << x << endl;
using namespace std;
int const MAXN = 2e6 + 9;
int l[MAXN], r[M... | C++ | 3ea1f3b2634fe32e8e0f7ee33033591a | f4fbfeec2acd4ff32cba5ee563f0da5c | 2,600 | PASSED |
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e6+5;
vector<pair<int,pair<int,int>>> v1;
set<pair<int,int>> s1[4];
int l[MAXN];
int r[MAXN];
int col[MAXN];
int main() {
int n;
cin>>n;
for(int i=1;i<=n;i++){
cin>>l[i]>>r[i]>>col[i];
col[... | C++ | 3ea1f3b2634fe32e8e0f7ee33033591a | c75b614662b4a84906fb535bbcf4b424 | 2,600 | PASSED |
///****In the name of ALLAH, most Gracious, most Compassionate****//
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
#define ALL(a) a.begin(), a.end()
#define FastIO... | C++ | 3ea1f3b2634fe32e8e0f7ee33033591a | fd34ef08f5b9033b4614fcda432101cc | 2,600 | 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 <climits>
#inclu... | C++ | 3ea1f3b2634fe32e8e0f7ee33033591a | c6a79235f3a5c6c9ddb945d73672d538 | 2,600 | PASSED |
/*
author : pshishod2645
Created at : 07:34:07 PM, 31 July 2020
*/
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
typedef long long ll;
//#define int long long
#define cerr cout
#define sz(a) (int)((a).size())
#define all(x) (x).begin(), (x).end()
string to_string(string s) { retur... | C++ | 3ea1f3b2634fe32e8e0f7ee33033591a | ea1bacdd03ce302b379fc9355185a120 | 2,600 | PASSED |
/*
author : pshishod2645
Created at : 07:34:07 PM, 31 July 2020
*/
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
typedef long long ll;
//#define int long long
#define cerr cout
#define sz(a) (int)((a).size())
#define all(x) (x).begin(), (x).end()
string to_string(string s) { retur... | C++ | 3ea1f3b2634fe32e8e0f7ee33033591a | 258679a461ef87a0fa57a23b2d55ff76 | 2,600 | PASSED |
// Problem: CF1389F Bicolored Segments
// Contest: Luogu
// URL: https://www.luogu.com.cn/problem/CF1389F
// Memory Limit: 250 MB
// Time Limit: 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
//#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
//#pragma GCC target("sse,ss... | C++ | 3ea1f3b2634fe32e8e0f7ee33033591a | 169d698e20650e3eca52c4307bd15bbf | 2,600 | PASSED |
#include <bits/stdc++.h>
using namespace std;
long long mini(long long a, long long b){
if( a < b ) return b;
else return a;
}
int main() {
long long T;
cin >> T;
long long n=0, s=0, t=0;
long long i = 1;
while(i <= T){
cin >> n >> s >> t;
cout << mini(n-s, n-t) + 1 << endl;
i++;
}
return 0;
}
| C++ | fb0a4c8f737c36596c2d8c1ae0d1e34e | 1311373b4c422e571a1a9664e2f2ddb7 | 900 | PASSED |
#include<bits/stdc++.h>
#include<queue>
#include<map>
#include<set>
#include<iostream>
typedef long long int ll;
#define ios ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
int main() {
ios;
ll p;
cin>>p;
while(p--)
{
ll n,s,t;
cin>>n>>s>>t;
... | C++ | fb0a4c8f737c36596c2d8c1ae0d1e34e | 9b04812022958327275974f197eafac1 | 900 | PASSED |
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
int h;
ll n,s,t;
cin>>h;
for(int i=0;i<h;i++){
cin>>n>>s>>t;
if(s>=n&&t>=n)cout<<1<<endl;
//else if((s<n&&t>=n)||(t<n&&s>=n))cout<<min(s,t)+1<<endl;
else {
int x=n-min(s,t)+1;
cout<<x<<e... | C++ | fb0a4c8f737c36596c2d8c1ae0d1e34e | 5b494a3a2baf00f0a29141db483e5f34 | 900 | PASSED |
/*
⠀⠀⠀⢀⣠⣤⣶⣶⣶⣶⣶⣦⣄⡀⠀⠀⠀⠀
⠀⠀⠀⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡀⠀⠀⠀⠀⠀
⠀⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡀⠀⠀⠀⠀
⠀⣾⣿⣿⣿⣿⣿⣿⡿⠿⠟⠛⠹⣿⣿⣿⡿⣿⣻⣿⡇⠀⠀⠀⠀
⠀⠘⠿⡛⡿⠋⠁⠀⠀⠀⠀⠀⢀⣻⡿⣿⡿⢿⣿⣿⣷⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢿⠿⡿⡑⠟⣿⢟⢋⠀⠀⠀⠀
⠀⠀⠀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⢹⣁⣇⠆⠀⠀⠀⠀⠀
⠀⠀⠀⢢⣄⣀⡠⠀⣤⣤⡤⣶⡤⠂⠀⠀⢻⣿⠉⢖⠄⠀⠀⠀⠀
⠀⠀⠀⠀⠺⢿⡹⠂⠉⠉⠙⠃⠀⠀⠀⠀⢸⣿⣆⠃⠁⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠀⠀⠀⠀⢀⣿⣿⣧⣶⡇⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠂⡄⠀⢠⣄⣂⡀⡀⠀⠀⣿⣿⣿⣿⠿⣷⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢿⣿⠭... | C++ | fb0a4c8f737c36596c2d8c1ae0d1e34e | 2fd13286a8f3890137bd2e32e6d3c397 | 900 | PASSED |
# include <bits/stdc++.h>
using namespace std;
int main(void)
{
int n;
cin>>n;
while(n--)
{
long long a,b,c;
cin>>a>>b>>c;
if(b+c == a)
{
if(b==c)
cout<<b+1<<endl;
else if(b<c)
{
cout<<c+1<<endl;
}
else
{
cout<<b+1<<endl;
}
}
else
{
if(c==a && b==a)
cout<<1<<end... | C++ | fb0a4c8f737c36596c2d8c1ae0d1e34e | 8bb12a330d7a16837d1d456b0aed23de | 900 | PASSED |
# include <bits/stdc++.h>
using namespace std;
int main(void)
{
int n;
cin>>n;
while(n--)
{
long long a,b,c;
cin>>a>>b>>c;
if(b+c==a)
{
if(b == c)
cout<<b+1<<endl;
else if(b<c)
cout<<c+1<<endl;
else
cout<<b+1<<endl;
}
else
{
if(b==a && c==a)
cout<<1<<endl;
else if(b<=c)
... | C++ | fb0a4c8f737c36596c2d8c1ae0d1e34e | 462e99fc36599f647d7db196ba40397b | 900 | PASSED |
#include <bits/stdc++.h>
using namespace std;
long long a,b,c;
void solve(){
scanf("%lld%lld%lld",&a,&b,&c);
cout<<max(a-b,a-c)+1<<endl;
}
int main(){
int t;
scanf("%d",&t);
while(t--) solve();
}
| C++ | fb0a4c8f737c36596c2d8c1ae0d1e34e | 53793d6010131ecf416f794628a24dd6 | 900 | PASSED |
//JAKARIA NOMANN_NSTU
#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define GCD(a,b) __gcd(a,b)
#define vc vector<char>
#define vi vector<int>
#define si set<int>
#define sc set<char>
#define sti stack<int>
#... | C++ | fb0a4c8f737c36596c2d8c1ae0d1e34e | 0926aa984d80b8da8891d9c883abc2c6 | 900 | PASSED |
//JAKARIA NOMANN_NSTU
#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define GCD(a,b) __gcd(a,b)
#define vc vector<char>
#define vi vector<int>
#define si set<int>
#define sc set<char>
#define sti stack<int>
#... | C++ | fb0a4c8f737c36596c2d8c1ae0d1e34e | 60bba266c631b998414f77aa0eb99bd6 | 900 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);
#define pb push_back
#define f(i,a,b) for(int i=a;i<b;i++)
#define fr(i,a,b) for(int i=a;i>=b;i--)
//typedef long long ll;
typedef long long ll;
#define vt vector
#define all(v) v.begin(),v.end()
typedef vt<long long> vi... | C++ | fb0a4c8f737c36596c2d8c1ae0d1e34e | 96cb2158cefa81d22c22f00f72eb0de4 | 900 | PASSED |
#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <math.h>
#include <time.h>
using namespace std;
#define ERROR {cout << -1 << endl; return 0;}
int minC = 2;
int maxC = 5;
struct book
{
int valu... | C++ | ff7bbfa19cbfcc63dbd7fa758d366187 | db09652da963b76d05f9e37414c24674 | 2,500 | PASSED |
#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <math.h>
#include <time.h>
using namespace std;
#define ERROR {cout << -1 << endl; return 0;}
int minC = 2;
int maxC = 5;
struct book
{
int valu... | C++ | ff7bbfa19cbfcc63dbd7fa758d366187 | 999149b1cc5e448ba6b2c2efe9fe6934 | 2,500 | PASSED |
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <m... | C++ | ff7bbfa19cbfcc63dbd7fa758d366187 | 1d2b42bfdfa8773f195b8a7eb5d5b0eb | 2,500 | PASSED |
// TwT514 {{{
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <cmath>
#include <bitset>
#include <queue>
#include <stack>
#include <functional>
#include <utility>
#define SZ(x) ((int)(x).size())
#define FOR(i,c) fo... | C++ | ff7bbfa19cbfcc63dbd7fa758d366187 | 8ff38ae7dab62c5ad843a72a5230ab75 | 2,500 | PASSED |
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstddef>
#include <complex>
#include <ctime>
#include <climits>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include ... | C++ | ff7bbfa19cbfcc63dbd7fa758d366187 | b7b4cbee3facb90205a58e985bf3dd98 | 2,500 | PASSED |
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstddef>
#include <complex>
#include <ctime>
#include <climits>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include ... | C++ | ff7bbfa19cbfcc63dbd7fa758d366187 | 1ea1f1706ee51d8513b955e0d068e042 | 2,500 | PASSED |
/*
* temp.cpp
*
* Created on: 2012-7-18
* Author: BSBandme
*/
//#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <iostream>
#include <fstream>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <cassert>
#include <list>
#in... | C++ | ff7bbfa19cbfcc63dbd7fa758d366187 | c6ff81e649f345d751ab9d63fbe37904 | 2,500 | PASSED |
#include<iostream>
#include<vector>
#include<cstring>
using namespace std;
int main() {
int n;
vector<int> p;
p.push_back(0);
cin >> n;
int a[n+1], status[6][n+1];
memset(status, 0, sizeof(int)*6*(n+1));
a[0] = 0;
for(int i = 0; i < n; i ++) {
cin >> a[i+1];
if(a[i+1]) p.push_back(i+1);
}
... | C++ | ff7bbfa19cbfcc63dbd7fa758d366187 | a914c3e4f464b3ecd8775d5b2393e5e8 | 2,500 | PASSED |
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#define maxn 200010
using namespace std;
bool ok[maxn][7];
int n,v[maxn],pre[maxn];
void read()
{
scanf("%d",&n);
for(int i=1;i<=n;++i)
scanf("%d",v+i);
}
void print(int n,int m)
{
if(n==1)
{
printf(... | C++ | ff7bbfa19cbfcc63dbd7fa758d366187 | dfda12fa5bb2f32135b325d324cb3e30 | 2,500 | PASSED |
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <utility>
using namespace std;
typedef pair<int,int> PII;
#define X first
#define Y second
#define FOR(I,L,R) for(int I=(L);I<(R);I++)
#define FORD(I,R,L) for(int I=(R)-1;I>=(L);I--)
const int MaxN = 200010;
int n,a[MaxN],res[MaxN],cnt[MaxN];
PII op... | C++ | ff7bbfa19cbfcc63dbd7fa758d366187 | f18002487443fdbe994c79f4b5b4680f | 2,500 | PASSED |
/*
╔═══╦═══╦═══╗
║╔═╗║╔══╩╗╔╗║
║║░║║╚══╗║║║║
║║░║║╔══╝║║║║
║╚═╝║╚══╦╝╚╝║
╚══╗╠═══╩═══╝
░░░╚╝░░░░░░░░
*/
#include <bits/stdc++.h>
#define ll long long
#define MOD 1000000007
#define MAX 1e9
#define MIN -1e9
#define PI acos(-1.0)
#define vi vector<int>
#define vii vector<v... | C++ | 3634a3367a1f05d1b3e8e4369e8427fb | 2fb9d83730b5901a19f0b6ac2771f625 | 1,600 | PASSED |
/*
╔═══╦═══╦═══╗
║╔═╗║╔══╩╗╔╗║
║║░║║╚══╗║║║║
║║░║║╔══╝║║║║
║╚═╝║╚══╦╝╚╝║
╚══╗╠═══╩═══╝
░░░╚╝░░░░░░░░
*/
#include <bits/stdc++.h>
#define ll long long
#define MOD 1000000007
#define MAX 1e9
#define MIN -1e9
#define PI acos(-1.0)
#define vi vector<int>
#define vii vector<v... | C++ | 3634a3367a1f05d1b3e8e4369e8427fb | fba8331d5436159266e8a2e98a93b826 | 1,600 | PASSED |
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define vi vector<int>
#define vli vector<long long int>
#define v(s) v.push_back(s)
#define mp make_pair
#define pb push_back
#define fs first
#define ins insert
#define sc second
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(N... | C++ | 3634a3367a1f05d1b3e8e4369e8427fb | 95be2a27d55f4dafbe339920c1932135 | 1,600 | PASSED |
#include <bits/stdc++.h>
using namespace std;
//____________________________________________________________________________________________________________________________________
#define PI 2*acos(0.0)
#define pf printf
#define sf scan
#define ff first
#define ss second
#define mp make_pair
#define pb push_b... | C++ | 3634a3367a1f05d1b3e8e4369e8427fb | 4b6482a91d3b6874d140b2ff5ae96e0e | 1,600 | PASSED |
#include <bits/stdc++.h>
using namespace std;
//____________________________________________________________________________________________________________________________________
#define PI 2*acos(0.0)
#define pf printf
#define sf scan
#define ff first
#define ss second
#define mp make_pair
#define pb push_bac... | C++ | 3634a3367a1f05d1b3e8e4369e8427fb | 425a54ce6b0414b5d61ad310d722284e | 1,600 | PASSED |
#include <bits/stdc++.h>
using namespace std;
//____________________________________________________________________________________________________________________________________
#define PI 2*acos(0.0)
#define pf printf
#define sf scan
#define ff first
#define ss second
#define mp make_pair
#define pb push_b... | C++ | 3634a3367a1f05d1b3e8e4369e8427fb | 8d933bf615c1c4cc7cbca7f975f260dd | 1,600 | PASSED |
/* Isn't passion overrated?*/
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ll long long
#define mod 1000000007
using namespace std;
ll gcd(ll a, ll b)
{
if (b == 0)
return a;
return gcd(b, a % b);
}
int main()
{
ios_base:: sync_with_stdio(false);
cin.tie(NULL); cout.ti... | C++ | 3634a3367a1f05d1b3e8e4369e8427fb | 8baad813909d36c71bd941408dc5949b | 1,600 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int mod = 1000000007;
int main()
{
int n;
cin>>n;
int i,k,a[n],num[1000],power[100],number,p;
ll ans=1;
set<int> s;
for(i=0;i<n;i++) cin>>a[i];
number=a[0];
for(i=2;i*i<=number;i++)
{ p=0;
while(num... | C++ | 3634a3367a1f05d1b3e8e4369e8427fb | 9374a9195e33f3f54c4778ded25b7c3a | 1,600 | PASSED |
#include<bits/stdc++.h>
#define int long long
int n,ans;
int a[1000000],g[1000000];
main(){
scanf("%lld",&n);
for(int i=1;i<=n;++i)scanf("%lld",&a[i]);
for(int i=n;i;--i)
g[i]=std::__gcd(a[i],g[i+1]);
for(int i=1;i<=n;++i){
a[i]=a[i]/std::__gcd(a[i],g[i+1])*g[i+1];
ans=std::__gcd(ans,a[i]);
}
printf... | C++ | 3634a3367a1f05d1b3e8e4369e8427fb | ec4764916852978cc3a3e92f9f6aeaf4 | 1,600 | PASSED |
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
int i,n; cin>>n; ll currans,arr[n],ans[n],gcd[n];
for(i=0;i<n;i++) cin>>arr[i];
gcd[n-1]=arr[n-1]; ans[n-1]=arr[n-1];
for(i=n-2;i>=0;i--)
{
gcd[i]=__gcd(gcd[i+1],arr[i]);
ans[i]=gcd[i+1]*arr[i]/gcd[i];... | C++ | 3634a3367a1f05d1b3e8e4369e8427fb | 36b56a692cfb2e12547a57b06c18eff9 | 1,600 | PASSED |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
using namespace std;
using namespace __gnu_pbds;
... | C++ | 4bee64265ade3c09002446264dcd26a6 | 46ffc84c63ea7a5fadf763807869f8ad | 2,000 | PASSED |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
using namespace std;
using namespace __gnu_pbds;
... | C++ | 4bee64265ade3c09002446264dcd26a6 | c012cf4393fc19acd628c84f5056b5a3 | 2,000 | PASSED |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
using namespace std;
using namespace __gnu_pbds;
... | C++ | 4bee64265ade3c09002446264dcd26a6 | 0328c73ea7c3d7de4942fe4aa40e1fea | 2,000 | PASSED |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
using namespace std;
using namespace __gnu_pbds;
... | C++ | 4bee64265ade3c09002446264dcd26a6 | c383f9eb3437546fb25b86201debffba | 2,000 | PASSED |
#ifndef CLion
//#pragma GCC optimize ("O3")
#endif
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#define F first
#define S second
#define pb push_back
#define ll long long
#define all(x) x.begin() , x.end()
#define mod(x,m) ((x%m + m)%m)
#define ... | C++ | 4bee64265ade3c09002446264dcd26a6 | 8405a7d5eb2763127587e10dd1f1ae77 | 2,000 | PASSED |
#ifndef CLion
//#pragma GCC optimize ("O3")
#endif
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#define F first
#define S second
#define pb push_back
#define ll long long
#define all(x) x.begin() , x.end()
#define mod(x,m) ((x%m + m)%m)
#define ... | C++ | 4bee64265ade3c09002446264dcd26a6 | 483fff1619054b225f02ec09f87f0253 | 2,000 | PASSED |
#ifndef CLion
//#pragma GCC optimize ("O3")
#endif
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#define F first
#define S second
#define pb push_back
#define ll long long
#define all(x) x.begin() , x.end()
#define mod(x,m) ((x%m + m)%m)
#define ... | C++ | 4bee64265ade3c09002446264dcd26a6 | e946bf234b7ffcd9f73e095d46742446 | 2,000 | PASSED |
#ifndef CLion
//#pragma GCC optimize ("O3")
#endif
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
#define F first
#define S second
#define pb push_back
#define ll long long
#define all(x) x.begin() , x.end()
#define mod(x,m) ((x%m + m)%m)
#define ... | C++ | 4bee64265ade3c09002446264dcd26a6 | 2f60ad67f87416ad55d21194eee09572 | 2,000 | PASSED |
#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pi pair<int,int>
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define ln(x) ((int)x.length())
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define endl ... | C++ | 4bee64265ade3c09002446264dcd26a6 | ea510c2cdfbd59f28451f52de1bbbd91 | 2,000 | PASSED |
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ff first
#define ss second
#define ll int
#define int long long
#define pb push_back
#define mp make_pair
#define pii ... | C++ | 4bee64265ade3c09002446264dcd26a6 | f0ab93965a12745a52b1844bc0714ede | 2,000 | PASSED |
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath> // pow(10, 3)
//#include <stdint.h>
#include <iomanip> // std::cout.precision(17);
#include <vector>
#include <algorithm> // vector.find
#include <unordered_map>
#include <map>
using std::cin;
using std::cout;
using st... | C++ | 2558db57229e55ffe0de0d8cf217035b | b2a9436af697fc51d088a889189a9deb | 1,700 | PASSED |
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
int main()
{
int n;
scanf("%d", &n);
int input[500100];
long long int sum = 0;
for(int i=0; i<n; i++)
{
scanf("%d", input + i);
sum += input[i];
}
if(sum % 3 != 0)
p... | C++ | 2558db57229e55ffe0de0d8cf217035b | fb3d5bb32ce942796aaacf087e3655b7 | 1,700 | PASSED |
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
int main()
{
int n;
scanf("%d", &n);
int input[500100];
long long int sum = 0;
for(int i=0; i<n; i++)
{
scanf("%d", input + i);
sum += input[i];
}
if(sum % 3 != 0)
p... | C++ | 2558db57229e55ffe0de0d8cf217035b | 12de7635d74c56d752e072afbd978c87 | 1,700 | PASSED |
#include <iostream>
#include <fstream>
using namespace std;
ifstream in("poarta.in");
ofstream out("poarta.out");
long long n,v[500005],nr;
int main()
{
cin>>n;
for(int i=1;i<=n;++i)
cin>>v[i],v[i]+=v[i-1];
if(v[n]%3==0){
long long pre=0,sum=v[n]/3;
for(int i=1;i<=n;++i){
... | C++ | 2558db57229e55ffe0de0d8cf217035b | 750b689516fd116a2aa62c4346e16413 | 1,700 | PASSED |
#include <iostream>
//#include <fstream>
using namespace std;
//ifstream in("poarta.in");
//ofstream out("poarta.out");
long long n,v[500005],nr;
int main()
{
cin>>n;
cin>>v[0];
for(int i=1;i<n;++i)
cin>>v[i],v[i]+=v[i-1];
if(v[n-1]%3==0){
long long pre=0,sum=v[n-1]/3;
for(int i=... | C++ | 2558db57229e55ffe0de0d8cf217035b | 4710b5bb26182eca4d58c777b1cc7704 | 1,700 | PASSED |
#include<stdio.h>
#include<string.h>
typedef long long ll;
const int MAXN=500005;
int a[MAXN];
ll b[MAXN];
int main() {
int n;
while(~scanf("%d",&n)) {
for(int i=0;i<n;i++) {
scanf("%d",&a[i]);
b[i]=a[i];
}
for(int i=1;i<n;i++) {
b[i]+=b[i-1];
}
if(b[n-1]%3) {
printf("0\n");
continue;
}
l... | C++ | 2558db57229e55ffe0de0d8cf217035b | 316df60b129320721aaf8a9458a9a98e | 1,700 | PASSED |
#include <bits/stdc++.h>
using namespace std;
/* * * * * * * * * * */
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
#define ms(a,v) memset(a,v,sizeof a)
/* * * * * * * * * * */
/* *
*
* Author: OakenSh1eld
*
* */
int main(){
ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(... | C++ | 2558db57229e55ffe0de0d8cf217035b | 22c3ed5f3614b1ff42a123322b133b4e | 1,700 | PASSED |
#include <bits/stdc++.h>
using namespace std;
#define spc " "
#define oi "oi\n"
#define ll long long
#define pi pair<int,int>
#define vi vector<int>
#define pl pair<ll,ll>
#define vl vector<ll>
#define vii vector<pi>
#define vll vector<pl>
#define ft first
#define sd second
#define ll long long
const int N=1000010;
... | C++ | 2558db57229e55ffe0de0d8cf217035b | 0a78d3a3154216baebe4f6e96ec5462b | 1,700 | PASSED |
#include<bits/stdc++.h>
using namespace std;
const int nmax=5*1e5+9;
long long psum[nmax];
int a;
int n;
vector<int> idx;
vector<int> idx2;
int main(){
ios_base::sync_with_stdio(false);
cin>>n;
for(int i=1... | C++ | 2558db57229e55ffe0de0d8cf217035b | eb04dc18ecec8d62cfd90cbc68796d79 | 1,700 | PASSED |
// #include <iostream>
// #include <cstring>
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < b; i++)
#define repe(i, a, b) for (int i = a; i <= b; i++)
using namespace std;
typedef long long ull;
// typedef long long ll;
const int maxn = int(5e5 + 1);
ull solve(int *a, int n)
{
ull sum = 0;... | C++ | 2558db57229e55ffe0de0d8cf217035b | dbdc385d6258e5fc62bf4e03fa6a8639 | 1,700 | PASSED |
//Sloved by Kuantayev Chingis
#include<cmath>
#include<algorithm>
#include<iostream>
#include<string.h>
#include<string>
#include<stdio.h>
#include<math.h>
#define fi(i,n) for(i=1;i<=n;i++)
#define fj(j,n) for(j=1;j<=n;j++)
using namespace std;
int main ()
{
freopen ("input.txt","r",stdin);
freopen ("output.txt","w",... | C++ | 1378b4c9ba8029d310f07a1027a8c7a6 | 673f39ebe2dcf1bfcf30062621f14b8a | 1,100 | PASSED |
#include <fstream>
using namespace std;
fstream cin("input.txt");
ofstream cout("output.txt");
int main()
{
int n,k,a[1000];
cin>>n>>k;
for(int i=0;i<n;++i)
cin>>a[i];
for(;!a[(k-1)%n];++k);
cout<<(k-1)%n+1<<"\n";
}
| C++ | 1378b4c9ba8029d310f07a1027a8c7a6 | de3e9ee28f81c834120895d260c89d25 | 1,100 | PASSED |
//B.cpp
//SmartCoder
#include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <cstdio>
#include <bitset>
#include <cmath>
#include <ctime>
#include <queue>
#include <deque>
... | C++ | 1378b4c9ba8029d310f07a1027a8c7a6 | 00a06a2057dce4d219125e096da7be9a | 1,100 | PASSED |
#include<iostream>
#include<fstream>
#include<cstdio>
using namespace std;
int main()
{
int n;
int k,i;
ifstream infile;
ofstream myfile;
myfile.open("output.txt");
infile.open("input.txt");
while(infile>>n && infile>>k){
int a[n];
for(i=0;i<n;i++){
infile >> a[... | C++ | 1378b4c9ba8029d310f07a1027a8c7a6 | dd275577c6396e6d8d749aadd167216e | 1,100 | PASSED |
#include <cstdio>
#include <iostream>
using namespace std;
int N, K;
int s[1000];
int main()
{
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
cin >> N >> K;
for (int i = 0; i < N; ++i) cin >> s[i];
for (--K; !s[K]; K = (K + 1) % N);
cout << K+1 << endl;
retur... | C++ | 1378b4c9ba8029d310f07a1027a8c7a6 | ff3183c291cd483282c8666cde95f7ae | 1,100 | PASSED |
#include<iostream>
#include <fstream>
using namespace std;
int a[2005],i,n,k;
main(){
freopen("input.txt","rt",stdin);
freopen("output.txt","wt",stdout);
cin>>n>>k;
for(i=0;i<n;i++){cin>>a[i];a[i+n]=a[i];}
for(i=k-1;i<2*n;i++)
if(a[i]==1){cout<<i%n+1<<endl;break;}
... | C++ | 1378b4c9ba8029d310f07a1027a8c7a6 | a403d2a1a8828b2899261ff6ea0b19ca | 1,100 | PASSED |
#include <fstream>
using namespace std;
fstream cin("input.txt");
ofstream cout("output.txt");
int main() {
int n,k;
cin>>n>>k;
int a[n],i;
for(i=0;i<n;i++) {
cin>>a[i];
}
for(i=k-1;;i++) {
if(i==n) i=0;
if(a[i]==1) {
cout<<i+1<<endl;
break;
}
}
return 0;
} | C++ | 1378b4c9ba8029d310f07a1027a8c7a6 | 5a90268c52caa79cfbe6ebea22c26431 | 1,100 | PASSED |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.