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> #define yes puts("yes"); #define inf 0x3f3f3f3f #define ll long long #define linf 0x3f3f3f3f3f3f3f3f #define debug(x) cout<<"> "<< x<<endl; #define ull unsigned long long #define endl '\n' #define lowbit(x) x&-x //#define int long long using namespace std; typedef pair<int,int> PII; ...
C++
4c69abbf5bab5d01d6fb6b4316900026
37dec854f6f78354a5922005fd69e02f
2,500
PASSED
#include <bits/stdc++.h> #define yes puts("yes"); #define inf 0x3f3f3f3f #define ll long long #define linf 0x3f3f3f3f3f3f3f3f #define debug(x) cout<<"> "<< x<<endl; #define ull unsigned long long #define endl '\n' #define lowbit(x) x&-x //#define int long long using namespace std; typedef pair<int,int> PII; ...
C++
4c69abbf5bab5d01d6fb6b4316900026
d7f9dd62033d7ca597bcb89bd723dc71
2,500
PASSED
#include <bits/stdc++.h> #define yes puts("yes"); #define inf 0x3f3f3f3f #define ll long long #define linf 0x3f3f3f3f3f3f3f3f #define debug(x) cout<<"> "<< x<<endl; #define ull unsigned long long #define endl '\n' #define lowbit(x) x&-x //#define int long long using namespace std; typedef pair<int,int> PII; ...
C++
4c69abbf5bab5d01d6fb6b4316900026
ba34a340359c244e6b1a198a74817abd
2,500
PASSED
#include<bits/stdc++.h> using namespace std; #define read(x) scanf("%d",&x) #define ll long long #define maxn ((int)1e6+5) int n,m; set<int> a[maxn*2+5]; int slv() { int s=0; for(int i=1;i<=n+m;i++) { if(a[i+1].empty()) continue; ++s; int nw=i; for(int j=1;j<=n;j++) { a[nw+j].erase(j); ...
C++
4c69abbf5bab5d01d6fb6b4316900026
bf52b892670acf65645d7254576b2e7d
2,500
PASSED
//#pragma GCC optimize("O3","unroll-loops") //#pragma GCC target("avx","avx2") #include<bits/stdc++.h> #ifdef LOCAL #include<debug.h> #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__) #else #define debug(...) #endif using namespace std; #define ll int64_t #define sz(x) (int)(x).size() m...
C++
4c69abbf5bab5d01d6fb6b4316900026
f612ec852766e095acc130ac433f3c35
2,500
PASSED
//#pragma GCC optimize("O3","unroll-loops") //#pragma GCC target("avx","avx2") #include<bits/stdc++.h> #ifdef LOCAL #include<debug.h> #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__) #else #define debug(...) #endif using namespace std; #define ll int64_t #define sz(x) (int)(x).size() ...
C++
4c69abbf5bab5d01d6fb6b4316900026
812083c9747b00c9c96a5d48a0e00943
2,500
PASSED
#include<iostream> #include<cstring> #define ll long long using namespace std; int v[10000]; int main(){ int t; cin>>t; while(t--){ char a[101]; cin>>a; int l=strlen(a); if(l%2!=0)cout<<"NO"<<endl; else if(l%2==0){ int k=l/2; int ret=0; for(int i=0;i<l/2;i++){ if(a[i]!=a[k++]){ ret=1; ...
C++
9640b7197bd7b8a59f29aecf104291e1
f58d519a2bafa92ef60d2003209832b9
800
PASSED
#include<iostream> #include<string> using namespace std; int main(){ int t = 0; cin >> t; string str, str1, str2; for(int i =0; i <t ; i++){ cin>> str; if(str.size() %2 == 1){ cout<<"NO"<< endl; } else if(str.size()% 2 == 0){ str1 = str.substr(0,st...
C++
9640b7197bd7b8a59f29aecf104291e1
d6786f3842e47455bb7fc36514a79be9
800
PASSED
#include <bits/stdc++.h> using namespace std; int main(){ int casos; cin >> casos; //CICLO for(int i=0;i<casos;i++){ string letras; cin >> letras; int tamano = letras.size(); if(tamano%2==0){ int tamano_cadena = tamano/2; string cadena1; string cadena2; cadena1=letras.substr(0,tamano_cadena); ...
C++
9640b7197bd7b8a59f29aecf104291e1
28692c83d3d105be62942e54dab1c80e
800
PASSED
#include <bits/stdc++.h> using namespace std; int main(){ int t; string s,a,b; cin>>t; while(t--){ cin>>s; int len=s.size(); if(len%2==0){ a=s.substr(0,len/2); b=s.substr(len/2,len/2); if(a == b){ cout<<"YES\n"; }else{...
C++
9640b7197bd7b8a59f29aecf104291e1
776c043210bee9c1782d825a51345c5c
800
PASSED
#include<bits/stdc++.h> using namespace std; void solve() { string s; cin >> s; if(s.size()%2 == 0){ for(int i=0; i<s.size()/2; i++){ if(s[i] != s[i+s.size()/2]){ cout << "NO" << '\n'; return; } } cout << "YES" << '\n'; } ...
C++
9640b7197bd7b8a59f29aecf104291e1
007ec1ce39acc8c9e6ec6e4a28e01998
800
PASSED
#include<bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { string s; cin>>s; int len = s.length(); if(len % 2) cout<<"NO"<<endl; else{ if(s.substr(0,len/2)==s.substr(len/2,len)) cout<<"YES"<<endl; els...
C++
9640b7197bd7b8a59f29aecf104291e1
46d6d61106ec00a01ffd745fc46555ae
800
PASSED
#include <stdio.h> #include<string.h> int main() { int t,x,i,y,flag=0,j; char a[100]; scanf("%d",&t); if(t>=1 && t<=100) { for(j=1;j<=t;j++) { scanf("%s",a); x = strlen(a); if(x%2==0) { y = x/2; for(i=0;i<...
C++
9640b7197bd7b8a59f29aecf104291e1
9561d8b9949a23d4ebfe386deaf0c020
800
PASSED
#include <iostream> using namespace std; int main(){ long t; std::cin >> t; while(t--){ string s; std::cin >> s; if(s.size() % 2) { cout << "NO" <<endl; continue; } long h = s.size() / 2; bool sq(true); for(long p = 0; p < h; p++...
C++
9640b7197bd7b8a59f29aecf104291e1
446693d115c4446fcacf912b5b429121
800
PASSED
#include <iostream> #include<bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" #define sz(s) (int)s.size() // vector<vector<char>>a(n, vector<char>(n)); // freopen("in.txt", "r", stdin); void faster() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } int m...
C++
9640b7197bd7b8a59f29aecf104291e1
46d217274a7e9645a6cd618758b1fc24
800
PASSED
#include <iostream> #include <cstring> #include <vector> using namespace std; //普素 int main() { string s; int t; cin >> t; while (t--) { int a = 0; cin >> s; for (int i = 1; i <= s.size(); i++) { string s1(s, 0, i); string s2(s, i); if (s1 == s2) { a = 1; break; } } if (a == 1) cou...
C++
9640b7197bd7b8a59f29aecf104291e1
7be7d4c3e4144ca84c819e5793be36c3
800
PASSED
#include <bits/stdc++.h> #define ios ios::sync_with_stdio(0) using namespace std; const int N = 234567; #define ll long long ll t, n, m, sum; ll st[N], l; int main() { // 这题主要是巧妙的用栈。。 // 栈就是最近放进去的那个就是最优解。。 // 然后就是i-1 的继承 ios; cin >> t; while (t--) { cin >> n; ...
C++
18d19440e6df7316af0682ce99911738
1ee1746850488aebd3a2f81fcf2961bf
1,700
PASSED
#include <bits/stdc++.h> #define ios ios::sync_with_stdio(0) using namespace std; const int N = 234567; #define ll long long ll t, n, m, sum; ll st[N], l; int main() { // 这题就是 要算操作数。。让当前这个数字成为第一个确实数值的操作数 // 1 首先0-i-1 必须都要有。 // 然后再加上当前数字的个数 就是当前需要的操作数 ios; cin >> t; while (t--) ...
C++
18d19440e6df7316af0682ce99911738
59919af1cf27cd161f6e566557d55ea2
1,700
PASSED
#include <bits/stdc++.h> #define ios ios::sync_with_stdio(0) using namespace std; const int N = 234567; #define ll long long ll t, n, m; ll st[N], l; int main() { ios; cin >> t; while (t--) { cin >> n; ll tmp, sum = 0; l = 0; vector<ll> cnt(n + 1); ...
C++
18d19440e6df7316af0682ce99911738
3548b6494ab759dcd8e18ea62dafd165
1,700
PASSED
#include <bits/stdc++.h> #define ios ios::sync_with_stdio(0) using namespace std; const int N = 234567; #define ll long long ll t, n, m, sum, tmp; ll st[N], l; void init() { sum = 0, l = 0; }; int main() { ios; cin >> t; while (t--) { cin >> n; init(); ve...
C++
18d19440e6df7316af0682ce99911738
d719c0b0c0cf2e128d35c94dff54fdcf
1,700
PASSED
#include <bits/stdc++.h> #define ios ios::sync_with_stdio(0) using namespace std; const int N = 234567; #define ll long long ll t, n, m, sum, tmp; ll st[N], l; void init() { sum = 0, tmp = 0, l = 0; }; int main() { ios; cin >> t; while (t--) { init(); cin >> n; ...
C++
18d19440e6df7316af0682ce99911738
0d541c79f48a8c184f3f51a0cf35dd76
1,700
PASSED
#include <bits/stdc++.h> #define ios ios::sync_with_stdio(0) using namespace std; const int N = 234567; #define ll long long ll t, n, m; ll st[N], l; int main() { ios; cin >> t; while (t--) { cin >> n; ll sum = 0, tmp; l = 0; vector<ll> cnt(n + 1); ...
C++
18d19440e6df7316af0682ce99911738
99638721cc9d60e63bc002f4f4c92824
1,700
PASSED
#include <bits/stdc++.h> #define ios ios::sync_with_stdio(0) using namespace std; const int N = 234567; #define ll long long ll t, n, m, sum, tmp; ll cnt[N], st[N], l; int main() { ios; cin >> t; while (t--) { cin >> n; sum = 0, l = 0; for (int i = 0; i < n; ++i)...
C++
18d19440e6df7316af0682ce99911738
de481ebbacd72b531fc9e50f2fda0848
1,700
PASSED
#include <bits/stdc++.h> #define ios ios::sync_with_stdio(0) using namespace std; const int N = 234567; #define ll long long ll t, n, m, sum, tmp; ll cnt[N], ans[N], st[N], l = 0; int main() { ios; cin >> t; while (t--) { cin >> n; for (int i = 0; i < n; ++i) ...
C++
18d19440e6df7316af0682ce99911738
216e3790e96af2bcde2e509a98f08ecc
1,700
PASSED
#include <bits/stdc++.h> #define ios ios::sync_with_stdio(0) using namespace std; const int N = 234567; #define ll long long ll t, n, m; int main() { ios; cin >> t; while (t--) { cin >> n; vector<ll> ans(n + 1, -1), cnt(n + 1); stack<ll> st; ll tmp; ...
C++
18d19440e6df7316af0682ce99911738
49b4b2ed2a2f5c6b7c690d7f137b99f8
1,700
PASSED
#include <bits/stdc++.h> #define ios ios::sync_with_stdio(0) using namespace std; const int N = 234567; #define ll long long ll t, n, m; int main() { ios; cin >> t; while (t--) { cin >> n; ll tmp; vector<ll> ans(n + 1, -1), cnt(n + 1); for (int i = 0; i <...
C++
18d19440e6df7316af0682ce99911738
81d201bfa25eb0c2159c7a763b1db154
1,700
PASSED
#include<iostream> #include<vector> using namespace std; const int N = 100102; long long m,n; bool st[N]; bool check(long long mid,vector<vector<long long>> &x) { bool flag1=0; for(int i=0;i<m;i++)st[i]=false; for(int i =0;i<n;i++) { bool flag=0; for(int j=0;j<m;j++) { if(x[j][i]>=mid) ...
C++
5f8916876c2889cfe9265cd71905ad99
9d70cf7b5cc4ab12f6b9a324bfdb6e6a
1,800
PASSED
#include<iostream> #include<vector> using namespace std; const int N = 100102; long long m,n; bool st[N]; bool check(long long mid,vector<vector<long long>> &x) { bool flag1=0; for(int i=0;i<m;i++)st[i]=false; for(int i =0;i<n;i++) { bool flag=0; for(int j=0;j<m;j++) { if(x[j][i]>=mid) ...
C++
5f8916876c2889cfe9265cd71905ad99
7aeb1bc0a32aaeeb3283b36af0f24a47
1,800
PASSED
#include<iostream> #include<vector> using namespace std; const int N = 100011; long long m,n; bool st[N]; bool check(long long mid,vector<vector<long long>> &x) { bool flag1=0; for(int i=0;i<m;i++)st[i]=false; for(int i =0;i<n;i++) { bool flag=0; for(int j=0;j<m;j++) { if(x[j][i]>=mid) ...
C++
5f8916876c2889cfe9265cd71905ad99
11b50407f23523dcbc9dfcb9d4cbf620
1,800
PASSED
#include<iostream> #include<vector> using namespace std; const int N = 1e5+11; long long m,n; bool st[N]; bool check(long long mid,vector<vector<long long>> &x) { bool flag1=0; for(int i=0;i<m;i++)st[i]=false; for(int i =0;i<n;i++) { bool flag=0; for(int j=0;j<m;j++) { if(x[j][i]>=mid) ...
C++
5f8916876c2889cfe9265cd71905ad99
f71f8e7655308e92b2e85a7a1c8c02e3
1,800
PASSED
#include<iostream> #include<vector> using namespace std; const int N = 1e5+10; long long m,n; bool st[N]; bool check(long long mid,vector<vector<long long>> &x) { bool flag1=0; for(int i=0;i<m;i++)st[i]=false; for(int i =0;i<n;i++) { bool flag=0; for(int j=0;j<m;j++) { if(x[j][i]>=mid) ...
C++
5f8916876c2889cfe9265cd71905ad99
fab93fd63aa7c03b8dacde09f598efbb
1,800
PASSED
#include <bits/stdc++.h> using namespace std; const int N = 1e5+10; long long m,n; bool st[N]; bool check(long long mid,vector<vector<long long>> &x) { bool flag1=0; for(int i=0;i<m;i++)st[i]=false; for(int i =0;i<n;i++) { bool flag=0; for(int j=0;j<m;j++) { if(x[j][i]>=mid) { if...
C++
5f8916876c2889cfe9265cd71905ad99
8c3f1d1a2144e5d93895fb619e12ab2b
1,800
PASSED
#include <bits/stdc++.h> using namespace std; const int N = 1e5 + 10; int m, n ; bool st[N]; bool check(int mid, vector<vector<int>> &s) { bool w1 = false; for(int i=0;i<=m-1;i++) st[i] = false; for(int j=0;j<=n-1;j++) { bool w2 = false; for(int i=0;i<=m - 1;i++) { if (s[i][j] >= mid) { if (...
C++
5f8916876c2889cfe9265cd71905ad99
942ce95c1e3b73c76c8433639ae00190
1,800
PASSED
#include "iostream" #include "vector" #include "cmath" using namespace std; int Search(vector<vector<int>> arr, int EX) { return 0; } int main() { int t; cin >> t; while (t--) { int m, n; cin >> m >> n; vector<vector<int>> arr(m, vector<int>(n)); for (int i = 0; i...
C++
5f8916876c2889cfe9265cd71905ad99
83e2ac13a6a234aeac49f24f55caedb4
1,800
PASSED
#include<bits/stdc++.h> using namespace std; const int N = 100010; int b[N],c[N],d[N]; int n,m,k,T,x,y; vector<int> p[N]; int main(){ cin>>T; while(T--){ cin>>m>>n; int ans=0; for(int i=0;i<m;i++) p[i].clear(); int Max[N]={0},Min=0; for(int i=0;i<m;i++) for(in...
C++
5f8916876c2889cfe9265cd71905ad99
4e266b61e8fc37bacabd4d629b898efd
1,800
PASSED
#include<bits/stdc++.h> #define rep(i,a,b) for(i=a;i<=b;i++) #define per(i,a,b) for(i=a;i>=b;i--) #define ll long long using namespace std; const int N=1e5+10;// int m,n; //int a[N][N]; vector<vector<int> > a; bool b[N];//该列有无 bool check(int x){//1存在0不存在 memset(b,0,sizeof(b)); int i,j; bool ch1=0; int tot=0;//一排...
C++
5f8916876c2889cfe9265cd71905ad99
4eadeedf4874de6409298313f1cc67ed
1,800
PASSED
/* *********************************************** Author :Rescho Email :Rescho@qq.com Created Time :二 8/30 20:09:01 2022 File Name :c.cpp ************************************************ */ #include "iostream" #include "cmath" #include "set" #include "vector" #include "string" using namespace std; int main() { ...
C++
aa00fbde0b135addd2fdde0310e0377a
0abb8bf1e92216c2f09bed880a9d8dff
1,200
PASSED
#include <iostream> #include <string> #define ll long long using namespace std; ll t; string a, b = "", s; void make_string() { ll i = a.length() - 1; ll j = s.length() - 1; while (j >= 0 && i >= 0) { int dig_a = a[i] - '0'; int dig_s = s[j] - '0'; if (dig_a <= dig_s) { b = to_string(dig_s - dig_a) + b; ...
C++
aa00fbde0b135addd2fdde0310e0377a
e475f2a1b86061087063f4b97537a90c
1,200
PASSED
#include<stdio.h> #include<string.h> int main(){ long long t,i,pan; scanf("%lld",&t); while(t--){ long long i=0,j=0,k=0; char str1[10000],str2[10000],str3[10000]; scanf("%s %s",str1,str2); i=strlen(str1)-1; j=strlen(str2)-1; while(i>=0||j>=0) if(str2[j]>=str1[i]&&i>=0) str3[k++]=(str2[j--]-'0')-(str1[...
C++
aa00fbde0b135addd2fdde0310e0377a
2a582e637c0e4a936afea1d4e96183e6
1,200
PASSED
#include<bits/stdc++.h> using namespace std; #define int long long signed main() { int T; cin>>T; while(T--) { bool flag=1; int i=1; int a,s; int b=0; cin>>a>>s; while(1) { int si=s%10; int ai=a%10; s/=10; if(si>=ai)b=(si-ai)*i+b,i*=10; else if(s) { if(s%10!=1){flag=0;break;} ...
C++
aa00fbde0b135addd2fdde0310e0377a
966a1840e79331428e0cb26b91756653
1,200
PASSED
#include <bits/stdc++.h> using namespace std; #define ll long long const int N=50; ll num[N]; ll ans[N]; ll q[N]; void work(){ ll a,s; scanf("%lld%lld",&a,&s); int alen=0; while (a>0){ num[++alen]=a%10; a=a/10; } int slen=0; while (s>0){ ans[++slen]=s%10; s=s/10; } ll l=1,r=1,c=0; while (l<=alen){ i...
C++
aa00fbde0b135addd2fdde0310e0377a
a14d333a0f4d6db1b5cfcc0985917e07
1,200
PASSED
#include<bits/stdc++.h> using namespace std; int t; int main(){ cin>>t; while (t--) { long long a,s; cin>>a>>s; long long b[30],d[30],c[30]; memset(b,0,sizeof(b)); memset(c,0,sizeof(c)); memset(d,0,sizeof(d)); int n,m;n=m=0; while (a) { b[++n]=a%10; a/=10; } while (s) { d[++m]=s%10; s/...
C++
aa00fbde0b135addd2fdde0310e0377a
b349924d6f26a4029cfe01c16eb92bec
1,200
PASSED
#include <iostream> #include <cstring> #include <algorithm> #include <cstdio> #include <map> #include <cmath> using namespace std; const int N = 110; struct tj { int x,y; }node[N]; typedef long long LL; int main() { int T; cin>>T; while(T--) { string a,s; cin>>a>>s; string...
C++
aa00fbde0b135addd2fdde0310e0377a
4be27e06aec52ce281c45ba1f2392aea
1,200
PASSED
#include<stdio.h> int main() { int t; scanf("%d",&t); while(t--) { long long a,s,r,l,p,y=0; scanf("%lld%lld",&a,&s); long long ans=1,k=1; while(s) { r=s%10;l=a%10; if(l<=r) { p=r-l; }else{ p=r-l+10; s=s/10; if(s%10!=1) { ans=0; } } y=y+k*p;k=k*10; a=a/10;s...
C++
aa00fbde0b135addd2fdde0310e0377a
57a20ce4580728d2f956ab955e370314
1,200
PASSED
/**Bismillahir Rahmanir Rahim.**/ #include<bits/stdc++.h> using namespace std; typedef unsigned long long int ull; typedef long long int ll; typedef long double ld; #define Faster ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define pi acos(-1) #define te...
C++
aa00fbde0b135addd2fdde0310e0377a
8b6e57a1715be146fd8d9af1aaaf4c9d
1,200
PASSED
#include <iostream> #include <string> #include <cstring> #include <cmath> #include <algorithm> using namespace std; int main() { int t; cin >> t; for (int i = 0; i < t; ++i) { string x, y; int a[190] = {0}, b[190] = {0}; int c[190] = {0}; cin >> x >> y; int k = x.si...
C++
aa00fbde0b135addd2fdde0310e0377a
f3a586370d07ba9f48d84f7bc3ebe5a0
1,200
PASSED
#include <bits/stdc++.h> using namespace std; // clang-format off // template {{{ #define pb push_back #define eb emplace_back #define mp make_pair #define sz(x) int((x).size()) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define trav(a, x) for (auto &a : x) #define L1(u, ...) [&](...
C++
fbe031fe816692046fffe310fbc39f8d
d42ee6febef5f0e5ad97c945514b29a6
2,400
PASSED
#include <bits/stdc++.h> using namespace std; // clang-format off // template {{{ #define pb push_back #define eb emplace_back #define mp make_pair #define sz(x) int((x).size()) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define trav(a, x) for (auto &a : x) #define L1(u, ...) [&](...
C++
fbe031fe816692046fffe310fbc39f8d
724dfa5b1776e7a13d0950d6e2913c9d
2,400
PASSED
#include <bits/stdc++.h> using namespace std; // clang-format off // template {{{ #define pb push_back #define eb emplace_back #define mp make_pair #define sz(x) int((x).size()) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define trav(a, x) for (auto &a : x) #define L1(u, ...) [&](...
C++
fbe031fe816692046fffe310fbc39f8d
fe00b3764bbd3f228991396f1a993789
2,400
PASSED
#include <bits/stdc++.h> using namespace std; // clang-format off // template {{{ #define pb push_back #define eb emplace_back #define mp make_pair #define sz(x) int((x).size()) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define trav(a, x) for (auto &a : x) #define L1(u, ...) [&](...
C++
fbe031fe816692046fffe310fbc39f8d
baec42a4d77b245360e3d5477e5a6020
2,400
PASSED
#include <bits/stdc++.h> using namespace std; // clang-format off // template {{{ #define pb push_back #define eb emplace_back #define mp make_pair #define sz(x) int((x).size()) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define trav(a, x) for (auto &a : x) #define L1(u, ...) [&](...
C++
fbe031fe816692046fffe310fbc39f8d
097df7bb7eaf087b5bae15a83c6c8ced
2,400
PASSED
#include <bits/stdc++.h> using namespace std; // clang-format off // template {{{ #define pb push_back #define eb emplace_back #define mp make_pair #define sz(x) int((x).size()) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define trav(a, x) for (auto &a : x) #define L1(u, ...) [&](...
C++
fbe031fe816692046fffe310fbc39f8d
89925bb1b48eb9ba4c5414daeb0e16f1
2,400
PASSED
#include <bits/stdc++.h> using namespace std; // clang-format off // template {{{ #define pb push_back #define eb emplace_back #define mp make_pair #define sz(x) int((x).size()) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define trav(a, x) for (auto &a : x) #define L1(u, ...) [&](...
C++
fbe031fe816692046fffe310fbc39f8d
19fed5c032f59ea440ae59a28a644381
2,400
PASSED
#include <bits/stdc++.h> using namespace std; // clang-format off // template {{{ #define pb push_back #define eb emplace_back #define mp make_pair #define sz(x) int((x).size()) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define trav(a, x) for (auto &a : x) #define L1(u, ...) [&](...
C++
fbe031fe816692046fffe310fbc39f8d
64eece14f7d25301cd94dea1a54a279d
2,400
PASSED
#include <bits/stdc++.h> using namespace std; // clang-format off // template {{{ #define pb push_back #define eb emplace_back #define mp make_pair #define sz(x) int((x).size()) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define trav(a, x) for (auto &a : x) #define L1(u, ...) [&](...
C++
fbe031fe816692046fffe310fbc39f8d
168a6595b83c365bee6a218280a5404a
2,400
PASSED
#include <bits/stdc++.h> using namespace std; // clang-format off // template {{{ #define pb push_back #define eb emplace_back #define mp make_pair #define sz(x) int((x).size()) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define trav(a, x) for (auto &a : x) #define L1(u, ...) [&](...
C++
fbe031fe816692046fffe310fbc39f8d
46d0ff678103eb250a8347fec4a286fc
2,400
PASSED
#include <cstring> #include <iostream> #include <algorithm> #include <map> #include <vector> #include <queue> #include <cmath> #include <stack> #define x first #define y second #define MAX(a,b,c) max(max(a, b),c) #define MIN(a,b,c) min(min(a, b),c) #define debug(x) cout<<#x<<":"<<x<<endl; #define endl '\...
C++
c767a6a53cbd8bd64ac4af08c9846cc0
1aaad82037849b3fa5599fa47d90780d
2,000
PASSED
#include <cstring> #include <iostream> #include <algorithm> #include <map> #include <vector> #include <queue> #include <cmath> #include <stack> #define x first #define y second #define MAX(a,b,c) max(max(a, b),c) #define MIN(a,b,c) min(min(a, b),c) #define debug(x) cout<<#x<<":"<<x<<endl; #define endl '\...
C++
c767a6a53cbd8bd64ac4af08c9846cc0
d8e2314c3d54143d162e068c142f6cd7
2,000
PASSED
#include <cstring> #include <iostream> #include <algorithm> #include <map> #include <vector> #include <queue> #include <cmath> #include <stack> #define x first #define y second #define MAX(a,b,c) max(max(a, b),c) #define MIN(a,b,c) min(min(a, b),c) #define debug(x) cout<<#x<<":"<<x<<endl; #define endl '\...
C++
c767a6a53cbd8bd64ac4af08c9846cc0
84dd46aac6abc891700d7a238e1a6a7d
2,000
PASSED
#include <cstring> #include <iostream> #include <algorithm> #include <map> #include <vector> #include <queue> #include <cmath> #include <stack> #define MAX(a,b,c) max(max(a, b),c) #define MIN(a,b,c) min(min(a, b),c) #define debug(x) cout<<#x<<":"<<x<<endl; #define endl '\n' #define PI acos(-1) #define ...
C++
c767a6a53cbd8bd64ac4af08c9846cc0
fa94ca2b993e66d61f24fd3da7e09855
2,000
PASSED
#include<bits/stdc++.h> #define mod 998244353 #define all(x) x.begin(),x.end() typedef long long int ll; using namespace std; typedef pair<int,int> pr; int n,m,k; map<pr,bool> vis; map<pr,int> time_taken; map<int,vector<int>> x,y; void DFS(int a,int b,int &min_time){ vis[{a,b}]=1; //cout<<p.first<<"...
C++
c767a6a53cbd8bd64ac4af08c9846cc0
655f92235f409a4e09baa97cc53bea92
2,000
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define forn(i, n) for (int i = 0; i < int(n); i++) int k; map <int, vector<int>> mx; map <int, vector<int>> my; map <pair<int ,int>, bool> used; map <pair<int, int>, int> time_of; int dfs(int x, int y) { used[{x, y}] = true; ...
C++
c767a6a53cbd8bd64ac4af08c9846cc0
f7195d9b2c34e31f7910f814217bf656
2,000
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define forn(i, n) for (int i = 0; i < int(n); i++) int k; map <int, vector<int>> mx; map <int, vector<int>> my; map <pair<int ,int>, bool> used; map <pair<int, int>, int> time_of; int dfs(int x, int y) { used[{x, y}] = true; ...
C++
c767a6a53cbd8bd64ac4af08c9846cc0
a657de7a9e851db17d0c1520ad1c9747
2,000
PASSED
#include<map> #include<set> #include<stack> #include<queue> #include<cmath> #include<string> #include<vector> #include<cstdio> #include<cstring> #include<cstdlib> #include<iostream> #include<algorithm> typedef long long ll; const int inf = 1e9 + 7; const int mod = 998244353; const int MAX_N = 1e6 + 7; ...
C++
c767a6a53cbd8bd64ac4af08c9846cc0
594fed0808f32f593d7a9e65baaadc77
2,000
PASSED
#include<bits/stdc++.h> #define int long long #define endl '\n' using namespace std; int t,ans,x,y,z,n,m,k,T,a[200005],w,b[200005],cnt,u,v; map <int,int> mp1,mp2; int find(int k){ if (a[k]<=0) return k; return a[k]=find(a[k]); } struct node { int l,c;bool operator < (const node b){return l<b.l;} }; vect...
C++
c767a6a53cbd8bd64ac4af08c9846cc0
c160c0038a3ad82a7710427f837aa482
2,000
PASSED
#include<iostream> #include<queue> #include<cstring> #include<vector> #include<stdio.h> #include<map> #include<algorithm> #include<deque> #include<stack> #include<set> #include <unordered_map> #include<math.h> #include<string.h> #define IOS ios::sync_with_stdio(false),cin.tie(0); using namespace std; #...
C++
c767a6a53cbd8bd64ac4af08c9846cc0
193024d64cb9311a20cd6b42f4b3cf0b
2,000
PASSED
#include <bits/stdc++.h> using namespace std; int main(){ int t;cin>>t; while(t--){ int n,m,k;cin>>n>>m>>k; int d=(n+m-1)/m; int p=0,q=0; while(k--){ for(int i=0; i<n%m; i++){ cout<<d<<' '; for(int j=0; j<d; j++){ cout<<(p)%n+1<<' '; p++; } cout<<endl; } q=p...
C++
7cc46ebe80756a5827f3b8ce06bc7974
01310f41b000bba030a21e5eafd852b9
2,000
PASSED
#include <bits/stdc++.h> #define int long long #define pb push_back using namespace std; int mod = 998244353; int pow1(int n,int k){ if(k<=0)return 1; int c=1; int t=k; while(t--){ c*=n; } return c; } int gcd(int a,int b){ if(a<b){ swap(a,b); } i...
C++
7cc46ebe80756a5827f3b8ce06bc7974
0e673dfa05ea69e6b4d0ae276d37b06a
2,000
PASSED
#include <bits/stdc++.h> #define int long long #define pb push_back using namespace std; int mod = 998244353; int pow1(int n,int k){ if(k<=0)return 1; int c=1; int t=k; while(t--){ c*=n; } return c; } int gcd(int a,int b){ if(a<b){ swap(a,b); } i...
C++
7cc46ebe80756a5827f3b8ce06bc7974
43e54ca8d398bb13b6d82a6f1a57f25a
2,000
PASSED
#include <bits/stdc++.h> #define int long long #define pb push_back using namespace std; int mod = 998244353; int pow1(int n,int k){ if(k<=0)return 1; int c=1; int t=k; while(t--){ c*=n; } return c; } int gcd(int a,int b){ if(a<b){ swap(a,b); } i...
C++
7cc46ebe80756a5827f3b8ce06bc7974
0fcbf33fc928dbc1010fba8f077834ff
2,000
PASSED
#include<cstdio> #include<string> #include<cstring> #include<algorithm> #include<queue> #include<set> #include<cmath> #include<vector> using namespace std; typedef long long LL; typedef pair<int, int> PII; const int N = 2e5 + 5, M = 3e3 + 5; int t; int n, m, k; int st1[N], st2[N]; signed main() { ...
C++
7cc46ebe80756a5827f3b8ce06bc7974
5b7de4d8fffda3cd4af33735b1bb54ca
2,000
PASSED
#include <bits/stdc++.h> using namespace std; #define forn(i, n) for (int i = 0; i < int(n); i++) int main() { int t; cin >> t; forn(tt, t) { int n, m, k; cin >> n >> m >> k; vector<int> p(n); forn(i, n) p[i] = i; if (tt > 0) ...
C++
7cc46ebe80756a5827f3b8ce06bc7974
23c0e7bc2128cc7b471ab1b819a8772f
2,000
PASSED
#include <iostream> #include <vector> using namespace std; int main() { int t; cin >> t; while (t--) { int n, m, k; cin >> n >> m >> k; int min = n / m, max, r = n % m; if (n % m != 0) max = min + 1; else max = min; ...
C++
7cc46ebe80756a5827f3b8ce06bc7974
db0f418b6aa40bdc054c9d15879ddb4e
2,000
PASSED
#include <bits/stdc++.h> using namespace std; #define AboRadwan ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define ll long long #define all(v) v.begin(), v.end() //#define endl "\n" const int N = 2e5 + 50,NN = 1005, mod = 1e9 + 7; void solve() { ll n, m, k, nn; cin >> n >> m >> k; ...
C++
7cc46ebe80756a5827f3b8ce06bc7974
43dcf54fe2fcc2fe472d4516cfb871aa
2,000
PASSED
#include <bits/stdc++.h> #define ull unsigned long long #define ll long long #define endl '\n' #define line cout<<"--------------------------"<<endl #define dd(x) cout<<#x<<" = "<<x<<' ' #define sz(v) (ll)v.size() #define srt(v) sort(v.begin(),v.end()) #define rsrt(v) sort(v.rbegin(),v.rend()) #define all(v) v...
C++
7cc46ebe80756a5827f3b8ce06bc7974
8d1c324a50e749a79bc74ba563d8b2cf
2,000
PASSED
/* _____ _ _ / ____| | | | | | | __ _ __ __ _ ___ ___ _ _ _ __ ___ | |_ __ _| |_ ___ | | |_ | '__/ _` / __/ __| | | | '_ \ / _ \| __/ _` | __/ _ \ | |__| | | | (_| \__ \__ \ |_| | |_) | (_) | || (_| | || (_) | \_____|_| \__,_|__...
C++
7cc46ebe80756a5827f3b8ce06bc7974
72fdbc293ed4479f9c52c8c616dfdbbc
2,000
PASSED
#include <iostream> #include <bits/stdc++.h> #define Kirlos ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr); #define ll long long #define pb(k) push_back(k) #define endl '\n' #define mp(x,y) make_pair(x,y) #define MOD 1000000007; using namespace std; bool compare(const pair<int, int>&i, const pair...
C++
168f2a740d21a3a916a9d560fbcffeb9
ac7cbc187838ff16c6a47ca55f3b6381
800
PASSED
#include <iostream> #include <map> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0); int t;cin>>t; while(t--) { int n,k;cin>>n>>k; multimap<int,int>mp; int a[n],b[n]; for(int i=0;i<n;i++) cin>>a[i]; for(int i=0...
C++
168f2a740d21a3a916a9d560fbcffeb9
f82dd10cc8729e4c294997d41868b237
800
PASSED
#include <stdio.h> #include <math.h> #include <stdlib.h> #include <string.h> #include <iostream> #include <algorithm> #include <queue> #include <stack> #include <cstring> #include <map> #include<vector> using namespace std; typedef long long ll; typedef unsigned long long ull; struct node { int a,b; }; node x[101];...
C++
168f2a740d21a3a916a9d560fbcffeb9
8f4eac212f6c22d0c0da6c5c9071adaa
800
PASSED
#include<bits/stdc++.h> using namespace std; struct Node { int a,b; }; bool cmp(Node x,Node y) { if(x.a!=y.a) return x.a<y.a; else return x.b>y.b; } int main() { int t; cin>>t; Node RAM[100+10]; while (t--) { int n,k; cin>>n>>k; int c[100+20]; for...
C++
168f2a740d21a3a916a9d560fbcffeb9
6786409dd63e062d7c45d6e9c1685c82
800
PASSED
#include<bits/stdc++.h> using namespace std; #define pii pair<int,int> bool cmp(const pii& s1, const pii& s2) { return s1.first < s2.first; } int main() { int t; cin >> t; for (int i = 0; i < t; ++i) { pii a[10000]; int n, gm, k=0; cin >> n >> gm; for (int j = 0; j < n; j++)cin >> a[j].first; for (int j ...
C++
168f2a740d21a3a916a9d560fbcffeb9
38abfec6a2776102beae77c9c244f203
800
PASSED
#include <bits/stdc++.h> #define int long long using namespace std; int exxit=0; int t; int n,k; bool cmp(pair<int,int> a,pair<int,int> b){ if(a.first==b.first){ return a.second>b.second; } return a.first<b.first; } signed main(){ ios::sync_with_stdio(0); cin.tie(0); cin>>t; wh...
C++
168f2a740d21a3a916a9d560fbcffeb9
5caa6e4be3c6f3e6957098008d09ce64
800
PASSED
#include<bits/stdc++.h> using namespace std; const int N=1e6+10; int q[N]; void quick_sort(int a[],int b[],int l,int r) { if(l>=r) return; int i=l-1,j=r+1,x=a[l+r>>1]; while(i<j) { do i++;while(a[i]<x); do j--;while(a[j]>x); if(i<j)swap(a[i],a[j]),swap(b[i],b[j]); } quick_sort(a,b,l,j),quick_sort(a,b,j+1,r...
C++
168f2a740d21a3a916a9d560fbcffeb9
296c0cf31f666ba0d2d64321b6c7636b
800
PASSED
#include <bits/stdc++.h> #define long long LL #define debug(x) \ ; \ cout << x << "---" << endl; using namespace std; int a[100001], b[100001]; void slove() { int n, k; cin >> n >> k; vector<pair<int, int>> t; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) cin >> b[i]; fo...
C++
168f2a740d21a3a916a9d560fbcffeb9
7f31c761945231118e35f11997b95975
800
PASSED
#include<bits/stdc++.h> using namespace std; int n,k; struct sb{ int a,b; }s[1100]; bool cmp(sb p,sb o){ return p.a<o.a; } int main(){ int T; scanf("%d",&T); for(int pp=0;pp<T;pp++){ scanf("%d%d",&n,&k); for(int i=1;i<=n;i++) scanf("%d",&s[i].a); for(int i=1;i<=n;i++) scanf("%d",&s[i].b); sort(s+1,s+n+1,cm...
C++
168f2a740d21a3a916a9d560fbcffeb9
5800a3e07a9715da14458673cdfc4917
800
PASSED
#include <bits/stdc++.h> #define long long LL #define debug(x) \ ; \ cout << x << "---" << endl; using namespace std; int a[100001], b[100001]; void slove() { int n, k; cin >> n >> k; vector<pair<int, int>> t; for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) cin >> b[i]; fo...
C++
168f2a740d21a3a916a9d560fbcffeb9
d6396cefa7e1c56ddd1bad0c2bc8495b
800
PASSED
//amogus #include<bits/stdc++.h> using namespace std; const long long mod = 1000001; #define ll long long int #define vll vector<ll> #define test(x) ll x; cin >> x; while(x--) #define lp(i,a,b) for(ll i = a; i <= b; i++) #define fo(i,n) lp(i,0,n-1) #define a...
C++
6d5aefc5a08194e35826764d60c8db3c
f65752c94487d9f1dad6bd94d523bb16
1,700
PASSED
//amogus #include<bits/stdc++.h> using namespace std; const long long mod = 1000001; #define ll long long int #define vll vector<ll> #define test(x) ll x; cin >> x; while(x--) #define lp(i,a,b) for(ll i = a; i <= b; i++) #define fo(i,n) lp(i,0,n-1) #define arr...
C++
6d5aefc5a08194e35826764d60c8db3c
385f9d1e3aadeae9f0be2606281dbc3a
1,700
PASSED
#include<bits/stdc++.h> using namespace std; int t,n,p1,p2; string value,cc; set<string>tre,dos; bool si=false; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); // freopen("entra.in","r",stdin); // freopen("sale.out","w",stdout); cin>>t; while(t--){ si=false; cin...
C++
6d5aefc5a08194e35826764d60c8db3c
ef16d41753f9c9170969eab9b6e33475
1,700
PASSED
/* s = 1 left -> (a), (b), (c) palindrome -> a, b, c s = 2 left -> bc right -> (cb), a(cb) palindrome -> bccb, bcacb s = 3 left -> (ac)b right -> (ca), (bca) palindrome -> abcba, abccba cases that'll always be palindromes without concatenation a, aa, aaa, aba */ #include <bits/stdc++.h> using name...
C++
6d5aefc5a08194e35826764d60c8db3c
d2a304d7fb69eb6b230422c833b546d9
1,700
PASSED
/* s = 1 left -> (a), (b), (c) palindrome -> a, b, c s = 2 left -> bc right -> (cb), a(cb) palindrome -> bccb, bcacb s = 3 left -> (ac)b right -> (ca), (bca) palindrome -> abcba, abccba cases that'll always be palindromes without concatenation a, aa, aaa, aba */ #include <bits/stdc++.h> using name...
C++
6d5aefc5a08194e35826764d60c8db3c
a222d77bb4ac706f3aec2c6acdf1b55c
1,700
PASSED
/* s = 1 left -> (a), (b), (c) palindrome -> a, b, c s = 2 left -> bc right -> (cb), a(cb) palindrome -> bccb, bcacb s = 3 left -> (ac)b right -> (ca), (bca) palindrome -> abcba, abccba cases that'll always be palindromes without concatenation a, aa, aaa, aba */ #include <bits/stdc++.h> using name...
C++
6d5aefc5a08194e35826764d60c8db3c
caf3a615ee4428e8bec87e888e6bb4b8
1,700
PASSED
/* s = 1 left -> (a), (b), (c) palindrome -> a, b, c s = 2 left -> bc right -> (cb), a(cb) palindrome -> bccb, bcacb s = 3 left -> (ac)b right -> (ca), (bca) palindrome -> abcba, abccba cases that'll always be palindromes without concatenation a, aa, aaa, aba */ #include <bits/stdc++.h> using name...
C++
6d5aefc5a08194e35826764d60c8db3c
abe26fe7fed12440222f95f69b558443
1,700
PASSED
//Author: Manthan_Noob #pragma GCC optimize("Ofast") #include<bits/stdc++.h> using namespace std; #define tc int t; cin >> t; while(t--) using ll=long long int; int main(){ ios_base::sync_with_stdio(NULL); cin.tie(nullptr); tc { ll n, f=0; cin >> n; vector<string> v(n); map<string, ll> ...
C++
6d5aefc5a08194e35826764d60c8db3c
88faaa17f52530bf2c316c1fb4e4ec98
1,700
PASSED
//Author: Manthan_Noob #pragma GCC optimize("Ofast") #include<bits/stdc++.h> using namespace std; #define tc int t; cin >> t; while(t--) using ll=long long int; int main(){ ios_base::sync_with_stdio(NULL); cin.tie(nullptr); tc { ll n, f=0; cin >> n; vector<string> v(n); map<string, ll> ...
C++
6d5aefc5a08194e35826764d60c8db3c
759f43ba4cc4463cb160947cd9cf4edf
1,700
PASSED
//Author: Manthan_Noob #pragma GCC optimize("Ofast") #include<bits/stdc++.h> using namespace std; #define tc int t; cin >> t; while(t--) using ll=long long int; int main(){ ios_base::sync_with_stdio(NULL); cin.tie(nullptr); tc { ll n, f=0; cin >> n; vector<string> v(n); map<string, ll...
C++
6d5aefc5a08194e35826764d60c8db3c
a7643f0560bac767f90c35a316c8edb8
1,700
PASSED
#include<bits/stdc++.h> using namespace std; bool sortbysec(const pair<int,int> &a, const pair<int,int> &b) { return (a.second < b.second); } int main() { ios::sync_with_stdio(0); cin.tie(0); int t; cin>>t; while(t--){ int l,r,k; cin>>l>>r>>k; int ans=(r-l+1)-(r/2-(l-...
C++
9363df0735005832573ef4d17b6a8302
fe8443fc369ce35f73844e4e1b49fbdd
800
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long LL; void solve() { LL l, r, k; cin >> l >> r >> k; if (l == r) { if (l == 1) cout << "NO" << endl; else cout << "YES" << endl; } else { LL x; x = (r - l) / 2; if (l % 2 || r % 2) x++; if (x <= k) cout << "YES" << endl; else cout << "NO" ...
C++
9363df0735005832573ef4d17b6a8302
2c1d3614fe75c3117e718fb143fa39ae
800
PASSED
#include <cstdio> #include <algorithm> #include <iostream> #include <cstring> using namespace std; int main() { int t; scanf("%d",&t); int flag,sum; while(t--) { int l,r,k; flag=1; sum=0; scanf("%d %d %d",&l,&r,&k); if(l==r&&k==0&&l<=1) flag=0; ...
C++
9363df0735005832573ef4d17b6a8302
d031b156a1d750dd8170e92ab4ac7a2c
800
PASSED
#include<stdio.h> #include<string.h> #include<math.h> #include<algorithm> #include<vector> #include<queue> #include<iostream> using namespace std; int main(){ int t,l,r,k; scanf("%d",&t); while(t--){ int sum=0; scanf("%d%d%d",&l,&r,&k); if(l==r){ if(l==1){ printf("NO\n"); continue; } else{ ...
C++
9363df0735005832573ef4d17b6a8302
d90bb3fd24180188d6b45768a00292d3
800
PASSED