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 n; // int a[10][10]; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); // freopen("input.txt","r",stdin); cin>>n; char c; while(n--){ int z=1,ii,jj,iii,jjj,f=1; for(int i=1;i<9;++i){ for(int j=1;j<9;++j){ cin>>c; if(c=='K' && f){ // cout<<...
C++
4f3bec9c36d0ac2fdb8041469133458c
3deb7d5b10af784bf12a288b31a5f9c0
1,500
PASSED
#define _CRT_SECURE_NO_WARNINGS #include<bits\stdc++.h> //#ifndef _CRT_SECURE_NO_WARNINGS #define p cout<<endl; system("pause"); #define pm cout<<endl; system("pause");main(); #define autoo(m) for (auto dd : m) printf("%i", dd) ; typedef long long ll; using namespace std; string s[8]; /* bool seq(int i,int j) { retur...
C++
4f3bec9c36d0ac2fdb8041469133458c
551344fd183ad7dc7ff4ceb9b65ad6eb
1,500
PASSED
#include<bits/stdc++.h> using namespace std; #define ll long long int #define ull unsigned long long int #define pb push_back #define vi vector<int> #define vll vector<ll> #define vs vector<string> #define vull vector<ull> #define all(v) v.begin(),v.end() #define mp make_pair #define bitcount(x) __builtin_popcountll(x)...
C++
4f3bec9c36d0ac2fdb8041469133458c
55689f53a2ac675d76f02a6f459a1dfe
1,500
PASSED
#include<bits/stdc++.h> using namespace std; #define ll long long int #define ull unsigned long long int #define pb push_back #define vi vector<int> #define vll vector<ll> #define vs vector<string> #define vull vector<ull> #define all(v) v.begin(),v.end() #define mp make_pair #define bitcount(x) __builtin_popcountll(x)...
C++
4f3bec9c36d0ac2fdb8041469133458c
85ebdf0d12b7263c1f93581b4c505b99
1,500
PASSED
#include <cstdio> #include <algorithm> #include <cstdlib> #include <cmath> #include <queue> #include <stack> #include <cstring> #include <map> #include <string> #include <fstream> #include <vector> #include <iostream> #define sc(a) scanf("%d",&a) #define scc(a,b) scanf("%d %d",&a,&b) #define sccc(a,b,c) scanf("%d %d %d...
C++
4f3bec9c36d0ac2fdb8041469133458c
56e12d706286d41a9a952d7611b2c3db
1,500
PASSED
#include <bits/stdc++.h> using namespace std; #define ll long long #define pll pair<long long,long long> int main() { ll n,m; cin>>n>>m; if(n==1&&n==m){ cout<<0; return 0; } ll b[n][m]; if(n==1||m==1){ if(n==1){ for(int i=0;i<m;i++) cout<<i+2<<" "; } else{ for(int i=0;i<n;i++) cout<<i+2<<e...
C++
acebe5e1d927d32d65a4500d1d45c4ba
6240e477333d8e136da298cef4399a79
1,400
PASSED
#include <bits/stdc++.h> using namespace std; int ans[510][510]; int main(){ int n,m; cin>>n>>m; if(n==1&&m==1){ cout<<0<<endl; return 0; } if(n==1){ for(int i=0;i<m;i++) ans[0][i]=i+2; } else if(m==1){ for(int i=0;i<n;i++) ans[i][0...
C++
acebe5e1d927d32d65a4500d1d45c4ba
8704576ba244d6639682d2e6659075f3
1,400
PASSED
#include <bits/stdc++.h> using namespace std; #define int long long #define vi vector <int> #define all(v) v.begin(), v.end() #define pii pair <int, int> #define mp(a, b) make_pair(a, b) #define forn(i, from, n) for (int i = (int)(from); i < (int)(n); ++i) const int INF = 1e9 + 9; signed main() { ios_base::s...
C++
acebe5e1d927d32d65a4500d1d45c4ba
ba40614db32996267bbe12d079a44179
1,400
PASSED
#include <bits/stdc++.h> using namespace std; long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); long long a, b; cin >> a >> b; if (a == 1 && b == 1) { cout << 0; return 0; } if (a == 1) { ...
C++
acebe5e1d927d32d65a4500d1d45c4ba
77c6a0f7d95ce1f6f83d2178d23aee85
1,400
PASSED
#include <iostream> using namespace std; int a[500][500]; int n, m; int main() { cin >> n >> m; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { a[i][j] = 1; } } if (n == 1 && m == 1) { cout << 0 << endl; return 0; } if (m == 1) { for (int i = 2; i <= n + 1; i++) { cout << i << endl;...
C++
acebe5e1d927d32d65a4500d1d45c4ba
cbc575bcbe8402d2ff3769b7c61b6a33
1,400
PASSED
#include<bits/stdc++.h> using namespace std; int r, c, a[509][509]; int main(){ cin >> r >> c; if(r==1&& c==1){ cout << 0 << endl; return 0; } if(r==1) { for(int i=2; i<=c+1; i++) cout << i << " "; cout <<endl; return 0; } if(c==1){ for(int i=2; i...
C++
acebe5e1d927d32d65a4500d1d45c4ba
d1322061c729e239c5a94d23123fafa5
1,400
PASSED
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; #define ll long long typedef tree< pair<int,int>, null_type, less< pair<int,int> >, rb_tree_tag, tree_order_statistics_node_update>Order_Set; Order_Set X; const in...
C++
acebe5e1d927d32d65a4500d1d45c4ba
87c993538254b0292989c8b86c8f32de
1,400
PASSED
#include <bits/stdc++.h> #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse2") /* |||||||||||||||||||||||||||||||||||||||||||||||| | ||| | |||| |||| | | | | | | | | | | | | | | | | | | | ...
C++
acebe5e1d927d32d65a4500d1d45c4ba
526637c14d6148c9744041613cdef660
1,400
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5 + 1; const int MAXN = 1e9; long long n, ans, cnt = 3, a[501][501], k, m; string s[1001]; bool p[N]; int main (){ cin >> n>> m; if (n == 1 && m == 1){ cout << 0; return 0; } else if (n == 1){ cnt = 1; for (int i = 1;i <...
C++
acebe5e1d927d32d65a4500d1d45c4ba
1605030c27d3ab180a1a0833ae783a83
1,400
PASSED
//Ñïóëภìóëภ//Íèããà âàé ÷èáèêè÷è ìóðภ//Øèðûëè ãó äå çå ìóíëภ//Àëå ôàñî íèããà ñî áàìàå //#pragma GCC optimize("Ofast") //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #include <bits/stdc++.h> #define pb push_back #define mpr make_pair #define int long long #define lb lower_bo...
C++
acebe5e1d927d32d65a4500d1d45c4ba
f77cad613f4fcb1704376e3fbdf55484
1,400
PASSED
#include <bits/stdc++.h> #define fi first #define se second #define db double #define U unsigned #define P std::pair<int,int> #define LL long long #define pb push_back #define MP std::make_pair #define all(x) x.begin(),x.end() #define CLR(i,a) memset(i,a,sizeof(i)) #define FOR(i,a,b) for(int i = a;i <= b;++i) #define ...
C++
61ebeb5e1ab9ed907554ef8e04e0a7b3
1a26964ce2a772c81bbb7300acfe37ff
2,800
PASSED
#include <algorithm> #include <iostream> #include <cstring> #include <cstdio> #include <vector> #include <stack> #include <queue> #include <cmath> #include <set> #include <map> #define mp make_pair #define pb push_back #define pii pair<int,int> #define link(x) for(edge *j=h[x];j;j=j->next) #define inc(i,l,r) for(int i=...
C++
61ebeb5e1ab9ed907554ef8e04e0a7b3
d21e12ffae295a1c4ad271756897d1a8
2,800
PASSED
#pragma GCC optimize(2) #include<bits/stdc++.h> #define For(i,a,b) for(register int i=(a);i<=(b);++i) #define Rep(i,a,b) for(register int i=(a);i>=(b);--i) #define int long long using namespace std; inline int read() { char c=getchar();int x=0;bool f=0; for(;!isdigit(c);c=getchar())f^=!(c^45); for(;isdigit(...
C++
61ebeb5e1ab9ed907554ef8e04e0a7b3
810b9102567e4b13724f6f4f43c3f94c
2,800
PASSED
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; #define ll long long inline void read (int &x) { char ch = getchar(); int f = 0; x = 0; while (!isdigit(ch)) { if (ch == '-') f = 1; ch = getchar(); } while (isdigit(ch)) x = x * 10 + ch - 48, ch = getchar(); if (f) x = -x; } const ...
C++
61ebeb5e1ab9ed907554ef8e04e0a7b3
362f4be0222bad9d0ab165c678740104
2,800
PASSED
#include <cstdio> #include <cctype> #include <cstring> #include <queue> #include <vector> #include <algorithm> #ifdef ONLINE_JUDGE #define freopen(a, b, c) #endif typedef long long ll; namespace IPT { const int L = 1 << 21; char buf[L], *front=buf, *end=buf; char GetChar() { if (front == end) end = buf + fread(fro...
C++
61ebeb5e1ab9ed907554ef8e04e0a7b3
ccbe4b8959ef06c775285f45df64d996
2,800
PASSED
#include<bits/stdc++.h> using namespace std; #define maxn 1010 #define maxm 400010 const int C=14; const long long INF=1e18; template <typename T>inline T read() { register T sum=0; register char cc=getchar(); int sym=1; while(cc!='-'&&(cc>'9'||cc<'0'))cc=getchar(); if(cc=='-')sym=-1,cc=getchar(); ...
C++
61ebeb5e1ab9ed907554ef8e04e0a7b3
37103cded54ab053f2224f5f5d5d7108
2,800
PASSED
// clang-format off // powered by c++11 // by Isaunoya #include<bits/stdc++.h> #define rep(i,x,y) for(register int i=(x);i<=(y);++i) #define Rep(i,x,y) for(register int i=(x);i>=(y);--i) using namespace std;using db=double;using ll=long long; using uint=unsigned int;using ull=unsigned long long; using pii=pair<int,int>...
C++
61ebeb5e1ab9ed907554ef8e04e0a7b3
a63e18df0cc5eeb917c2a81e00e21bd6
2,800
PASSED
#include <bits/stdc++.h> using namespace std; const int sz=1e3+10; int q=1, ne[sz][14], pr[sz], prsy[sz], go[sz][14], link[sz], w[sz]; long long dp[sz][1<<14], dp2[sz][1<<14], inf=1e18; main() { //freopen("input.txt", "r", stdin); int k; cin>>k; for(int a=0; a<14; a++) ne[0][a]=-1; for(int a=0; a<k;...
C++
61ebeb5e1ab9ed907554ef8e04e0a7b3
c6911fe9ad86e9ff7192018b6741bf4d
2,800
PASSED
#include <bits/stdc++.h> #pragma GCC optimize("Ofast","-funroll-loops","-fdelete-null-pointer-checks") #pragma GCC target("ssse3","sse3","sse2","sse","avx2","avx") using namespace std; typedef long long ll; const int M = 1010, N = 400010, ST = (1 << 15) + 5; int k, n; int fail[M], tot, go[M][15]; ll up[M]; char t[M], s...
C++
61ebeb5e1ab9ed907554ef8e04e0a7b3
d8a8747278e05af78691dfabc8da12de
2,800
PASSED
#include<iostream> #include<cstdio> #include<vector> #include<queue> #include<cstring> using namespace std; typedef long long ll; const int maxn = 400005; const int maxm = 1005; const ll inf = 1e18; #define lowbit(x) ((x) & (-x)) //#define d(x) cerr << #x << " = " << x << endl int n, m; ll f[maxm][1 << 14], ans = -inf;...
C++
61ebeb5e1ab9ed907554ef8e04e0a7b3
8bea92b07745e8f4be324c47f0cd1bfe
2,800
PASSED
#include <bits/stdc++.h> #define x first #define y second #define eps 1e-8 #define pb push_back #define mod 1000000007 #define inf 0x3f3f3f3f #define INF 0x3f3f3f3f3f3f3f3fLL #define bit(x, y) (((x)>>(y))&1) #define bctz(x) (__builtin_ctz(x)) #define bclz(x) (__builtin_clz(x)) #define bclzl(x) (__builtin_c...
C++
5c64671081f9f5332d0ad57503091a54
7dd11a0443182828cc2e2bbdfa492d9a
2,100
PASSED
#include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 7; int n, m, a[maxn], vis[maxn], cnt[maxn]; vector<int> adj[maxn], ans; void solve() { cin >> n >> m; for (int i = 1; i <= n; ++i) { adj[i].clear(); } for (int i = 0, u, v; i < m; ++i) { cin >> u >> v; adj[u].push_back(v); adj[v].push_...
C++
5c64671081f9f5332d0ad57503091a54
ca80c708ef0257eb19b1f506a0e28788
2,100
PASSED
#include <iostream> #include<bits/stdc++.h> using namespace std; #define Max 100005 int sequance[Max] , counter[Max]; list<int> adj[Max]; vector<int> ans; void DFS(int s) { counter[s]++; ans.push_back(s); list<int>::iterator i; for(i=adj[s].begin();i!=adj[s].end();i++) { counter[*i]++; ...
C++
5c64671081f9f5332d0ad57503091a54
76553d29a79b6fb57c58369c831eb8c2
2,100
PASSED
#include <bits/stdc++.h> using namespace std; template <class T> inline void read(T &x) { x= 0; char c= getchar(); while(!isdigit(c)) c= getchar(); while(isdigit(c)) x= x * 10 + (c & 15), c= getchar(); } #define N 100001 int n, m, head[N], cnt, a[N], b[N], ans, stk[N]; bool bb[N], vis[N]; queue<int> q; struct Edge ...
C++
5c64671081f9f5332d0ad57503091a54
8497a29ceca13708b4bab3d863b12e29
2,100
PASSED
//6wn #include<bits/stdc++.h> using namespace std; const int maxn=100000; int a[maxn],b[maxn]; bool visited[maxn]; queue<int>q; vector<int>mi[maxn]; int main(){ int n,m,k,x,y; cin>>n>>m; for(int i=0 ; i<m ; i++){ cin>>x>>y; mi[x-1].push_back(y-1); mi[y-1].push_back(x-1); } for(int i=0 ; i<n ; i++) cin>>a[i]; ...
C++
5c64671081f9f5332d0ad57503091a54
35f475ed04a8d02d9ec8a2bfab6d71a6
2,100
PASSED
#include <iostream> #include <queue> #include <vector> using namespace std; int arr[100001]; int cnt[100001]; vector <vector<int> > adjList; vector <int> ans; int main(){ int n,m; cin>>n>>m; for(int i = 0;i<=n;i++) adjList.push_back(vector<int>(0)); for(int i = 0;i<m;i++){ int x,y; ...
C++
5c64671081f9f5332d0ad57503091a54
811f1b7e9f3510dc6112d24961622bf1
2,100
PASSED
#include <iostream> #include <queue> #include <vector> using namespace std; int arr[100001]; int cnt[100001]; vector <vector<int> > adjList; vector <int> ans; int main(){ ios_base::sync_with_stdio(0); int n,m; cin>>n>>m; for(int i = 0;i<=n;i++) adjList.push_back(vector<int>(0)); for(int ...
C++
5c64671081f9f5332d0ad57503091a54
c9d39e54d56ba157d91d4defee1042c2
2,100
PASSED
#include <iostream> #include <stdio.h> #include <list> #include <algorithm> #include <vector> #include <map> #include <unordered_map> #include <functional> #include <numeric> #include <utility> #include <stdlib.h> #include <string.h> #include <queue> #include <stack> #include <iomanip> #include <bitset> #include <set> ...
C++
5c64671081f9f5332d0ad57503091a54
1c6b3ab00cb5fec9e4fa2171ee4867c5
2,100
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define rep(i,a,n) for(ll i=a;i<n;i++) #define per(i,n,a) for(ll i=n-1;i>=a;i--) #define nl "\n" #define LLMAX 1e18 #define ff first #define ss second #define pb push_back #define mp make_pair #define pll pair<ll,ll> #define f...
C++
5c64671081f9f5332d0ad57503091a54
2ea1e16ec11d451ec649efae5caebc1c
2,100
PASSED
#include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <sstream> #include <iomanip> #include <string> #include <vector> #include <set> #include <map> #include <queue> #include <stack> #include <list> #include <algorithm> using namespace std; #define nln ...
C++
5c64671081f9f5332d0ad57503091a54
2644f7ced9472c77af4d073fcfc27219
2,100
PASSED
n=int(input()) for i in range (n): a,b=(input()),(input()) for i in b: if i in a: k="YES" break else: k="NO" print(k)
Python
9b9b01e5d2329291eee80356525eaf04
aa279198e77a2eb7deb7c6e43928baf1
1,000
PASSED
a = int(input()) for i in range(a): s = input() t = input() an = "no" for i in range(len(s)): if s[i] in t: an = "yes" print(an)
Python
9b9b01e5d2329291eee80356525eaf04
082d1497a1a9936a0103bdb3d5386bde
1,000
PASSED
t = int(input()) for _ in range(t): a = input() b = input() d1 = dict() d2 = dict() f = 0 sa = set() sb = set() for i in range(len(a)): sa.add(a[i]) sb.add(b[i]) sa.intersection_update(sb) if len(sa) > 0: print("YES") else: print("NO")
Python
9b9b01e5d2329291eee80356525eaf04
b1d4a021ecacd3c79921557bb04a5b7c
1,000
PASSED
line = input() q = int(line) for q in range(0, q): set1 = set(input()) set2 = set(input()) if ((set1 & set2) == set()): print("NO") else: print("YES")
Python
9b9b01e5d2329291eee80356525eaf04
edd193be5e10d4e69684871b8a88fae9
1,000
PASSED
a=int(input()) for i in range(a): s1=input() s2=input() s1=[i for i in s1] s2=[i for i in s2] k=0 for i in s2: if(i in s1): k=1 break if(k==1): print("YES") else: print("NO")
Python
9b9b01e5d2329291eee80356525eaf04
24971922851d1fb24e8c89413f8e2607
1,000
PASSED
def str_equalizer(all_pairs): for pairs in all_pairs: word1 = pairs[0] word2 = pairs[1] if word1 == word2: print("YES") else: lst_word1 = [i for i in word1] lst_word2 = [j for j in word2] if len(lst_word1) == 1 and word1 == word2: ...
Python
9b9b01e5d2329291eee80356525eaf04
a97f9709f38f790d83f341ea1138ebb1
1,000
PASSED
n = int(input()) for i in range(n): s = list(input()) t = list(input()) con = True for j in range(len(s)): for k in range(len(t)): if s[j] == t[k]: print("yes") con = False break if con is False: break if con ...
Python
9b9b01e5d2329291eee80356525eaf04
003a111b1391e40cefa43e3e92fc4c73
1,000
PASSED
for i in range(int(input())): s = input() t = input() ss = set(s) st = set(t) if s == t: print('YES') continue if ss.isdisjoint(st): print('NO') else: print('YES')
Python
9b9b01e5d2329291eee80356525eaf04
280857606b4d6f2808a9aaaa2b9c0e35
1,000
PASSED
q = int(input()) for i in range(q): s = input() t = input() sset = set(s) tset = set(t) if sset & tset: print("YES") else: print("NO")
Python
9b9b01e5d2329291eee80356525eaf04
69f0f16a043c38e4bdf475684d3eaac9
1,000
PASSED
n = int(input()) b = [] for i in range(n): a = str(input()) x = str(input()) aa = set(a) bb = set(x) s = aa.intersection(bb) if len(x) == len(a): if x == a: b.append('YES') elif len(s) != 0: b.append('YES') else: b.append('NO') else...
Python
9b9b01e5d2329291eee80356525eaf04
2f63af0de00f89c818f2ccc7052d79bf
1,000
PASSED
#include <bits/stdc++.h> #define endl '\n' using namespace std; const int MAXN = (1 << 20); int n; pair<long double, long double> a[MAXN]; void read() { cin >> n; for(int i = 0; i < n; i++) cin >> a[i].first >> a[i].second; } /* A = i + b / 2 - 1 i = A - b / 2 + 1 */ long double dp[MAXN]; int64_t gcd(int6...
C++
26506591fc15f23b0436473cd2712166
8ac6e074c4eea7bac0599ce779a80d7b
2,800
PASSED
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair typedef pair<int, int> pii; typedef long double dbl; typedef long long ll; const int MAXN = 2e5 + 5; int n; pii pt[MAXN]; dbl twoInv[111]; int gcd(int a, int b) { while (b) { a %= b; swap(a, b); } return a; } int...
C++
26506591fc15f23b0436473cd2712166
288b23587447756e7c571db9930ec2d3
2,800
PASSED
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair typedef pair<int, int> pii; typedef long double dbl; typedef long long ll; const int MAXN = 2e5 + 5; int n; pii pt[MAXN]; dbl twoInv[111]; int gcd(int a, int b) { while (b) { a %= b; swap(a, b); } return a; } int...
C++
26506591fc15f23b0436473cd2712166
192de63c1d7ebcf36ad3892c4db2f6bc
2,800
PASSED
#include <bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair typedef pair<int, int> pii; typedef long double dbl; typedef long long ll; const int MAXN = 2e5 + 5; int n; pii pt[MAXN]; dbl twoInv[111]; int gcd(int a, int b) { while (b) { a %= b; swap(a, b); } return a; } int...
C++
26506591fc15f23b0436473cd2712166
f8eefffc120205a52011c0af37daf0ba
2,800
PASSED
//pick���� 2s=2a+b-1 s��� a�ڸ�� b�߸�� //����ת�� //ֻö��һЩ������ #include <bits/stdc++.h> #define LL long long #define LB long double using namespace std; template<typename T>void read(T &x){ x=0;int f=1; char c=getchar(); for(;!isdigit(c);c=getchar()) if(c=='-') f=-1; for(;isdigit(c);c=getchar()) x=x*10+c-48; x*=...
C++
26506591fc15f23b0436473cd2712166
4d22058800bc878d0d6ed9b078258116
2,800
PASSED
#include<stdio.h> #include<iostream> #include<math.h> #include<algorithm> #include<iomanip> using namespace std; int N,x[100100],y[100100]; long long bd[100100], ar[100100]; long long Bd[100100], Ar[100100]; long long absx(long long x) { if(x<0) return -x; return x; } int absx(int x) { if(x<0) return -x; ...
C++
26506591fc15f23b0436473cd2712166
a27b96ef58d6d7ebee707226e34aa42e
2,800
PASSED
//#define DEBUG //#define USEPB_DS #define USETR1 #define CPPELEVEN #define GPP /* * 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 ...
C++
26506591fc15f23b0436473cd2712166
a06d1a090c5a31762e32ee4362f37eb1
2,800
PASSED
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n);i++) #define rep1(i,n) for(int i=1;i<=(int)(n);i++) #define all(c) c.begin(),c.end() #define pb push_back #define fs first #define sc second #define show(x) cout << #x << " = " << x << endl #define chmin(x,y) x=min(x,y) #define chmax(x,y) x=max(x,y) using...
C++
26506591fc15f23b0436473cd2712166
199c99312dfbebd90f3d0de12c20b636
2,800
PASSED
/* */ //#pragma comment(linker, "/STACK:16777216") #include <fstream> #include <iostream> #include <string> #include <complex> #include <math.h> #include <set> #include <vector> #include <map> #include <queue> #include <stdio.h> #include <stack> #include <algorithm> #include <list> #include <ctime> #include <memory...
C++
26506591fc15f23b0436473cd2712166
3d682b445849ba9cda89c31ab9b57c42
2,800
PASSED
/* All the tension in the world today All the little girls fillin up the world today When the good comes to bad the bad comes to good But I'm a live my life like I should Now all the critics want to hit it To Shit can how we did it Just Because they don't get it But I'll stay fitted New era committed Now this red cap ...
C++
26506591fc15f23b0436473cd2712166
f09b31d23194ad2946a2fc9b8dc2986c
2,800
PASSED
#include <bits/stdc++.h> using namespace std; long long a[1000004]; int main() { long long n,m,sum=0,k,x,y,xx=0,rr; cin>>n>>m>>k; rr=n*m; cin>>a[1]; int yyy=a[1]%k; for(int i=2;i<=rr;i++) { cin>>a[i]; if(a[i]%k!=yyy) { cout<<-1; ...
C++
3488bb49de69c0c17ea0439e71b1e6ae
4087b15c90f783f4afdbb11a20f99b70
1,400
PASSED
//289B #include <vector> #include <iostream> #include <algorithm> #include <cstdio> //#define M (1<<9+7) using namespace std; //nt v[(1<<4)+1]={0}; int main() { //freopen("file.txt","r",stdin); int n,m,d; cin>>n>>m>>d; vector<int> v(n*m); int count1=0; for(int i=0;i<n*m;i++) cin>>v[i]; sort(v.begin()...
C++
3488bb49de69c0c17ea0439e71b1e6ae
2aa6228bff72e8ed7e9051a3c1a3409e
1,400
PASSED
#include<iostream> #include<cstdio> #include<algorithm> #include<cstdlib> using namespace std; int n,m,d,ans=0,a[10005],k=0,f; int main(){ scanf("%d%d%d",&n,&m,&d); m=m*n; cin>>a[0]; f=a[0]%d; for(int i=1;i<m;i++){ scanf("%d",&a[i]); if(a[i]%d!=f){ cout<<"-1"<<endl; ...
C++
3488bb49de69c0c17ea0439e71b1e6ae
f42bdef96e1e43d6598caef7b11c6122
1,400
PASSED
#include<stdio.h> #include<iostream> #include<math.h> #include<algorithm> #include<string.h> #include<map> #include<vector> #include<queue> using namespace std; const int INF=1000000000; int z,n,m,i,j,k,l,r=INF,c=0,v=0,u=0; vector<int>g,g2; main() { scanf ("%d%d%d",&n,&m,&k); for (i=1;i<=n;i++) ...
C++
3488bb49de69c0c17ea0439e71b1e6ae
d6b78b101a6bdf540551a48a857255b2
1,400
PASSED
#include <bits/stdc++.h> using namespace std; int main(int argc, char const *argv[]) { int n, m, d; cin>>n>>m>>d; int k = m*n; int a[k]; for (int i = 0; i < k; ++i) { cin>>a[i]; } sort(a, a+k); int check = a[0]%d; for (int i = 0; i < k; ++i) { if(a[i]%d != c...
C++
3488bb49de69c0c17ea0439e71b1e6ae
c4b6f3fdc098d424230a4c1cc1b1ccb4
1,400
PASSED
#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { int n,m,d,p,f=0,r; long long int sum,s2; cin>>n>>m>>d; int a[100000],b[100000]; r=m*n; m=1000000; int flag=0; for(int i=0;i<r;i++){ cin>>a[i]; if(f==0){ f=1; p=a[i]%d; } if(p!=a[i]%d){ flag=1; } ...
C++
3488bb49de69c0c17ea0439e71b1e6ae
5368db658a7a9639352a2556b4ef950b
1,400
PASSED
#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { int n,m,d,p,f,r; long long int sum,s2; cin>>n>>m>>d; int a[100000],b[100000]; r=m*n; m=1000000; int flag=0; for(int i=0;i<r;i++){ cin>>a[i]; } for(int i=0;i<r;i++){ if((a[i]-a[0])%d!=0){ cout<<-1; return 0...
C++
3488bb49de69c0c17ea0439e71b1e6ae
a15932ea21f6c0bf40e77f59bae6247e
1,400
PASSED
#include <cstdio> #include <algorithm> using namespace std; #define MAXN 10005 int n,m,d,ans; int ar[MAXN]; int main() { scanf("%d%d%d",&n,&m,&d); n*=m; for(int i=0; i<n; i++) scanf("%d",&ar[i]); sort(ar,ar+n); int mid=n/2; for(int i=0; i<n; i++) { if((ar[mid]-ar[i])%d!=...
C++
3488bb49de69c0c17ea0439e71b1e6ae
577c4a9a8eea58727acd6d8a04562938
1,400
PASSED
#include <iostream> #include <string> #include <algorithm> using namespace std; int main() { int n,m,d,p,f,r; long long int sum,s2; cin>>n>>m>>d; int a[100000],b[100000]; r=m*n; m=1000000; int flag=0; for(int i=0;i<r;i++){ cin>>a[i]; } for(int i=0;i<r;i++){ if((a[i]-a[0])%d!=0){ cout<<-1; return 0...
C++
3488bb49de69c0c17ea0439e71b1e6ae
cbd2c54f55c695a7ad2e850a8dbffe70
1,400
PASSED
#include<cstdio> #include<algorithm> using namespace std; inline int abs(int x) { if(x<0) return (-x); else return x; } int main() { int A[101][101],B[10001],n,m,d,i,j,k=0,even=0,odd=0,min=10001,ans=0,mid; scanf("%d%d%d",&n,&m,&d); for(i=0;i<n;++i) for(j=0;j<m;++j) { ...
C++
3488bb49de69c0c17ea0439e71b1e6ae
723d0e3efe891fd711cf19ee2eafdac6
1,400
PASSED
/* practice with Dukkha */ #include <stdio.h> #include <string.h> #define N 1000001 #define MD 998244353 int min(int a, int b) { return a < b ? a : b; } void zzz(char *cc, int n, int *zz) { int i, l, r; for (i = 1, l = r = 0; i < n; i++) if (i + zz[i - l] < r) zz[i] = zz[i - l]; else { l = i; if (r <...
C
0d212ea4fc9f03fdd682289fca9b517e
164465db3c1b11861cac17b14b8712b7
2,600
PASSED
// ---------- begin ModInt ---------- const MOD: u32 = 998_244_353; #[derive(Clone, Copy)] struct ModInt(u32); impl std::ops::Add for ModInt { type Output = ModInt; fn add(self, rhs: ModInt) -> Self::Output { let mut d = self.0 + rhs.0; if d >= MOD { d -= MOD; } Mod...
Rust
0d212ea4fc9f03fdd682289fca9b517e
c03461bac285bec7ea6cb1e0ca0e6b3b
2,600
PASSED
#![allow(unused_variables)] #![allow(unused_must_use)] use std::io::{self, prelude::*}; fn solve<R: BufRead, W: Write>(mut input: FastInput<R>, mut w: W) { const MOD: i64 = 998244353; let a: Vec<u8> = input.token(); let l: Vec<u8> = input.token(); let r: Vec<u8> = input.token(); let zl = { ...
Rust
0d212ea4fc9f03fdd682289fca9b517e
45e8ce9e6b2b0491824edd7d63abd25b
2,600
PASSED
def kmp(pat,text,t): s=pat+"?"+text; #z[i] es el tamaño del prefijo mas largo de, formado por una subcadena s[i:...] z=[0 for i in range(len(s))] L=0;R=0;n=len(s); for i in range(1,len(s)): if i>R: L=R=i while R<n and s[R-L]==s[R]: R+=1 z[i...
Python
0d212ea4fc9f03fdd682289fca9b517e
8fa49b400f05cc20ce305f47184cd1c2
2,600
PASSED
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHelper...
Java
0d212ea4fc9f03fdd682289fca9b517e
a927e3af5f7f5fe128260f24d34910d0
2,600
PASSED
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; import java.util.StringTokenizer; public class dk { static int mod = 998244353; public static void main(String[] args) throws NumberFormatExce...
Java
0d212ea4fc9f03fdd682289fca9b517e
26114dc70624b09dbece8c25b13c3157
2,600
PASSED
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.function.IntUnaryOperator; import java.io.IOException; import java.io.UncheckedIOException; import java.io.Closeable; import java.io.Writer; import java.io.OutputStreamWriter; import java.i...
Java
0d212ea4fc9f03fdd682289fca9b517e
de4eb1221df44583abe17f6ba700c03c
2,600
PASSED
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.Arrays; import java.util.function.IntUnaryOperator; import java.io.IOException; import java.io.UncheckedIOException; import java.io.Closeable; import java.io.Writer; import java.io.OutputSt...
Java
0d212ea4fc9f03fdd682289fca9b517e
9eab162752d37d9d7b4b4bca1ed32086
2,600
PASSED
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.stream.IntStream; import java.io.IOException; import java.io.UncheckedIOException; import java.io.Closeable; import java.io.Writer; import java.io.OutputStreamWriter; import java.io.InputSt...
Java
0d212ea4fc9f03fdd682289fca9b517e
244f6c3a53b9851765ad41a8114b4eea
2,600
PASSED
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHelper plug-in * Actual soluti...
Java
0d212ea4fc9f03fdd682289fca9b517e
2dd5b8b3593f03c9f427eb32ec2b7328
2,600
PASSED
#include <iostream> #include <fstream> #include <sstream> #include <cstdlib> #include <cstdio> #include <cmath> #include <string> #include <cstring> #include <algorithm> #include <queue> #include <stack> #include <vector> #include <set> #include <map> #include <list> #include <iomanip> #include <cctype> #include <casse...
C++
6f26747e5ed41d6eb1bfcef48a2dc46d
86466bc6504881623157fe91a94f91d6
2,100
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int Maxm = 1000005; const ll Inf = 9000000000000000000ll; int n, m, k; bool block[Maxm]; int sum[Maxm]; int a[Maxm]; int main() { scanf("%d %d %d", &n, &m, &k); for(int i = 1; i <= m; i++) { int x; scanf("%d", &x); b...
C++
6f26747e5ed41d6eb1bfcef48a2dc46d
0ef9560214f1e95698b1d4e0e7fac310
2,100
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int Maxm = 1000005; const ll Inf = 9000000000000000000ll; int n, m, k; bool block[Maxm]; int cnt[Maxm]; int a[Maxm]; int main() { scanf("%d %d %d", &n, &m, &k); for (int i = 0; i < m; i++) { int a; scanf("%d", &a); block[a] = true; } i...
C++
6f26747e5ed41d6eb1bfcef48a2dc46d
e845f4b67713257e5ca6adab6c49a645
2,100
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int Maxm = 1000005; const ll Inf = 9000000000000000000ll; int n, m, k; bool block[Maxm]; int cnt[Maxm]; int a[Maxm]; ll res = Inf; int main() { scanf("%d %d %d", &n, &m, &k); for (int i = 0; i < m; i++) { int a; scanf("%d", &a); block[a...
C++
6f26747e5ed41d6eb1bfcef48a2dc46d
fe7b4e475679d56e6a7b5c3bacc9a9bd
2,100
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int Maxm = 1000005; const ll Inf = 9000000000000000000ll; int n, m, k; bool block[Maxm]; int cnt[Maxm]; int a[Maxm]; ll res = Inf; int main() { scanf("%d %d %d", &n, &m, &k); for (int i = 0; i < m; i++) { int a; scanf("%d", &a); block[a...
C++
6f26747e5ed41d6eb1bfcef48a2dc46d
87f32893cf01d840041cbd055576c648
2,100
PASSED
#include<bits/stdc++.h> using namespace std; const int N = 1e6 + 3; bool block[N]; int a[N], sum[N]; int n, m, k; typedef long long ll; int mx = 0, cnt = 0; int main() { scanf("%d %d %d", &n, &m, &k); for(int i = 1; i <= m; i++) { int x; scanf("%d", &x); block[x] = true; } int mx = 0; for ...
C++
6f26747e5ed41d6eb1bfcef48a2dc46d
917f34fe542525d26091826eced98983
2,100
PASSED
#include<bits/stdc++.h> using namespace std; const int N = 1e6 + 3; bool block[N]; int a[N], sum[N]; int n, m, k; typedef long long ll; int mx = 0, cnt = 0; int main(){ scanf("%d%d%d", &n, &m, &k); for(int i = 1; i <= m; i++) { int x; scanf("%d", &x); block[x] = true; } for(int i = 1; i < n...
C++
6f26747e5ed41d6eb1bfcef48a2dc46d
e349453c697de731b3fe88d96b89f6e4
2,100
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main () { int n, m, k; cin >> n >> m >> k; vector<bool>blocked(n + 1, false); //cout <<"cp-1" << endl; for (int i = 0; i < m; ++i) { int loc; scanf("%d", &loc); if (loc == 0) { cout << ...
C++
6f26747e5ed41d6eb1bfcef48a2dc46d
684a7bdd3007d7e5c71f5d83d4b97eae
2,100
PASSED
/*بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيم*/ #include <bits/stdc++.h> #include <stdio.h> #include <iostream> #include <climits> #include <map> #include <cmath> #include <algorithm> #include <set> #include <stack> #include <deque> #include <vector> #include <stdlib.h> #include <string> #include <string.h> #include <utility...
C++
6f26747e5ed41d6eb1bfcef48a2dc46d
dde5aec60f0e8601d01674f0a487b19d
2,100
PASSED
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define ALL(a) (a.begin()),(a.end()) #define ZER...
C++
6f26747e5ed41d6eb1bfcef48a2dc46d
42f11577678f6a053c152db894dcb7e3
2,100
PASSED
#include <bits/stdc++.h> #define abdelrahman001 ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define F first #define S second #define inFile(t) freopen((t),"r",stdin) #define outFile(t) freopen((t),"w",stdout) #define pb push_back #define pf push_front #define Pb pop_back #define all(v) (v).begin(),(v).end() #d...
C++
ace9fbabc2eda81b4e4adf4f2d5ad402
457f08d2a5bcfc67544b2fb753bc0d7a
1,700
PASSED
#include<iostream> using namespace std; int main() { int v,i,min=100001,num; cin>>v; int a[9]; for(i=0;i<9;i++) { cin>>a[i]; if(a[i]<min) min=a[i]; } num=v/min; if(num==0) cout<<"-1"<<endl; int temp=v; while(num!=0) { for(i=8;i>=0;i--) { if(temp>=a[i] ...
C++
ace9fbabc2eda81b4e4adf4f2d5ad402
eb7e278e5233fc10c9e2c44cfa87a26a
1,700
PASSED
#include <iostream> #include <cstdio> using namespace std; int main() { int n ; int a[10] ; while(~scanf("%d",&n)) { int minn = 1000010 ; for(int i = 0 ; i < 9 ; ++i ) { scanf("%d",&a[i]) ; if( a[i] < minn ) minn = a[i] ; } int num ...
C++
ace9fbabc2eda81b4e4adf4f2d5ad402
dd0b24c7ad1017fae05200552083c6a0
1,700
PASSED
#pragma GCC optimize("Ofast") #include<bits/stdc++.h> #define l(i,a,b) for(auto i=a;i<b;i++) #define lr(i,a,b) for(auto i=a;i>=b;i--) #define ll long long #define lli long long int #define ld long double #define vec vector<int> #define mii map<int,int> #define vl vector<long long> #define se set <long long int> #defi...
C++
ace9fbabc2eda81b4e4adf4f2d5ad402
e7ced75466df10bcdd88fc97d566c0c8
1,700
PASSED
#pragma GCC optimize("Ofast") #include<bits/stdc++.h> #define l(i,a,b) for(auto i=a;i<b;i++) #define lr(i,a,b) for(auto i=a;i>=b;i--) #define ll long long #define lli long long int #define ld long double #define vec vector<int> #define mii map<int,int> #define vl vector<long long> #define se set <long long int> #defi...
C++
ace9fbabc2eda81b4e4adf4f2d5ad402
14d85c4780ed12077ed2a3aab5f94493
1,700
PASSED
#include <bits/stdc++.h> using namespace std; int a[10], f[1000007], v; void nhap() { //freopen("test.txt","r",stdin); cin >> v; for (int i = 1; i <= 9; ++i) cin >> a[i], f[a[i]] = 1; } void dp() { int _max = 0; for (int i = 1; i <= v; ++i) for (int j = 1; j <= 9; ++j) { ...
C++
ace9fbabc2eda81b4e4adf4f2d5ad402
7416a85f8d641e6d524bce65b6ccea00
1,700
PASSED
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef tree<pair<int, int>,null_type,less<pair<int, int>>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; //#define int long long #define ll ...
C++
ace9fbabc2eda81b4e4adf4f2d5ad402
058690f5d3ff5d9d460bef8c003642c5
1,700
PASSED
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef tree<pair<int, int>,null_type,less<pair<int, int>>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; //#define int long long #define ll ...
C++
ace9fbabc2eda81b4e4adf4f2d5ad402
173a9e757122aafae9c885a0f72c4539
1,700
PASSED
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; typedef tree<pair<int, int>,null_type,less<pair<int, int>>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; #define int long long #define ll ...
C++
ace9fbabc2eda81b4e4adf4f2d5ad402
e0b3111eb5a68b17aa3ddaf749edad2e
1,700
PASSED
#include <stdio.h> #include <string.h> #include <algorithm> #include<iostream> using namespace std; int main(){ int sum,a[10]; while(~scanf("%d",&sum)){ int minn=1e9,k=0; for(int i=1;i<=9;i++){ cin>>a[i]; if(minn>=a[i]){ minn=a[i]; if(k<i) k=i; } } int cnt=sum/minn; int r=sum%minn; ...
C++
ace9fbabc2eda81b4e4adf4f2d5ad402
5423b8c2716e542cb55645820d6c3050
1,700
PASSED
#include<bits/stdc++.h> #include<time.h> #include<stdlib.h> #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse4") #define pb push_back #define mp make_pair #define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define ll long long #define pll pair<ll,ll> #define vll ve...
C++
6dafebcc521b7523427724753187715a
123a5b47bcb5771eec6333e81f95fc30
1,600
PASSED
#include <bits/stdc++.h> #define ll long long #define pb push_back #define mod 1000000007 #define F first #define S second #define all(v) (v).begin(),(v).end() #define np next_permutation using namespace std; using vi=vector<int>; #define lp(i,n) for(int i=0;i<n;i++) #define lps(i,j,n) for(int i=j;i<n;i++) #define vii ...
C++
6dafebcc521b7523427724753187715a
a7abce890758ba55fa2d25e673535063
1,600
PASSED
//In the name of ALLAH #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 pair<ll, ll> pll; typedef vector<pii> vii; typedef vector<pll> ...
C++
6dafebcc521b7523427724753187715a
ea58faa7e342dc2af049df8dbec9b3ca
1,600
PASSED
//In the name of ALLAH #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 pair<ll, ll> pll; typedef vector<pii> vii; typedef vector<pll> ...
C++
6dafebcc521b7523427724753187715a
dd47396660052c3e37c5330d6418e55e
1,600
PASSED
//In the name of ALLAH #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 pair<ll, ll> pll; typedef vector<pii> vii; typedef vector<pll> ...
C++
6dafebcc521b7523427724753187715a
7ec648008faf114e11c74714c538962e
1,600
PASSED