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() { std::ios::sync_with_stdio(false); int t; cin>>t; while(t--) { int n; int a[100]; memset(a,0,sizeof(a)); cin>>n; for(int i=0;i<n;i++) { a[i]=i+1; } if(n%2==0) ...
C++
f4779e16e0857e6507fdde55e6d4f982
0e6bc45dc41fe359d3cee8e62b9fd786
null
PASSED
#include <bits/stdc++.h> #define ll long long #define pb push_back using namespace std ; int t; #define dd 1 void sol() { vector<int> myvector; int n; cin >>n; for (int i=1; i<=n; ++i) myvector.push_back(i); rotate(myvector.begin(),myvector.begin()+1,myvector.end()); ...
C++
f4779e16e0857e6507fdde55e6d4f982
86aca27f790d8bc2efbef2e428f444cd
null
PASSED
# include<stdio.h> int a[200005]; int main() { int i,n,ans = 1,flag = 0; scanf("%d",&n); for( i = 0;i<n;++i) scanf("%d",&a[i]); int max = 0; for(i=0;i<n;++i) { if(a[i] == 1) flag = 1; } for(i = 0;i<n-1;++i) { if(a[i] == 1 && a[i+1] == 1) { ans++; flag =1; if(ans > max) max...
C
fcd88c7b64da4b839cda4273d928429d
25fa2efff54a9744b985f1cd96f5e6ef
900
PASSED
#include<stdio.h> int main() { int i,n,a[500000],len = 0,max = 0; scanf("%d",&n); for(i = 0; i < n; i++) { scanf("%d",&a[i]); } for(i = 0; i < 2*n; i++) { if(a[i%n] == 1) { len++; } if(a[i%n] == 0) { len = 0; } ...
C
fcd88c7b64da4b839cda4273d928429d
dc1ef1255daab7e112eb2dd45b9626c4
900
PASSED
#include<stdio.h> int main(){ int n,i,arr[200009]; while(scanf("%d",&n)!=EOF){ for(i=1;i<=n;i++){ scanf("%d",&arr[i]); } int a=0,max=0; for(i=1;i<=n;i++){ if(arr[i]==1){ a++; if(a>max){ max=a; ...
C
fcd88c7b64da4b839cda4273d928429d
37c4136f40d6ff3c3d157ff5a19d24c6
900
PASSED
#include<stdio.h> int main(){ long long n, arr[4000000], rest=0, x=0, i, j=0; scanf("%I64d", &n); for(i=0; i<n; i++) scanf("%I64d", &arr[i]); for(i=0; i<n; i++){ if(arr[i]==1) {arr[n+j]=1; j++;} else break; } n=n+j; for(i=0; i<n; ){ if(arr[i]==1) { x++; i++; } else { if(x>rest)r...
C
fcd88c7b64da4b839cda4273d928429d
39b88e5df43235ac162acd580ea7821c
900
PASSED
#include<stdio.h> int main() { int n,i,c,m=0,m1=0,m2=0; scanf("%d",&n); int arr[n]; for(i=0; i<n; i++) scanf("%d",&arr[i]); for(i=0; i<n; i++) { if(arr[i]== 1) { while(arr[i]!= 0 && i< n) { m++; i++; } ...
C
fcd88c7b64da4b839cda4273d928429d
cc1706c752225482926a029d62a80bff
900
PASSED
#include <stdio.h> int count_max, count_begin, count_end, count; int main() { int a[200001]; int n, i; scanf("%d", &n); a[n] = 0; for (i=0; i<n; i++) { scanf("%d", &a[i]); } for (i=0; i<=n; i++) { if (a[i]==1) { count++; ...
C
fcd88c7b64da4b839cda4273d928429d
07a316feebb4465cf9bf3835a1069dd0
900
PASSED
#include <stdio.h> int main(){ int n,st=0,end=0,max=0,f=1,prev_a; scanf("%i%i",&n,&prev_a); if(prev_a==1){ st++; end++; max = end; } else f=0; n--; while(n){ int a; scanf("%i",&a); if(a){ if(f){ st++; ...
C
fcd88c7b64da4b839cda4273d928429d
930896abfc50c6c1891ff79b7f087c6d
900
PASSED
#include<stdio.h> int main() { int n,i,c=1,j=0,m; scanf("%d",&n); int a[n]; int b[n]; for(i=0;i<n;i++) { scanf("%d",&a[i]); } for(i=0;i<n;i++) {if(a[i]==1 &&a[i+1]==1) { c++; } else{ c=1; } b[i]=c; } int p=0; for(i=0;i<n;i++) { if(a[i]=...
C
fcd88c7b64da4b839cda4273d928429d
706681445af593c9653a2ddb7f9ab1f9
900
PASSED
#include<stdio.h> int main() { int n,c=0,d=0,s,e=1,f=0,g=1; scanf("%d",&n); int a[n]; for(int i=0;i<n;++i) scanf("%d",&a[i]); for(int j=0;j<n;++j) { if(a[j]==1) ++c; else break; } for(int l=n-1;l>=0;--l) { if(a[l]==1) ++d; ...
C
fcd88c7b64da4b839cda4273d928429d
a529c498ee703fc26ba9a974dcb08f34
900
PASSED
#include <stdio.h> int main() { int i, len = 0, n, max = 0; scanf("%d", &n); int arr[n]; for(i = 0; i < n; i++) scanf("%d", &arr[i]); for(i = 0; i < 2 * n; i++) { if(arr[i % n]) { len++; if(len > max) max = len; } el...
C
fcd88c7b64da4b839cda4273d928429d
f9ed6e3e9b547d11e5112816204f4d99
900
PASSED
#include <bits/stdc++.h> #define LL long long #define pii pair<int,int> using namespace std; const int inf = 2147483647; const int mod = 998244353; const int N = 3001; int _max(int x, int y) {return x > y ? x : y;} int _min(int x, int y) {return x < y ? x : y;} inline int read() { int x = 0, f = 1; char ch = getc...
C++
95c277d67c04fc644989c3112c2b5ae7
d902897661a753c569f9ca541570bce4
3,500
PASSED
#include <bits/stdc++.h> using namespace std; #define F first #define S second #define ll long long #define ld long double #define PB push_back #define lc 2 * v #define rc 2 * v + 1 #define mid (s + e) / 2 #define pii pair <int, int> #define pll pair <long long , long long> #define FAST ios::sync_with_stdio(false);...
C++
95c277d67c04fc644989c3112c2b5ae7
ea90ac3eb8fdee9a0d8546ed309f492e
3,500
PASSED
#include <bits/stdc++.h> using namespace std; using ll=long long; //#define int ll #define rng(i,a,b) for(int i=int(a);i<int(b);i++) #define rep(i,b) rng(i,0,b) #define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--) #define per(i,b) gnr(i,0,b) #define pb push_back #define eb emplace_back #define a first #define b secon...
C++
95c277d67c04fc644989c3112c2b5ae7
529b94e6c9f03b032de394a75b4a9ef4
3,500
PASSED
#pragma optimize GCC ("-Ofast") #pragma optimize GCC ("-unroll-loops") #include <bits/stdc++.h> using namespace std; using ll=long long; //#define int ll #define rng(i,a,b) for(int i=int(a);i<int(b);i++) #define rep(i,b) rng(i,0,b) #define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--) #define per(i,b) gnr(i,0,b) #defi...
C++
95c277d67c04fc644989c3112c2b5ae7
dd8c5a7a084a4b4a38f446e5554c07f3
3,500
PASSED
#include <bits/stdc++.h> using namespace std; using ll=long long; //#define int ll #define rng(i,a,b) for(int i=int(a);i<int(b);i++) #define rep(i,b) rng(i,0,b) #define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--) #define per(i,b) gnr(i,0,b) #define pb push_back #define eb emplace_back #define a first #define b secon...
C++
95c277d67c04fc644989c3112c2b5ae7
def3a6166f4cbacf41b46e06fc9253d9
3,500
PASSED
#include <bits/stdc++.h> using namespace std; using ll=long long; //#define int ll #define rng(i,a,b) for(int i=int(a);i<int(b);i++) #define rep(i,b) rng(i,0,b) #define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--) #define per(i,b) gnr(i,0,b) #define pb push_back #define eb emplace_back #define a first #define b secon...
C++
95c277d67c04fc644989c3112c2b5ae7
5a3affc107ad5e041aa453e8accdae6a
3,500
PASSED
#include <bits/stdc++.h> using namespace std; using ll=long long; //#define int ll #define rng(i,a,b) for(int i=int(a);i<int(b);i++) #define rep(i,b) rng(i,0,b) #define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--) #define per(i,b) gnr(i,0,b) #define pb push_back #define eb emplace_back #define a first #define b secon...
C++
95c277d67c04fc644989c3112c2b5ae7
7cb3d0deb6de25b7f6aacc39aa76d64f
3,500
PASSED
/* be name khoda */ // #define long_enable #include <iostream> #include <algorithm> #include <cstring> #include <numeric> #include <vector> #include <fstream> #include <set> #include <map> using namespace std; #ifdef long_enable typedef long long int ll; #else typedef int ll; #endif typedef pair<ll, ll> pii; typedef...
C++
95c277d67c04fc644989c3112c2b5ae7
05cf1acaee772937e6a63fc0c1273730
3,500
PASSED
/* be name khoda */ // #define long_enable #include <iostream> #include <algorithm> #include <cstring> #include <numeric> #include <vector> #include <fstream> #include <set> #include <map> #pragma GCC optimize ("Ofast,unroll-loops") #pragma GCC optimize("no-stack-protector,fast-math") using namespace std; #ifdef long...
C++
95c277d67c04fc644989c3112c2b5ae7
75ae59edc7df098b5ad07ef5cef10c01
3,500
PASSED
#include<bits/stdc++.h> #define rep(i,a,b) for(int i=(a);i<=(b);i++) #define per(i,a,b) for(int i=(a);i>=(b);i--) #define REP(i,n) for(int i=(0);i<(n);i++) #define fi first #define se second #define pb push_back #define mp make_pair #define bits bitset<N> using namespace std; typedef pair<int,int> pii; typedef vector<i...
C++
95c277d67c04fc644989c3112c2b5ae7
5b9fb8331c2651d1452201e6204b364e
3,500
PASSED
#include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<algorithm> using namespace std; #define ll long long #define MAX 3030 inline int read() { int x=0;bool t=false;char ch=getchar(); while((ch<'0'||ch>'9')&&ch!='-')ch=getchar(); if(ch=='-')t=true,ch=getchar(); ...
C++
038c4b3fd1f87c2a741839e6da690a2e
94e3f338d6f6379c2d5277ca47c17b44
2,700
PASSED
using namespace std; #include<bitset> #include<deque> #include<stdint.h> #include<set> #include<stack> #include<cmath> #include<cstring> #include<cstdio> #include<cstdlib> #include<vector> #include<iomanip> #include<iostream> #include<cstdio> #include<algorithm> #include<queue> #include<cstring> #include<ctime> #includ...
C++
038c4b3fd1f87c2a741839e6da690a2e
9ca7d34cbf40be422eeafb6a5453d9f8
2,700
PASSED
using namespace std; #include<bitset> #include<deque> #include<stdint.h> #include<set> #include<stack> #include<cmath> #include<cstring> #include<cstdio> #include<cstdlib> #include<vector> #include<iomanip> #include<iostream> #include<cstdio> #include<algorithm> #include<queue> #include<cstring> #include<ctime> #includ...
C++
038c4b3fd1f87c2a741839e6da690a2e
37983e1cacf305cfce324603d97228c6
2,700
PASSED
using namespace std; #include<bitset> #include<deque> #include<stdint.h> #include<set> #include<stack> #include<cmath> #include<cstring> #include<cstdio> #include<cstdlib> #include<vector> #include<iomanip> #include<iostream> #include<cstdio> #include<algorithm> #include<queue> #include<cstring> #include<ctime> #includ...
C++
038c4b3fd1f87c2a741839e6da690a2e
bd96efe64602367f4ec8b8c04ce7bf62
2,700
PASSED
/************************************************************** Problem: ???? User: Big_Red_Dates Language: GNU_C++11 Result: Accepted Time:0 ms Memory:0 kb length:0 kb score: inf ****************************************************************/ //CLOCKS_PER_SEC using namespace std; #inc...
C++
038c4b3fd1f87c2a741839e6da690a2e
f71c3b58aff775cda327c4f29fe3e800
2,700
PASSED
#include<cstdio> #include<iostream> #include<algorithm> #include<cmath> #include<cstring> #include<string> #include<queue> #include<vector> #include<map> #include<set> #define INF 1<<29 #define LL long long #define ek()(putchar('\n')) #define sk()(putchar(' ')) #define WY()(putchar('Y'),putchar('e'),putchar('s'),ek()) ...
C++
038c4b3fd1f87c2a741839e6da690a2e
a1283d3274b7097ecdf7741defb843f1
2,700
PASSED
//Wrong Coding: //1-a[i][j] not a[i][j] #include<cstdio> using namespace std; const int N = 3000; const int M = 300; double f[M+3][N+3]; double d[N+3]; double tmp[N+3]; int num[N+3]; double a[N+3][M+3]; int n,m; int main() { scanf("%d%d",&n,&m); for(int i=1; i<=n; i++) { for(int j=1; j<=m; j++) { int x; sca...
C++
038c4b3fd1f87c2a741839e6da690a2e
a233fb40698e2899e2a6dbab20d960d5
2,700
PASSED
#include <queue> #include <vector> #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #define MP make_pair #define ll long long #define fi first #define se second using namespace std; template <typename T> void read(T &x) { x = 0; bool f = 0; char c = getchar(); for (;!isdigit(c)...
C++
038c4b3fd1f87c2a741839e6da690a2e
69fc64c9d84357c4e0830553427ca1f8
2,700
PASSED
#include<cstdio> #include<algorithm> using namespace std; int n,m; double ans,del[305],f[305][3005],p[3005][305]; int main() { scanf("%d%d",&n,&m); for(int i=1;i<=n;i++)for(int j=1,p1;j<=m;j++) scanf("%d",&p1),p[i][j]=p1/1000.0; for(int i=1;i<=m;i++) { f[i][0]=1.0; for(int j=1;j<=n;j++) f[i][j]=f[i][j-1]*(...
C++
038c4b3fd1f87c2a741839e6da690a2e
997581fd29a5ed0dffb90c5429743176
2,700
PASSED
#include <cstdio> #include <cstring> #define Int register int const int MAXN = 3000, MAXM = 300; int n, m; double p[MAXN + 5][MAXM + 5] = {}, f[MAXM + 5][MAXN + 5] = {}; double Diff[MAXM + 5] = {}; inline void Update ( const int k ) { double Lastf ( f[k][0] ); f[k][0] = 0; for ( Int i = 1; i <= n; ++ i ) { d...
C++
038c4b3fd1f87c2a741839e6da690a2e
4e6057fcfc788c2ab2533dd148721d59
2,700
PASSED
#pragma comment(linker, "/stack:336777216") #pragma GCC optimize("O3") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include<bits/stdc++.h> #define endl '\n' #define OUT using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using ui = unsigne...
C++
740a1ee41a5a4c55b505abb277c06b8a
1808b351871fc6bd9b6b86854055e879
1,700
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxe = 2e5+5; ll t0=1, n, k, s, t; vector<pair<ll, ll>> cars; ll gstations[maxe]; bool canbeat(ll f){ ll time = 0; for(int i = 1; i<=k+1; i++){ ll diff = gstations[i]; if(i!=1) diff = diff-gstations[i-1]; if(f<diff){ re...
C++
740a1ee41a5a4c55b505abb277c06b8a
54de26f92b27e7ae91494ea5d4af09a5
1,700
PASSED
#include <cstdio> #include <iostream> #include <string> #include <vector> #include <algorithm> #include <map> #include <set> #include <math.h> using namespace std; int main() { //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); ios_base::sync_with_stdio(false); int cars_cnt, fs_cnt, dis...
C++
740a1ee41a5a4c55b505abb277c06b8a
c80734d249f7a4094a0815910b54fff6
1,700
PASSED
#include <cstdio> #include <iostream> #include <string> #include <vector> #include <algorithm> #include <map> #include <set> #include <math.h> using namespace std; int main() { //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); ios_base::sync_with_stdio(false); int cars_cnt, fs_cnt, dis...
C++
740a1ee41a5a4c55b505abb277c06b8a
e8959ffab1535c8a13f1e93267524499
1,700
PASSED
#include <cstdio> #include <iostream> #include <string> #include <vector> #include <algorithm> #include <map> #include <set> #include <math.h> using namespace std; int main() { //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); ios_base::sync_with_stdio(false); int cars_cnt, fs_cnt, dis...
C++
740a1ee41a5a4c55b505abb277c06b8a
a702f5bf5f0fa7403a4c7e7c9da06d62
1,700
PASSED
#include <cstdio> #include <iostream> #include <string> #include <vector> #include <algorithm> #include <map> #include <set> #include <math.h> using namespace std; int main() { //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); ios_base::sync_with_stdio(false); int cars_cnt, fs_cnt, dis...
C++
740a1ee41a5a4c55b505abb277c06b8a
0da3b592cd396c2d8296d73da5ad9e68
1,700
PASSED
#include <cstdio> #include <iostream> #include <string> #include <vector> #include <algorithm> #include <map> #include <set> #include <math.h> using namespace std; int main() { //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); ios_base::sync_with_stdio(false); int cars_cnt, fs_cnt, dis...
C++
740a1ee41a5a4c55b505abb277c06b8a
23974e5e17b3319cfeccdef8f7ac0362
1,700
PASSED
#include <cstdio> #include <iostream> #include <string> #include <vector> #include <algorithm> #include <map> #include <set> #include <math.h> using namespace std; int main() { //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); ios_base::sync_with_stdio(false); int cars_cnt, fs_cnt, dis...
C++
740a1ee41a5a4c55b505abb277c06b8a
5bdde22acabe9ca83a6ee2cd3614c453
1,700
PASSED
#include <cstdio> #include <iostream> #include <string> #include <vector> #include <algorithm> #include <map> #include <set> #include <math.h> using namespace std; int main() { //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); ios_base::sync_with_stdio(false); int cars_cnt, fs_cnt, dis...
C++
740a1ee41a5a4c55b505abb277c06b8a
a01b32c441d98e5a0e776d25efe0b36a
1,700
PASSED
#include <cstdio> #include <iostream> #include <string> #include <vector> #include <algorithm> #include <map> #include <set> #include <math.h> using namespace std; int main() { //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); ios_base::sync_with_stdio(false); int cars_cnt, fs_cnt, dis...
C++
740a1ee41a5a4c55b505abb277c06b8a
c8602f20f2a547026be122be743acbf2
1,700
PASSED
#include <stdio.h> void merge(long long arr[], long long L, long long M, long long R) { long long Lsize = M - L + 1; long long Rsize = R - M; long long Larray[Lsize], Rarray[Rsize]; for (long long i = 0; i < Lsize; i++) { Larray[i] = arr[L + i]; } for (long long i = 0; i < Rsize; i++) { Rarra...
C++
a3a64c3c7e9349d6e663c2d8113d2676
12ec1e94dfb4a5b579510cea89e16499
1,200
PASSED
#include<bits/stdc++.h> using namespace std; long long ans,a[100005]; int main() { int t; scanf("%d",&t); while(t--){ int n; long long mx=-1e9; scanf("%d",&n); for(int i=1;i<=n;i++)scanf("%lld",&a[i]),mx=max(mx,a[i]); sort(a+1,a+n+1,[](long long x,long long y){return abs(x)>abs(y);}); if(mx<0){ cou...
C++
a3a64c3c7e9349d6e663c2d8113d2676
0db522358dd24827a6fd8c5fc568af73
1,200
PASSED
#include<bits/stdc++.h> using namespace std; long long ans,a[100005]; int main() { int t; scanf("%d",&t); while(t--){ int n; long long mx=-1e9; scanf("%d",&n); for(int i=1;i<=n;i++)scanf("%lld",&a[i]),mx=max(mx,a[i]); sort(a+1,a+n+1,[](long long x,long long y){return abs(x)>abs(y);}); if(mx<0){ cou...
C++
a3a64c3c7e9349d6e663c2d8113d2676
b3cabbb0668b362b57d3954a58f0a159
1,200
PASSED
#include<bits/stdc++.h> using namespace std; #define pi acos(-1.0) //cout << fixed << setprecision(8) << a << endl; #define Fast_Input ios_base :: sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL); #define pb push_back #define mem(a, b) memset(a, b, sizeof(a)) #include<ext/pb_ds/assoc_container.hpp> #include<ext/...
C++
a3a64c3c7e9349d6e663c2d8113d2676
33f789d2f78e904d27139eebc954d281
1,200
PASSED
#include <bits/stdc++.h> #define IO ios_base::sync_with_stdio(false); #define TT cin.tie(NULL); cout.tie(NULL); using namespace std; #include<cmath> #define ll long long #define f(a,c) for(a=0; a<c; a++) #define pi 3.1415926536 #define maxxo 1e9 #define pb push_back #define int long long main() { #ifndef ONLI...
C++
a3a64c3c7e9349d6e663c2d8113d2676
488eaedeb4eb81c3a238217084fdf34e
1,200
PASSED
#include <bits/stdc++.h> #define IO ios_base::sync_with_stdio(false); #define TT cin.tie(NULL); cout.tie(NULL); using namespace std; #include<cmath> #define ll long long #define f(a,c) for(a=0; a<c; a++) #define pi 3.1415926536 #define maxxo 1e9 #define pb push_back #define int long long main() { #ifndef ONLI...
C++
a3a64c3c7e9349d6e663c2d8113d2676
223f883d1384402d3dde18ce36dc33b2
1,200
PASSED
#include <bits/stdc++.h> #define IO ios_base::sync_with_stdio(false); #define TT cin.tie(NULL); cout.tie(NULL); using namespace std; #include<cmath> #define ll long long int #define f(a,c) for(a=0; a<c; a++) #define pi 3.1415926536 #define maxxo 1e9 #define pb push_...
C++
a3a64c3c7e9349d6e663c2d8113d2676
003563ad98ccc29f09291cf11721bd7f
1,200
PASSED
#include <bits/stdc++.h> #define IO ios_base::sync_with_stdio(false); #define TT cin.tie(NULL); cout.tie(NULL); using namespace std; #include<cmath> #define ll long long int #define f(a,c) for(a=0; a<c; a++) #define pi 3.1415926536 #define maxxo 1e9 #define pb push_...
C++
a3a64c3c7e9349d6e663c2d8113d2676
eb28fc76a7ed327b46bd9ae86e3379ab
1,200
PASSED
#include <bits/stdc++.h> #define ll long long #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #define PI 2 * acos(0) #define ones(n) __builtin_popcount(n) #define FAST ios::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define MAX 9000000 #define debug(x) cerr << #x << " = " << x << '\n'; #define LOOP pr...
C++
a3a64c3c7e9349d6e663c2d8113d2676
4560c588e66599e86e2aece3f4ad4682
1,200
PASSED
#include <bits/stdc++.h> #define ll long long #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #define PI 2 * acos(0) #define ones(n) __builtin_popcount(n) #define FAST ios::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define MAX 9000000 #define debug(x) cerr << #x << " = " << x << '\n'; #define LOOP pr...
C++
a3a64c3c7e9349d6e663c2d8113d2676
52165c49d2fd07659a7038407826fadc
1,200
PASSED
#include <bits/stdc++.h> using namespace std; #define MAXN 100000 #define MAXS 100 char flags[MAXN+10]; char a[MAXS+10], b[MAXS+10]; int faila[MAXS], failb[MAXS]; void kmpinit(char *s, int len, int *fail) { fail[0] = -1; for (int i=1, pos = -1; i<len; ++i) { while (pos != -1 && s[pos+1] != s[i]) { pos = fail[pos...
C++
c3244e952830643938d51ce14f043d7d
e46c261956efe88da8766f748e549651
1,200
PASSED
#include <bits/stdc++.h> using namespace std; static bool road_contains_color_sequences(string &road, string &a, string &b); int main() { string seq, s, t; getline(cin, seq); getline(cin, s); getline(cin, t); bool is_forward = road_contains_color_sequences(seq, s, t); reverse(seq.begin(), seq...
C++
c3244e952830643938d51ce14f043d7d
3553610467f96cf27b57aa87dcf86a07
1,200
PASSED
#include<bits/stdc++.h> using namespace std; string s,a,b; bool check(){ int i = -1; i = s.find(a); if(i==-1)return false; i += a.length(); string t = s.substr(i , s.size()); int j = -1; j = t.find(b); if(j==-1)return false; return true; } int main(){ cin >> s >> a >> b; boo...
C++
c3244e952830643938d51ce14f043d7d
e3bf645e561178b8334b19be2c9b13db
1,200
PASSED
#include<bits/stdc++.h> using namespace std; string s, a, b, t; int m, n, p, q; void input(){ cin>>s>>a>>b; } void output(){ } void solve(){ t=s; reverse(s.begin(), s.end()); int i=0; while (i<s.length()){ if (m==0 && s.substr(i, a.length())==a) { m=1; i+=a.length(); } else if (s.substr(i, b.l...
C++
c3244e952830643938d51ce14f043d7d
2e256c9ad76327c3eb5a14f3b7180822
1,200
PASSED
#include <iostream> #include <string> #include <algorithm> using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int judge(string a1,string a2,int pos){//子串匹配问题 int len1=a1.size(),len2=a2.size(),i; for(i=pos;i<=len1-len2;i++){ if(a1.substr(i,len2...
C++
c3244e952830643938d51ce14f043d7d
232f25b5b95afa1aa5fe590c52e35202
1,200
PASSED
#include <bits/stdc++.h> using namespace std; #define sz(a) (int)a.size() typedef long long ll; const int N = (int)2e5 + 3; const int K = 20; const int inf = (int)1e9 + 7; int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif string s, a, b; ...
C++
c3244e952830643938d51ce14f043d7d
34d63ea60af25a3ed677ba7f6f149920
1,200
PASSED
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); string s1,s2,s3; cin>>s1>>s2>>s3; long long n=0,m=0; int qwe=0,asd=0; n=s1.find(s2,0); m=s1.find(s3,n+s2.size()); if(n!=string::npos && m!=string::npos) qwe=1; reverse(s1.begin(),s1.end()); n=s1...
C++
c3244e952830643938d51ce14f043d7d
7f8a6c2d094176ea3ccc96ec4d5860fd
1,200
PASSED
#include<bits/stdc++.h> using namespace std; int main(){ int forward=0, backward=0; string s,satu,dua; cin>>s>>satu>>dua; size_t r = s.find(satu); if (r!=string::npos){ size_t q = s.find(dua, r + satu.length()); if(q!=string::npos){forward++;} } reverse(s.begin(), s.end...
C++
c3244e952830643938d51ce14f043d7d
da84f157d08d37cb10aa487bd25412d6
1,200
PASSED
#include <iostream> #include <cstdio> #include <cstring> using namespace std; const int maxn=100100; char atob[maxn],btoa[maxn], s1[300], s2[300]; int main() { int pos1, pos2, len1, len2, len3; scanf("%s",atob); len1=strlen(atob); for(int i=0; i<len1; i++) btoa[len1-1-i]=atob[i]; scanf("%s"...
C++
c3244e952830643938d51ce14f043d7d
5d662894c263ff285bd90a7f4409d104
1,200
PASSED
#include<bits/stdc++.h> #include<iostream> #include<math.h> #include<vector> #include<set> #include<queue> #include<algorithm> using namespace std; #define ll int long long #define ull unsigned long long #define ld long double #define pi acos(-1) #define pb push_ba...
C++
c3244e952830643938d51ce14f043d7d
11f66e146146aa9fc968d6c66226d85a
1,200
PASSED
import java.util.*; import java.io.*; public class D { public static void main(String[] args) { FastReader in = new FastReader(); int t = in.nextInt(); while (t-- > 0) { int a = in.nextInt(); int b = in.nextInt(); int min = Math.min(a, b); in...
Java
3bb093fb17d6b76ae340fab44b08fcb8
349a2fc777ee14c46f4a78f3d51ebb14
800
PASSED
import java.util.*; import java.io.*; import java.lang.*; import java.math.*; public class CodeChef { public static void main(String[] args) throws IOException { Scanner scan = new Scanner(System.in); int testcases = scan.nextInt(); for(int m=0; m<testcases; m++) { int a = scan.nextInt(); int b = scan.n...
Java
3bb093fb17d6b76ae340fab44b08fcb8
ec8bb7fb976b878bd05a309e656b9142
800
PASSED
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class MinimalSquare { public static void main(String[] args) { // TODO Auto-generated method stub // Problem https://codeforces.com/problemset/problem/1360/A // For more solutio...
Java
3bb093fb17d6b76ae340fab44b08fcb8
f78405af1cdf1f70527f4dbea6e5fd99
800
PASSED
//package Div3_644; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = n...
Java
3bb093fb17d6b76ae340fab44b08fcb8
fdb6e1ed418c5de466079d82bde479a7
800
PASSED
import java.util.*; public class miniMalSquare { public static void main(String args[]) { Scanner in = new Scanner(System.in); int tt = in.nextInt(); while(tt>0) { int n1 = in.nextInt(); int n2 = in.nextInt(); if(n1<n2) { if...
Java
3bb093fb17d6b76ae340fab44b08fcb8
eafbf4cc5daf04ae7755b964c6ceff3a
800
PASSED
import java.util.*; import java.lang.Math; public class codeforce{ public static void main(String args[]){ Scanner sj = new Scanner(System.in); int t = sj.nextInt(); while(t-->0){ int a = sj.nextInt(); int b = sj.nextInt(); int ans = Math.min(Math.max(2*a, b), Math.max(a, 2*b)); System.out...
Java
3bb093fb17d6b76ae340fab44b08fcb8
1e297d3d4e5d88261b5dd0c254e48699
800
PASSED
import java.util.*; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); int t = s.nextInt(); s.nextLine(); int[] ans = new int[t]; for (int i = 0; i < t; i++) { int a = s.nextInt(); int b = s.nextInt(); int min = Math.min(a, b); ...
Java
3bb093fb17d6b76ae340fab44b08fcb8
fe69de1e864ad0b26a832d6b3f541507
800
PASSED
import java.util.*; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); int t = s.nextInt(); s.nextLine(); int[] ans = new int[t]; for (int i = 0; i < t; i++) { int a = s.nextInt(); int b = s.nextInt(); if (a < b) { a = a * ...
Java
3bb093fb17d6b76ae340fab44b08fcb8
d1757de6e76a4391a8862d0ff6716088
800
PASSED
import java.util.*; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int t=sc.nextInt(); while(t>0) { t--; int a,b; a=sc.nextInt(); b=sc.nextInt(); int x = Math.min(a,b); ...
Java
3bb093fb17d6b76ae340fab44b08fcb8
d7a49f0a1c9a4937518f6fdfeb804a11
800
PASSED
#include<iostream> using namespace std; int main() { int n,a[10000][2],i,l,b; cin>>n; for(i=0;i<n;i++) cin>>a[i][0]>>a[i][1]; for(i=0;i<n;i++) {l=a[i][1];b=a[i][0]; if(a[i][0]>a[i][1]) {l=a[i][0];b=a[i][1];} if(l>2*b) cout<<l*l<<endl; else co...
C++
3bb093fb17d6b76ae340fab44b08fcb8
578a62b7d19acdcf919917dc89ba761b
800
PASSED
import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner snr=new Scanner(System.in); int n=snr.nextInt(); int[] a=new int[n]; for(int i=0;i<n;i++){ a[i]=snr.nextInt(); } int sol=0; Arrays.sort...
Java
a5d3c9ea1c9affb0359d81dae4ecd7c8
10e1db0ebbafb0ac9a2cad01fe4ba6f1
800
PASSED
import java.util.Scanner; public class RENAMETHISBITCH { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { int n = sc.nextInt(); int max = sc.nextInt(); int sum = 0; for (int i = 1; i < n; i++) { int a = sc.nextInt(); if (max < a) { su...
Java
a5d3c9ea1c9affb0359d81dae4ecd7c8
9b190453a7c57b0baf631ed34786fa6e
800
PASSED
import java.util.Scanner; public class P_758A { public static final String NAME = "Holiday Of Equality"; public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { int n = sc.nextInt(); int max = sc.nextInt(); int welfare = 0; for (int i = 1; i < n; i++) { ...
Java
a5d3c9ea1c9affb0359d81dae4ecd7c8
eb54eaf22f13f0df8698ac51149e1870
800
PASSED
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws IOException{ Scanner sc = new Scanner(System.in); OutputStreamWriter ow = new OutputStreamWriter(System.out); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); int c,t,sd=0; c=sc.next...
Java
a5d3c9ea1c9affb0359d81dae4ecd7c8
6906558b8e058cc565553007d8bf75c6
800
PASSED
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws IOException{ Scanner sc = new Scanner(System.in); OutputStreamWriter ow = new OutputStreamWriter(System.out); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); int c,t,sd=0; c=sc.next...
Java
a5d3c9ea1c9affb0359d81dae4ecd7c8
418f6c05222e073a4d1bbac15de54a8a
800
PASSED
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws IOException{ Scanner sc = new Scanner(System.in); OutputStreamWriter ow = new OutputStreamWriter(System.out); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); int c,t,sd=0; c=sc.next...
Java
a5d3c9ea1c9affb0359d81dae4ecd7c8
d2f91c40f73b756ded48dfd25b805c44
800
PASSED
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws IOException{ Scanner sc = new Scanner(System.in); OutputStreamWriter ow = new OutputStreamWriter(System.out); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); int c,t,sd=0; c=sc.next...
Java
a5d3c9ea1c9affb0359d81dae4ecd7c8
98919f1030913378bf999f3d8ee6181a
800
PASSED
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws IOException{ Scanner sc = new Scanner(System.in); OutputStreamWriter ow = new OutputStreamWriter(System.out); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); int c,t,sd=0; c=sc.next...
Java
a5d3c9ea1c9affb0359d81dae4ecd7c8
a43f15637e33383540fc3d8abe1a074a
800
PASSED
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws IOException{ Scanner sc = new Scanner(System.in); OutputStreamWriter ow = new OutputStreamWriter(System.out); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); int c,t,sd=0; c=sc.next...
Java
a5d3c9ea1c9affb0359d81dae4ecd7c8
98634bd92c596b8b368fa24f63c72691
800
PASSED
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws IOException{ Scanner sc = new Scanner(System.in); BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out)); int c,t,sd=0; c=sc.nextInt(); int b[]=new int[c]; for(int i=0; i<c; i++)...
Java
a5d3c9ea1c9affb0359d81dae4ecd7c8
f32a3f5fd042227adb9f013aa59d2994
800
PASSED
#include<bits/stdc++.h> using namespace std; long long a,b,c,d,i,e,f,g,n,m,k,l,j,p; int main() { cin>>n; for(i=1;i<=n;i++) { k=0; scanf("%I64d",&a); if(a==1) printf("NO\n"); else { p=sqrt(a); if(p*p!=a) printf("NO\n"); else { for(j=2;j*j<=p;j++) if(p%j==0) k++; if(k==0) printf("YES\n"); else printf(...
C++
6cebf9af5cfbb949f22e8b336bf07044
03adca869d0f2a140276dbf63e6ba612
1,300
PASSED
#include<bits/stdc++.h> using namespace std; set<long long int> s; //int n=1000007; bool a[10000000]={0}; void seive() { // memset(a,true,sizeof(a)); a[0]=1; a[1]=1; for(int i=2LL;i*i<=1000000;i++) { if(a[i]==0) { for(int j=i*2;j<=1000000;j+=i) { a[j]=1; ...
C++
6cebf9af5cfbb949f22e8b336bf07044
b0408a1700b53c2d3432894a084f111d
1,300
PASSED
#include<bits/stdc++.h> using namespace std; set<long long int> s; //int n=1000007; bool a[10000000]={0}; void seive() { // memset(a,true,sizeof(a)); a[0]=1; a[1]=1; for(int i=2LL;i*i<=1000000LL;i++) { if(a[i]==0) { for(int j=i*2;j<=1000000LL;j+=i) { a[j]=1; ...
C++
6cebf9af5cfbb949f22e8b336bf07044
0dd81e6c87f9944c1a3fdb843617952c
1,300
PASSED
#include<bits/stdc++.h> using namespace std; set<long long int> s; //int n=1000007; bool a[10000000]; void seive() { memset(a,true,sizeof(a)); a[0]=false; a[1]=false; for(int i=2;i*i<=1000000;i++) { if(a[i]==true) { for(int j=i*2;j<=1000000;j+=i) { a[j]=false; ...
C++
6cebf9af5cfbb949f22e8b336bf07044
982bb192236457e3c55d221a1fe803a5
1,300
PASSED
#include<bits/stdc++.h> using namespace std; set<long long int> s; //int n=1000007; bool a[10000000]={0}; void seive() { // memset(a,true,sizeof(a)); a[0]=1; a[1]=1; for(int i=2LL;i*i<=1000000LL;i++) { if(a[i]==0) { for(int j=i*i;j<=1000000LL;j+=i) { a[j]=1; ...
C++
6cebf9af5cfbb949f22e8b336bf07044
dcbea514ba4966392c6c0c33e75d2674
1,300
PASSED
#include<iostream> #include<math.h> using namespace std; int av(int aa) { if(aa==1)return 0; for(int i=2 ;i<=sqrt(aa);i++) { if(aa%i==0)return 0; } return 1; } int main() { int n; cin>>n; long long int a; for(int i=0;i<n;i++) { cin>>a; long long int k; k = sqrt(a); //cout<<k; //cout<<av(k); if((k*k)==a &&av(k)==...
C++
6cebf9af5cfbb949f22e8b336bf07044
de87ab808acc6e8926700629a17fe448
1,300
PASSED
#include <iostream> #include<cmath> using namespace std; int main() { long long n,x; cin>>n; int count1=0; while(n--) { cin>>x; double sqareroot=sqrt(x); int sq=sqareroot; if(sqareroot!=sq) { cout<<"NO\n"; continue; } bool is_exist=true; if(...
C++
6cebf9af5cfbb949f22e8b336bf07044
56824b574e5dc2c99a9a2c23106540e4
1,300
PASSED
#include <bits/stdc++.h> using namespace std; #define SWAP(x,y,z) {if ( y > z ) swap(y,z); if ( x > y ) swap(x,y); if (y > z) swap(y,z);} typedef pair<int, int> pii; typedef long long ll; typedef unsigned long long ull; double const eps = 1e-6; double const pi = 3.1415926535; ll const mod = 1e9+7; int main() { ...
C++
74cbcbafbffc363137a02697952a8539
80eb9f05394207854bbc058909826c66
1,200
PASSED
#pragma comment(linker, "/STACK:36777216") #include <iostream> #include <algorithm> #include <unordered_map> #include <string> #include <vector> #include <cmath> using namespace std; const int INF = 123123123; int f1(int n) { n %= 4; if (n == 0) return 6; if (n == 1) return 2; if (n == 2) return 4; return 8...
C++
74cbcbafbffc363137a02697952a8539
2c076d5e4a652c68c3c15d07281e20dc
1,200
PASSED
#include<cstdio> #include<iostream> #include<cmath> #include<cstring> #include<algorithm> #include<stack> using namespace std; char ch; int main(){ stack<int>s; while(cin>>ch) { s.push(ch-'0'); } int a=0,b=0; a=s.top();s.pop(); if(!s.empty()) { b=s.top(); s.pop(); } int n=a+b*10; if(n==0)cout<<4; if(n...
C++
74cbcbafbffc363137a02697952a8539
f9ed59548520d19a506974d0fec42978
1,200
PASSED
#include <stdio.h> #include <string.h> char s[111111]; int main() { int i, x; scanf("%s", s + 1); s[0] = 48; i = strlen(s + 1); x = ((s[i - 1] - 48) * 10 + s[i] - 48) & 3; putchar(x ? 48 : 52); return 0; }
C++
74cbcbafbffc363137a02697952a8539
7d34f57daa5c8ffac9adccc55495992e
1,200
PASSED
/* #### #### ### ### ### ### Bravery ### ### Determination ### ## Perseverance ## ## Integrity ## ## Patience ## ## Kindness ## ##Justice## ## ## ## ## # */ #include <bits/stdc++.h> #define mp make_pair #define p...
C++
74cbcbafbffc363137a02697952a8539
bafd0fd44277507d6bb99b7042481648
1,200
PASSED
#include<iostream> using namespace std; int main() { string n; cin >> n; if(n == "0") { cout << 4; return 0; } int two[4] = {2, 4, 8, 6}; int three[4] = {3, 9, 7, 1}; int four[2] = {4, 6}; string temp = ""; if(n.length() > 1) temp += n[n.length() - 2], ...
C++
74cbcbafbffc363137a02697952a8539
2eaff457e677f1c85d46be1da503bce2
1,200
PASSED
#include <iostream> using namespace std; string s; int main(){ cin>>s; long long a=s.length(); if(a==1 && s[0]=='4'){ cout<<4; return 0; } if(((s[a-1]-'0')+2*(s[a-2]-'0'))%4 ==0){ cout<<4; }else{ cout<<0; } }
C++
74cbcbafbffc363137a02697952a8539
3996ca905bd46cb0d123e574167329f4
1,200
PASSED
#include <bits/stdc++.h> using namespace std; string str; int main() { // your code goes here cin>>str; int l=str.length(); int n=(str[l-2]-'0')*10+(str[l-1]-'0'); if(l==1) { n=(str[l-1]-'0'); } if(n%4==0) { printf("4\n"); } else { ...
C++
74cbcbafbffc363137a02697952a8539
88171a002ca61d3bae31833ef1a8c4c3
1,200
PASSED
#include <bits/stdc++.h> using namespace std; int getrem(string s) { int len=s.size(); int temp=0; for(int i=0;i<len;i++) { int ans=s[i]-'0'; ans+=(temp*10); temp=ans%4; } return temp; } int main() { // your code goes here string s; cin>>s; int r...
C++
74cbcbafbffc363137a02697952a8539
d809d7dc942c445bd7ab65a979887d04
1,200
PASSED
#include<bits/stdc++.h> #define ios std::ios::sync_with_stdio(false) #define sd(n) scanf("%d",&n) #define sdd(n,m) scanf("%d%d",&n,&m) #define sddd(n,m,k) scanf("%d%d%d",&n,&m,&k) #define pd(n) printf("%d\n", (n)) #define pdd(n,m) printf("%d %d\n", n, m) #define pld(n) printf("%lld\n", n) #define pldd(n,m) printf("%lld...
C++
74cbcbafbffc363137a02697952a8539
ec525f6de4af0eef126973f585184f38
1,200
PASSED
#include<bits/stdc++.h> using namespace std; int n; int a[301][301]={{0}}; vector<int> p; int used[301] ={0}; void solve(int idx) { int min_val = p[idx]; int min_idx = idx; for(int i = idx+1 ;i < n;i++) { if(a[i][idx]) { if(!used[p[i]] && p[i] < min_val) { ...
C++
a67ea891cd6084ceeaace8894cf18e60
c324a976c205cc8ad8ca0d6000360f3b
1,600
PASSED