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 <iostream> #include <algorithm> #include <string.h> #include <string> #include <math.h> #include <stdio.h> #include<vector> #include<queue> #include<map> using namespace::std; typedef long long ll; int main(){ int t; cin>>t; while (t--) { int n; cin>>n; int bj=0; if...
C++
e5e937f080b20eaec5f12f1784ae6427
ca345a27fc4aa0e9c4ed070089a80f21
1,400
PASSED
#include <iostream> #include <algorithm> using namespace std; int main() { int t; cin>>t; while(t--) { int a; cin>>a; int b=a/11; int c=a%11; if(b/10>=c) cout<<"YES"<<endl; else cout<<"NO"<<endl; } }
C++
e5e937f080b20eaec5f12f1784ae6427
1c972a4b800f1682b6485922ffbac5e8
1,400
PASSED
#include<bits/stdc++.h> #include<algorithm> #include<string> using namespace std; #define go(i, n) for(int i=0; i<n; i++) #define endl "\n" #define ll long long int main() { int tt; cin >> tt; while(tt--) { ll n; bool ml=0; cin >> n; while(n>=0) { i...
C++
e5e937f080b20eaec5f12f1784ae6427
55e155a3ad5b6d037e53dc922f0ce285
1,400
PASSED
#include <iostream> #include <stdlib.h> #include <cstring> #include <cctype> #include <cstdio> #include <cstdlib> #include <string> #include <iomanip> #include <cmath> #include <vector> #include <algorithm> #include <vector> #include <utility> #include <bits/stdc++.h> using namespace std ; // FAST I/O #define GeekDav...
C++
e5e937f080b20eaec5f12f1784ae6427
6d2547b92964121615c5e12f2c8781e4
1,400
PASSED
#include<iostream> using namespace std; int main() { int t, num; cin >> t; while (t--) { int num; cin >> num; if (num > 1099) { cout << "YES" << endl; continue; } bool flag = false; for (int i = 0; i * 111 <= num; i++) { if ((num - i * 111) % 11 == 0) { flag = true; break; } ...
C++
e5e937f080b20eaec5f12f1784ae6427
c94756f3aa5ecba9b8c4b06c76b3d226
1,400
PASSED
#include <bits/stdc++.h> /* #define all(x) x.begin(),x.end()*/ #define ll long long #define pb push_back #define mp make_pair #define ff first #define ss second #define vll vector <ll> v #define sll set <ll> s #define wt ll t; cin >> t; while ( t-- ) #define sv_cheats ios_base::sync_with_stdio(0), cin.tie(0) using nam...
C++
e5e937f080b20eaec5f12f1784ae6427
0ff0a6d88b606b85739a0c552b494628
1,400
PASSED
#include <bits/stdc++.h> using namespace std; long long t,n,m,k,l,r,x,y,z; long long a[200010],b[200010]; int find1(long long x){ for(int i=1;i<=n+2;i++){ if(a[i]==x) {return 1;} } return 0; } int main(){ cin>>t; while(t--){ cin>>x; bool flag = false; for(int i=0;i*1...
C++
e5e937f080b20eaec5f12f1784ae6427
c4a42d6b069e8e6587fdaa44764d20bd
1,400
PASSED
#include<bits/stdc++.h> using namespace std; int main() { int _;cin>>_;while(_--){ int n;cin>> n; int flag = 0; for(int i =0; i * 111 <= n; i++) if((n - i * 111)%11==0){flag = 1;break;} if (flag) cout << "YES"; else cout << "NO"; cout << endl; } }
C++
e5e937f080b20eaec5f12f1784ae6427
c76f3c12169bd3c86c3faebd6ee7062c
1,400
PASSED
#include<bits/stdc++.h> using namespace std; int main(){ int t,n; cin>>t; while(t--){ cin>>n; int a[2*n]; for(int i=0;i<2*n;i++){ cin>>a[i]; } sort(a,a+2*n); for(int i=0;i<n;i++){ cout<<a[i]<<" "<<a[n+i]<<" "; } } return 0; } ...
C++
4296da660a39a6e98b41387929701c0a
d2d0c58ec86192980b75116f77bfcbad
800
PASSED
#include<bits/stdc++.h> using namespace std; #define FIO ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0); //#define f(i,n) for(int i = 0; i < n;i++) typedef long long ll; int main() { FIO int t , n; cin >> t; while(t--){ cin >> n; int x = 2*n; int ar[x+2]; for(int i ...
C++
4296da660a39a6e98b41387929701c0a
c5e0d0668b5f8cb6178eca4f1206d229
800
PASSED
#include<iostream> #include<vector> #include<map> #include<cmath> #include<queue> #include<algorithm> #include<deque> #include<set> #include<iomanip> #include<stack> #include<string> #include<stdio.h> #include<any> //#include<bits/stdc++.h> #include<cstring> //const long long N = 2e5+1 ; #define YO_GI_UH ios::sync_w...
C++
4296da660a39a6e98b41387929701c0a
2de54dab9c311adc731b1112d6be67bc
800
PASSED
#include <bits/stdc++.h> #define ll long long #define el '\n' #define pi 3.1415926536 #include <sstream> #define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0) using namespace std; int prime_factor(int number) { int count = 0; for (int i = 2; i * i <= number; i++) { while (number % i == 0) { coun...
C++
4296da660a39a6e98b41387929701c0a
7001c74a1376c2dd52cbb196c5ad93a9
800
PASSED
#include <iostream> #include <vector> #include <algorithm> #include <cstring> #include <set> #include <unordered_set> #include <queue> #include <map> #include <cmath> #include <climits> #include <iomanip> #include <unordered_map> #include <stdio.h> #include <stack> #include <numeric> #define ll long long #define el '\...
C++
4296da660a39a6e98b41387929701c0a
92a4b52d14c7696ceb2538e8e40d2307
800
PASSED
#include<stdio.h> int main() { int t; scanf("%d",&t); for(int i=0;i<t;i++) { int n,temp; scanf("%d",&n); n=n*2; int a[n]; for(int i=0;i<n;i++) { scanf("%d",&a[i]); } for(int i=0;i<n;i++) { for(int j=i+1;j<n;j...
C++
4296da660a39a6e98b41387929701c0a
a253d82d83439fe790ae3970ecc2f718
800
PASSED
#include<bits/stdc++.h> using namespace std; int main() { int t; cin>>t; for(int i=0; i<t; i++) { int n,j=0,k=0; cin>>n; int a[2*n]; for(int i=0; i<2*n; i++) cin>>a[i]; sort(a, a+2*n); int b[2*n]; for(int i=0; i<2*n; i++) { if(i%2==0) ...
C++
4296da660a39a6e98b41387929701c0a
cb458df5599d0710a690e64a26341e71
800
PASSED
#include <iostream> #include <stdlib.h> #include <cstring> #include <cctype> #include <cstdio> #include <cstdlib> #include <string> #include <iomanip> #include <cmath> #include <vector> #include <algorithm> #include <vector> #include <utility> #include <bits/stdc++.h> using namespace std ; #define GeekDav cin.tie(0)...
C++
4296da660a39a6e98b41387929701c0a
8e9a54cb49bfdd4c356c331777eff84e
800
PASSED
#include <bits/stdc++.h> using namespace std; #define endl '\n' int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int t,n; cin>>t; while(t--){ int arr[52]; cin>>n; for(int i=0; i<2*n; i++) cin>>arr[i]; sort(arr,arr+2*n); for(int i=0; i<n; i++) cout<<arr[i]<<' '<<arr[n+i]<<' '; ...
C++
4296da660a39a6e98b41387929701c0a
fa2f391cfc2cc95ce0a8bf98270c1afb
800
PASSED
#include <bits/stdc++.h> int main() { unsigned T, SZ; scanf("%d", &T); std::vector<long long> ivec; while(T--) { scanf("%d", &SZ); ivec.resize(SZ*2); for(unsigned i = 0, e = SZ *2; i != e; ++i) { scanf("%lld", &ivec[i]); } std::sort(ivec.begin(), ...
C++
4296da660a39a6e98b41387929701c0a
658ec028cd6a2b53471f9828ed8f7c12
800
PASSED
#include <iostream> #include <algorithm> #include <cstring> #include <map> #include <vector> using namespace std; const int N = 1e5 + 10; typedef long long ll; int st[N], tr[N], num[N], b[N], c[N]; int a[N], n; char out[N]; int lowbit(int x) { return x & -x; } void add(int x, int y) { for (int ...
C++
f17445aca588e5fbc1dc6a595c811bd6
cfb9701940684d80bb8b7dde2946a83c
2,200
PASSED
#include<bits/stdc++.h> using namespace std; long long masiv[100002]; long long ask(string s,string t) { for(long long i=0;i<s.size();i++)masiv[i]=0; vector<long long>a[26],b[26]; for(long long i=0;i<s.size();i++) { a[s[i]-'A'].push_back(i); b[t[i]-'A'].push_back(i); } vect...
C++
f17445aca588e5fbc1dc6a595c811bd6
5f924c39e2b797f6c0e7b7e5f9ac1b77
2,200
PASSED
#include <iostream> #include <vector> #include <bitset> #include <map> #include <queue> #include <stack> #include <algorithm> #include <cmath> #include <set> #include <cstring> #include <array> #include <bits/stdc++.h> #define rep(i,from,to) for(int i=from;i<to;i++) #define ite(i,arr) for(auto &i:arr) #de...
C++
f17445aca588e5fbc1dc6a595c811bd6
0a4a239de85b71d06ff0bac95296bef1
2,200
PASSED
#include<set> #include<queue> #include<cmath> #include<vector> #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; #define MAXN 400005 #define ENDL putchar('\n') #define LL long long #define DB double #define lowbit(x) ((-x) & (x)) #define INF 0x3f3f3f3f LL read...
C++
f17445aca588e5fbc1dc6a595c811bd6
404d39b873335c34524d4ea9f04b742c
2,200
PASSED
#include<iostream> #include<vector> #include<algorithm> using namespace std; #define pb push_back using ll=long long; const ll maxN=2e5; ll n; ll bit[maxN],a[maxN]; ll get(int id) { int ans=0; while(id>0) { ans+=bit[id]; id-=(id&(-id)); } return ans; } void solve()...
C++
f17445aca588e5fbc1dc6a595c811bd6
5d974600750a38b5954df0c1f9eb4253
2,200
PASSED
#include<iostream> #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("avx,avx2,fma,popcnt") #include<vector> #include<algorithm> using namespace std; #define pb push_back using ll=long long; const ll maxN=2e5; ll n; ll bit[maxN],a[maxN]; ll get(int id) { int ans=0; ...
C++
f17445aca588e5fbc1dc6a595c811bd6
8fc14a6a0081ca9df3a84f4a0a20a47f
2,200
PASSED
#include<bits/stdc++.h> using namespace std; #define int long long #define ll long long #define vi vector<int> #define pii pair<int,int> #define all(v) v.begin(),v.end() const double eps=1e-7; const double pi=acos(-1); //te pan const int N=1e5+5; int c[N]; void add(int x,int R){ for(;x<=R;x+=x&-x){ c[...
C++
f17445aca588e5fbc1dc6a595c811bd6
19d4a2423ae13ed03275acdd916ae1a5
2,200
PASSED
#include <bits/stdc++.h> // #include <bits/extc++.h> #define px first #define py second #define endl '\n' #define LF cout << '\n' #define rep(x, y, z) for (x = (y); (x) <= (z); (x)++) #define per(x, y, z) for (x = (y); (x) >= (z); (x)--) #define all(x) (x).begin(), (x).end() #define SZ(x) ((int)(x).size()) #d...
C++
f17445aca588e5fbc1dc6a595c811bd6
74aadb170c89dcc0f10affb527ef6091
2,200
PASSED
#include<bits/stdc++.h> using namespace std; #define Reimu inline void // 灵梦赛高 #define Marisa inline int // 魔理沙赛高 #define Sanae inline bool // 早苗赛高 using LL = long long; using ULL = unsigned long long; using Pii = pair<int, int>; using Tiii = tuple<int, int, int>; #define fi first #define se second ...
C++
f17445aca588e5fbc1dc6a595c811bd6
ad61864c369cec57eaec4ca4dd28a79d
2,200
PASSED
#include<bits/stdc++.h> using namespace std; // #define int long long typedef long long ll; const int maxn=1e5+10; char s[maxn]; char op[5]="ANOT"; map<char,int> mp={{'A',0},{'N',1},{'O',2},{'T',3}}; int cnt[4],a[maxn]; ll cal[4][4]; long long mx; signed main() { int T; scanf("%d",&T); while(...
C++
f17445aca588e5fbc1dc6a595c811bd6
6bbc89ebf27fd5fa5af4ab2b1e5018bf
2,200
PASSED
#include <iostream> #include <cstdio> #include <cstring> #define ll long long #define int long long #define mian main using namespace std; ll n,k,sa[2000010],rk[2000010],cnt,fac[4000010],inv[4000010]; const ll mod=998244353; inline ll read(){ ll s=0,w=1; char ch=getchar(); while(ch<'0'||ch>'9'){if...
C++
a20a1566c76f4e2fc6fccbafa418f9db
29a60159b8511621dd5e0365abf6a0b6
2,400
PASSED
// LUOGU_RID: 92658914 #include<bits/stdc++.h> #define ll long long using namespace std; const int MAXN = 2e6 + 5; const int MOD = 998244353; const int INF = 0x3f3f3f3f; const int INCF = 0xcfcfcfcf; int inpt() { int x = 0, f = 1; char ch; for(ch = getchar(); (ch < '0' || ch > '9') && ch != '-'; ch = ge...
C++
a20a1566c76f4e2fc6fccbafa418f9db
c231af1bf2f9ed009cd06fb6f06d0dde
2,400
PASSED
// LUOGU_RID: 92652453 #include<bits/stdc++.h> #define ll long long using namespace std; const int MAXN = 2e6 + 5; const int MOD = 998244353; const int INF = 0x3f3f3f3f; const int INCF = 0xcfcfcfcf; int inpt() { int x = 0, f = 1; char ch; for(ch = getchar(); (ch < '0' || ch > '9') && ch != '-'; ch = ge...
C++
a20a1566c76f4e2fc6fccbafa418f9db
390dc8655d15f42c573100e30f51748b
2,400
PASSED
#pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #pragma GCC optimization ("O3") #pragma GCC optimization ("unroll-loops") #include<bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define F first #define S second #define lb lower_bound #define ub upper_bound ...
C++
a20a1566c76f4e2fc6fccbafa418f9db
bf2753f3d6e5702bceaa021dfd908895
2,400
PASSED
#pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #pragma GCC optimization ("O3") #pragma GCC optimization ("unroll-loops") #include<bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define F first #define S second #define lb lower_bound #define ub upper_bound ...
C++
a20a1566c76f4e2fc6fccbafa418f9db
46eab53d81ecee4c070ccedcf923be35
2,400
PASSED
#pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #pragma GCC optimization ("O3") #pragma GCC optimization ("unroll-loops") #include<bits/stdc++.h> using namespace std; #define pb push_back #define mp make_pair #define F first #define S second #define lb lower_bound #define ub upper_bound ...
C++
a20a1566c76f4e2fc6fccbafa418f9db
b29086a3bc6625356f5fa975b75956a3
2,400
PASSED
#include <bits/stdc++.h> using namespace std; #define int long long // #define double long double typedef long long ll; typedef pair<int, int> ii; typedef pair<ii, int> iii; const int ms = 4e5+5; const int inf = 0x3f3f3f3f; const int mod = 998244353; int a[ms]; int fat[ms]; int ia[ms]; int fexp...
C++
a20a1566c76f4e2fc6fccbafa418f9db
cb38eebf0ab088483edd75a7e56ff323
2,400
PASSED
#include <bits/stdc++.h> #include <iostream> #include <fstream> #define ll long long #define mod 998244353 #define mod1 998244353 using namespace std; //vector<int>adj[200000+1]; //int cnt=0; vector<int>cand; int prime[100005]; vector<ll>primes; void SieveOfEratosthenes(int n) { memset(prime, 0,...
C++
a20a1566c76f4e2fc6fccbafa418f9db
56f55d1c593a6c7da3b84de96f4c4978
2,400
PASSED
#include <bits/stdc++.h> #define ld long double //#define endl "\n" #define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define pb push_back #define mp(a,b) make_pair(a,b) #define ms(v,x) memset(v,x,sizeof(v)) #define all(v) v.begin(),v.end() #define ff first #define ss second #define rep(i, a, b) for(i...
C++
a20a1566c76f4e2fc6fccbafa418f9db
8863a958f7619a47933b79870286e0f6
2,400
PASSED
#include <bits/stdc++.h> #define endl '\n' #define fi first #define se second #define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k)) #define forn(i,n) for (int i = 0; i < int(n); i++) #define forr(i,a,b) for (int i = a; i <= b; i++) #define all(v) v.begin(), v.end() #define pb push_back using namespace std; ty...
C++
a20a1566c76f4e2fc6fccbafa418f9db
b0de0ed27b8ed51f56d9dac2f79d0f4d
2,400
PASSED
#include <bits/stdc++.h> #pragma GCC optimize ("O3", "unroll-all-loops") #pragma GCC target ("sse4.2") using namespace std; #define F first #define S second typedef long long ll; typedef long double ld; typedef pair<ll, ll> pll; typedef pair<int, int> pii; ifstream in; ofstream out; co...
C++
f07c0885a2f9937787971dd1a5a91154
222e8669ff06bad1cc8fa63730062fd1
3,000
PASSED
#include <bits/stdc++.h> #pragma GCC optimize ("O3", "unroll-all-loops") #pragma GCC target ("sse4.2") using namespace std; #define F first #define S second typedef long long ll; typedef long double ld; typedef pair<ll, ll> pll; typedef pair<int, int> pii; ifstream in; ofstream out; co...
C++
f07c0885a2f9937787971dd1a5a91154
604774c41c1d24d985a97489948cfc43
3,000
PASSED
#include <bits/stdc++.h> #pragma GCC optimize ("O3", "unroll-all-loops") #pragma GCC target ("sse4.2") using namespace std; #define F first #define S second typedef long long ll; typedef long double ld; typedef pair<ll, ll> pll; typedef pair<int, int> pii; ifstream in; ofstream out; co...
C++
f07c0885a2f9937787971dd1a5a91154
20b6c12b6ed4e54c480896e1ef08b482
3,000
PASSED
#include <bits/stdc++.h> #pragma GCC optimize ("O3", "unroll-all-loops") #pragma GCC target ("sse4.2") using namespace std; #define F first #define S second typedef long long ll; typedef long double ld; typedef pair<ll, ll> pll; typedef pair<int, int> pii; ifstream in; ofstream out; co...
C++
f07c0885a2f9937787971dd1a5a91154
0bfa9561c1648a4c65168379ad9f95eb
3,000
PASSED
#include <bits/stdc++.h> #pragma GCC optimize ("O3", "unroll-all-loops") #pragma GCC target ("sse4.2") using namespace std; #define F first #define S second typedef long long ll; typedef long double ld; typedef pair<ll, ll> pll; typedef pair<int, int> pii; ifstream in; ofstream out; co...
C++
f07c0885a2f9937787971dd1a5a91154
c6771cbb32e235ac08fe59f4ed7938bf
3,000
PASSED
#include <bits/stdc++.h> #pragma GCC optimize ("O3", "unroll-all-loops") #pragma GCC target ("sse4.2") using namespace std; #define F first #define S second typedef long long ll; typedef long double ld; typedef pair<ll, ll> pll; typedef pair<int, int> pii; ifstream in; ofstream out; co...
C++
f07c0885a2f9937787971dd1a5a91154
185e894f39c6e3c9e31962fb0f7bffba
3,000
PASSED
#include <bits/stdc++.h> #pragma GCC optimize ("O3", "unroll-all-loops") #pragma GCC target ("sse4.2") using namespace std; #define F first #define S second typedef long long ll; typedef long double ld; typedef pair<ll, ll> pll; typedef pair<int, int> pii; ifstream in; ofstream out; co...
C++
f07c0885a2f9937787971dd1a5a91154
5b8f037e866e537a8fbb639844961b06
3,000
PASSED
#include <bits/stdc++.h> #pragma GCC optimize ("O3", "unroll-all-loops") #pragma GCC target ("sse4.2") using namespace std; #define F first #define S second typedef long long ll; typedef long double ld; typedef pair<ll, ll> pll; typedef pair<int, int> pii; ifstream in; ofstream out; co...
C++
f07c0885a2f9937787971dd1a5a91154
345d22da1592e56c7b266afd76f7d5a8
3,000
PASSED
#include <bits/stdc++.h> #pragma GCC optimize ("O3", "unroll-all-loops") #pragma GCC target ("sse4.2") using namespace std; #define F first #define S second typedef long long ll; typedef long double ld; typedef pair<ll, ll> pll; typedef pair<int, int> pii; ifstream in; ofstream out; co...
C++
f07c0885a2f9937787971dd1a5a91154
cd386066247c17defe1efa986689178a
3,000
PASSED
#include <bits/stdc++.h> using namespace std; using ll = long long; int getrand(int n) { return((int(rand()) % 107 * 107 * 107 + rand() % 107 * 107 + rand() % 107) % n + 1); } void testrand(int n, int& t1, int& t2) { const int trial = 10; int arr[trial + 1] = {}; int minres = n + 1; ...
C++
f07c0885a2f9937787971dd1a5a91154
9cc1a351d99e12c0bda8895ca1ffb0d2
3,000
PASSED
#include <bits/stdc++.h> using namespace std; /* * * * * * * * * * */ #define mp make_pair typedef long long ll; typedef pair<int, int> pii; /* * * * * * * * * * */ /* * * * Too many mind, no mind. * * */ const ll mod = 1e9 + 7; const int maxn = 2e5 + 10; ll ans = 1; ll mul(ll a, ll b) { re...
C++
3c91df8d91562039d550f879570c8af1
1cdb3fcc17506285526230e513640883
2,100
PASSED
#include <bits/stdc++.h> #define MAXN 200001 #define MOD 1000000007 using namespace std; typedef long long ll; ll gcd(ll p, ll q) { if (q == 0) return p; return gcd(q, p % q); } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int lpf[MAXN] = {0}; for (int i = 2; i < MA...
C++
3c91df8d91562039d550f879570c8af1
9ded9be6eb94f28ecaedf714503cf3cf
2,100
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; int const maxn = 2e5 + 5, max_val = 2e5 + 5; ll mod = 1e9 + 7, ans = 0; int nxt[max_val], n; multiset<int> cnt[max_val]; map<int, int> cnt_divisor[maxn]; ll gcd(ll p, ll q) { if (q == 0) return p; return gcd(q, p % q)...
C++
3c91df8d91562039d550f879570c8af1
2c8989aad67eead71617783be4e0faad
2,100
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; int const maxn = 2e5 + 5, max_val = 2e5 + 5; ll mod = 1e9 + 7, ans = 1; int nxt[max_val], n; multiset<int> cnt[max_val]; map<int, int> cnt_divisor[maxn]; void add(int i, int x) { while (x > 1) { int p = nxt[x], rep = 0; ...
C++
3c91df8d91562039d550f879570c8af1
80bb4a8b0d2b49038aedece81e665e64
2,100
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; int const maxn = 2e5 + 5, max_val = 2e5 + 5; ll mod = 1e9 + 7, ans = 1; int nxt[max_val], n; multiset<int> cnt[max_val]; map<int, int> cnt_divisor[maxn]; void add(int i, int x) { while (x != 1) { int div = nxt[x], add = 0;...
C++
3c91df8d91562039d550f879570c8af1
1d791ab9565f8e23a6e8c462d051d1ab
2,100
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; int const maxn = 2e5 + 5, max_val = 2e5 + 5; ll mod = 1e9 + 7, ans = 1; int nxt[max_val], n; multiset<int> cnt[max_val]; map<int, int> cnt_divisor[maxn]; void add(int i, int x) { while (x != 1) { int div = nxt[x], add = 0;...
C++
3c91df8d91562039d550f879570c8af1
916c6f6f2813eb0d85c9316f41fda91f
2,100
PASSED
#include<bits/stdc++.h> using namespace std; #define PI 3.1415926535897932384626433832795 #define MOD 1000000007 typedef int64_t ll; void solve() { const int N = 1000000; int lp[N+1]={0}; vector<int> pr; for (int i=2; i<=N; ++i) { if (lp[i] == 0) { lp[i] = i; pr.push_...
C++
3c91df8d91562039d550f879570c8af1
d2ed2cc6881aa426dabf821aa6acc42d
2,100
PASSED
#include<bits/stdc++.h> using namespace std; #define PI 3.1415926535897932384626433832795 #define MOD 1000000007 typedef int64_t ll; void solve() { const int N = 1000000; int lp[N+1]={0}; vector<int> pr; for (int i=2; i<=N; ++i) { if (lp[i] == 0) { lp[i] = i; pr.push_b...
C++
3c91df8d91562039d550f879570c8af1
225de7d95a9c97eb2fc1409e548d3056
2,100
PASSED
#include<bits/stdc++.h> using namespace std; #define PI 3.1415926535897932384626433832795 #define MOD 1000000007 typedef int64_t ll; void solve() { const int N = 2e5+5; int lp[N+1]={0}; vector<int> pr; for (int i=2; i<=N; ++i) { if (lp[i] == 0) { lp[i] = i; pr.push_bac...
C++
3c91df8d91562039d550f879570c8af1
c03c32b704d871af68f77537fa0bf75c
2,100
PASSED
#include<bits/stdc++.h> using namespace std; #define PI 3.1415926535897932384626433832795 #define MOD 1000000007 typedef int64_t ll; template<typename T1,typename T2>istream& operator>>(istream& in,pair<T1,T2> &a){in>>a.fr>>a.sc;return in;} template<typename T1,typename T2>ostream& operator<<(ostream& out,pair<T1...
C++
3c91df8d91562039d550f879570c8af1
de86e04dcd302ae97b007130170be8b5
2,100
PASSED
#include<iostream> using namespace std; int main() { int t; cin>>t; while(t--) { int n,sum; cin>>n>>sum; int m=n-( (sum-1)/2+1 ); cout<<m<<endl; for(int i=(sum+1)/2;i<=n;++i) if(i!=sum) cout<<i<<" "; cout<<endl; } return 0; } /////////////////
C++
d08e39db62215d7817113aaa384e3f59
3383c7401a8e84212d752cbb7a73ff73
800
PASSED
#include<stdio.h> int main() { int x; scanf("%d",&x); while(x--) { int n,k; scanf("%d %d",&n,&k);//读入n k //下面k为奇数 if(k%2!=0) { int a1=(k+1)/2;//中间数 int b1=a1+n-k-1; printf("%d\n",b1); //输 for(int i=a1;i<k;i++) { printf("%d ",i); } for(int i=k+1;i<=n;i++){ ...
C++
d08e39db62215d7817113aaa384e3f59
e6cff4ebccf744a2091cedf935b7843a
800
PASSED
//#include<bits/stdc++.h> #include <iostream> using namespace std; int main() { int T; cin >> T; while(T--){ int n, k; cin >> n >> k; cout << n-k + k/2 << endl; if(n-k+k/2==0) continue; for(int i=(k+1)/2; i<k; ++i) cout << i << ' '; for(int i=k+1; i<=n; ++i) ...
C++
d08e39db62215d7817113aaa384e3f59
397a99fa0fe30185993b13c8142c2a71
800
PASSED
#include<iostream> using namespace std; int c[1010]; int main() { int n; cin>>n; while(n--){ int a,b,sum=0; cin>>a>>b; for(int i=b+1;i<=a;i++) c[sum++]=i; if(b%2==0) { for(int i=b/2;i<b;i++) c[sum++]=i; } else { for(int i=b/2+1;i<b;i++) c[sum++]=i; } cout<<sum<<endl; for(int i...
C++
d08e39db62215d7817113aaa384e3f59
e866ee84d6f9d32e593e06983f7bdd23
800
PASSED
#include <iostream> #include <stdlib.h> #include <cstring> #include <cctype> #include <cstdio> #include <cstdlib> #include <string> #include <iomanip> #include <cmath> #include <vector> #include <algorithm> #include <vector> #include <utility> #include <bits/stdc++.h> using namespace std ; // FAST I/O #define GeekDav...
C++
d08e39db62215d7817113aaa384e3f59
66b93fff22ab3a0b4b07dd7615ed5078
800
PASSED
#pragma GCC optimize(2) #include <iostream> #include <map> #include <unordered_map> #include <set> #include <queue> #include <stack> #include <algorithm> #include <vector> #include <string> #include <cmath> #include <cstdio> #include <cstring> #include <climits> #include <iomanip> #include <bitset> #define Buff std::io...
C++
d08e39db62215d7817113aaa384e3f59
edcdb5d53b1c19e24d4e45eee6a26799
800
PASSED
#include<bits/stdc++.h> using namespace std; #define ll long long #define MAXN 200005 #define MAXM 200005 typedef pair<int, int> pii; #define INF 0x3f3f3f3f #define rep(i, x, y) for (int i = x; i <= y; i++) #define per(i, x, y) for(int i = x; i >= y; i--) #define pb emplace_back ll read() { ll x=0,f=1;char ch; ...
C++
d08e39db62215d7817113aaa384e3f59
83c471e4b37aa1203c2bf8af598e75e4
800
PASSED
#include<bits/stdc++.h> using namespace std; int t, n, sum; int main() { scanf("%d", &t); while(t--) { int res = 0; scanf("%d %d", &n, &sum); res += n - sum + sum / 2; printf("%d\n", res); if(sum & 1) { for(int i = sum / 2 + 1; i <= sum - 1; ++...
C++
d08e39db62215d7817113aaa384e3f59
619fb95f317335af5bad912a09f39c13
800
PASSED
#include <cstdio> #include <cmath> #include <algorithm> #include <iostream> #include <cstring> #include <map> #include <string> #include <stack> #include <cctype> #include <vector> #include <queue> #include <set> #include <utility> #include <cassert> using namespace std; #define ll long long #define maxn 2010 #define m...
C++
d08e39db62215d7817113aaa384e3f59
e195601cc31f1a4515679c26cd768061
800
PASSED
#include <bits/stdc++.h> #define ll long long int using namespace std; ll n,t,ans,c,k,mn; int main(){ cin>>t; while(t--){ cin>>n>>k; if(k==2){ cout<<n-1<<endl; for(int i=1;i<=n;i++){ if(i != 2) cout<<i<<' '; } cout<<endl; } else if(k%2==0){ for(int i=k/2;i<=n;i++){ if(i...
C++
d08e39db62215d7817113aaa384e3f59
2682857f701d86495c8aa84b69035422
800
PASSED
#include<iostream> #include<cstring> #include<string> #include<algorithm> #include<cmath> #include<queue> #include<vector> #pragma warning(disable:4996) #define ll long long #include<functional> #include<map> using namespace std; const ll INF = 0x3f3f3f3f3f; priority_queue< int, vector<int>, greater<int> >q; priority_q...
C++
7f28e4dbd199b84bd7885bf7f479cf38
e74c14c50c1679b1b6f8fe3945f7a7b4
1,300
PASSED
///BISMILLAHIR RAHMANIR RAHIM #include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll t; cin>>t; while(t--) { int h,m,x1,q,h1=200,m1=200,p,r,q1,p1,r1; cin>>h>>m; string s; cin>>s; int x=(s[0]-'0')*10+(s[1]-'0'); int y=(s[3]-'0')*...
C++
7f28e4dbd199b84bd7885bf7f479cf38
3e862cc1d76cca719b7bbe243e60cb6e
1,300
PASSED
#include<bits/stdc++.h> using namespace std; map<int,int>mp,mp1; void init(){ mp.clear(); // for(int i=0) mp[0]=0x3f3f3f3f; mp[1]=1; mp[2]=5; mp[5]=2; mp[8]=8; mp1.clear(); mp1[0]=0; mp1[1]=1; mp1[2]=5; mp1[5]=2; mp1[8]=8; } int main(){ init(); int t,h,m; char s; int x,y; cin>>t; while(t--){ cin>>h>...
C++
7f28e4dbd199b84bd7885bf7f479cf38
75ccf07abf9b29a09004f78952adc986
1,300
PASSED
#include<iostream> using namespace std; int nor[10]={0,1,5,-1,-1,2,-1,-1,8,-1}; int h,m; bool check(int hh,int mm){ int trhh=0,trmm=0; trhh = nor[mm/10]; trmm = nor[hh/10]; if(trhh==-1||trmm==-1||nor[hh%10]==-1||nor[mm%10]==-1) return false; trhh += nor[mm%10]*10; trmm += nor[hh%10]*10; ...
C++
7f28e4dbd199b84bd7885bf7f479cf38
3a4e555ac818b6b33a6cc427cc617682
1,300
PASSED
#pragma GCC diagnostic error "-std=c++11" #include<cstdio> #include<iostream> #include<algorithm> #include<cstring> #include<cmath> #include<queue> #include<map> #include<stack> #include<set> #include<ctime> #define iss ios::sync_with_stdio(false) using namespace std; typedef unsigned long long ull; typedef long long l...
C++
7f28e4dbd199b84bd7885bf7f479cf38
8a4335fc74d451473c84f3820465b8dd
1,300
PASSED
#include<cstdio> #include<set> #include<vector> #include<algorithm> #include<queue> #include<map> #include<cstdlib> #include<time.h> #include<string> #include<stack> #include<cmath> #include<iostream> #include<cstring> #include<complex> #include<tr1/unordered_set> #include<tr1/unordered_map> #include <chrono> #include ...
C++
7f28e4dbd199b84bd7885bf7f479cf38
8c231a25896bf3e6600723c22c94ad3e
1,300
PASSED
#include<iostream> #include<string.h> #include<map> #include<cstdio> using namespace std; typedef long long ll; int r[10] = { 0,1,5,-1,-1,2,-1,-1,8,-1 }; bool check(int a, int b, int c, int d, int n, int m) { if (a * 10 + b >= n||c*10+d >=m ) return 0; if (a == -1 || b == -1 || c == -1 || d == -1) return 0; return t...
C++
7f28e4dbd199b84bd7885bf7f479cf38
e0e021866ef15d5c8e3260ccc34243f0
1,300
PASSED
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<vector> #include<map> #include<bitset> #include<stack> #include<queue> #define lli __int128 #define ll long long #define INF 0x3f3f3f3f #define inf -0x3f3f3f3f #define me(a,b) memset(a,b,sizeof(a)) #define PII pair<ll,ll>...
C++
7f28e4dbd199b84bd7885bf7f479cf38
3624aa8c0b52061d52e5ffd0fb93a7e1
1,300
PASSED
#include<iostream> #include<cstdio> #include<cmath> #include<stdlib.h> #include<cstring> #include<algorithm> //通用算法 #include<string>//字符串类 #include<set>//集合容器 #include<map>//映射容器 #include<stack>//堆栈容器  #include<vector>//动态数组容器 #include<queue>//队列容器 #include<deque> //双端队列容器 #include<iomanip> #include<cstdlib> #include<c...
C++
7f28e4dbd199b84bd7885bf7f479cf38
6922d30e21df750c4710514b8f6ef3e9
1,300
PASSED
#include<iostream> using namespace std; int h, m; int HH, MM; int q[] = {1, 1, 1, 0, 0, 1, 0, 0, 1, 0}; int p[] = {0, 1, 5, -1, -1, 2, -1, -1, 8, -1}; bool check_1(int a, int b) { while(a) { if(!q[a % 10]) return false; a /= 10; } while(b) { if(!q[b % 10]) return false...
C++
7f28e4dbd199b84bd7885bf7f479cf38
a7c26ad1286ad9535737dd4454300769
1,300
PASSED
#include <bits/stdc++.h> #define debug(...) fprintf(stderr,__VA_ARGS__) #define DEBUG printf("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__) #define Debug debug("Passing [%s] in LINE %d\n",__FUNCTION__,__LINE__) #define rep(i,x,y) for(int i=(x);i<=(y);++i) #define all(x) (x).begin(),(x).end() using names...
C++
6c51676bc12bce8ba6e36b64357ef9f0
47850c8b4052e651b643e35977c7b03b
2,000
PASSED
/*{{{*/ #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<algorithm> #include<string> #include<iostream> #include<sstream> #include<set> #include<map> #include<queue> #include<bitset> #include<vector> #include<limits.h> #include<assert.h> #define SZ(X) ((int)(X).size()) #def...
C++
6c51676bc12bce8ba6e36b64357ef9f0
0e3147e73383e3c44d440a56e13afaac
2,000
PASSED
#include<bits/stdc++.h> using namespace std; int n,k,a[256]; //number of letter to make it beautiful int check(){ int wanted=0; for(int i='a';i<='z';i++) if(a[i]%k!=0) wanted+=k-a[i]%k; return wanted; } //returns the minimum number of letter by which the string is defecit int precheck(char ch){int x...
C++
6c51676bc12bce8ba6e36b64357ef9f0
7d7eb498526a0fd2e3497e461a223a1d
2,000
PASSED
#include<bits/stdc++.h> using namespace std; int a[26]; int get(int x,int k){ return (k-x%k)%k; } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n,k,t; cin>>t; while(t--){ cin>>n>>k; string s; cin>>s; for(int i=0;i<26;i++) a[i]=0; for(auto c:s) a[c-'a']++; int sum=0,fla...
C++
6c51676bc12bce8ba6e36b64357ef9f0
6b9b86a7bd8b4e61673e4f89fcd08f82
2,000
PASSED
/*/ Author : Abhishek Chauhan /*/ #include<bits/stdc++.h> #include "ext/pb_ds/assoc_container.hpp" #include "ext/pb_ds/tree_policy.hpp" using namespace std::chrono; using namespace __gnu_pbds; using namespace std; // a+b = a^b + 2*(a&b) // whenever using a comparator return true only if a<b // make it fo...
C++
6c51676bc12bce8ba6e36b64357ef9f0
fe4a9c6de90845ae07b2c666e3177628
2,000
PASSED
/*/ Author : Abhishek Chauhan /*/ #include<bits/stdc++.h> #include "ext/pb_ds/assoc_container.hpp" #include "ext/pb_ds/tree_policy.hpp" using namespace std::chrono; using namespace __gnu_pbds; using namespace std; // a+b = a^b + 2*(a&b) // whenever using a comparator return true only if a<b // make it fo...
C++
6c51676bc12bce8ba6e36b64357ef9f0
7d7d31abf3eb7ef93e28b967e4a34ea4
2,000
PASSED
/*/ Author : Abhishek Chauhan /*/ #include<bits/stdc++.h> #include "ext/pb_ds/assoc_container.hpp" #include "ext/pb_ds/tree_policy.hpp" using namespace std::chrono; using namespace __gnu_pbds; using namespace std; // a+b = a^b + 2*(a&b) // whenever using a comparator return true only if a<b // make it fo...
C++
6c51676bc12bce8ba6e36b64357ef9f0
2afbc9e07e4c7eaa2a83b448ac146872
2,000
PASSED
/*/ Author : Abhishek Chauhan /*/ #include<bits/stdc++.h> #include "ext/pb_ds/assoc_container.hpp" #include "ext/pb_ds/tree_policy.hpp" using namespace std::chrono; using namespace __gnu_pbds; using namespace std; // a+b = a^b + 2*(a&b) // whenever using a comparator return true only if a<b // make it fo...
C++
6c51676bc12bce8ba6e36b64357ef9f0
4e8d7d27388171d40f99537251a51142
2,000
PASSED
#include <bits/stdc++.h> #define f first #define s second #define all(vec) begin(vec), end(vec) #define pf push_front #define pb push_back #define lb lower_bound #define ub upper_bound using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef pair<ll,int> pli; ...
C++
6c51676bc12bce8ba6e36b64357ef9f0
bd2b1c60ada9068caf96ba73afbcfc8d
2,000
PASSED
#include <bits/stdc++.h> using namespace std; const int ALPHA = 27; int getNeed(int n, int k) { int mult = (n + k - 1) / k; return mult * k - n; } int main() { int t; cin >> t; while (t--) { int n, k; cin >> n >> k; string s; cin >> s; v...
C++
6c51676bc12bce8ba6e36b64357ef9f0
b9fe69861b2160044483fb78a2b54753
2,000
PASSED
#include<bits/stdc++.h> using namespace std; void Min(int& x,int y){x=min(x,y);} void Max(int& x,int y){x=max(x,y);} int read() { int x=0,f=1;char ch=getchar(); while(ch>'9'||ch<'0'){if(ch=='-')f=-1;ch=getchar();} while(ch<='9'&&ch>='0'){x=(x<<3)+(x<<1)+(ch^48);ch=getchar();} return x*f; } int n,m,N,N_; ...
C++
f1b4048e5cd2aa0a533af9d08f7d58ba
7a7c6ec0c6846247c2592ee309638ec8
2,600
PASSED
#include<bits/stdc++.h> using namespace std; const int NR=1005; void Min(int& x,int y){x=min(x,y);} void Max(int& x,int y){x=max(x,y);} int read() { int x=0,f=1;char ch=getchar(); while(ch>'9'||ch<'0'){if(ch=='-')f=-1;ch=getchar();} while(ch<='9'&&ch>='0'){x=(x<<3)+(x<<1)+(ch^48);ch=getchar();} return x*f...
C++
f1b4048e5cd2aa0a533af9d08f7d58ba
bfda89a8d43c1129f98802d27b690989
2,600
PASSED
#pragma GCC optimaze(3) #pragma GCC optimaze(2) #pragma GCC optimaze("Ofast") #pragma GCC optimaze("inline") #pragma GCC optimaze("unroll-loops") #include<bits/stdc++.h> using namespace std; int n,m; int ans=0; vector <int> ve; bool bo[1010]; inline void Q(int a,int b,int c,int d,int e,int f) { cout<<...
C++
f1b4048e5cd2aa0a533af9d08f7d58ba
1f8525fa0af03e6ce1979f7a47b9a9ca
2,600
PASSED
#include<bits/stdc++.h> using namespace std; int n,m; int ans=0; vector <int> ve; bool bo[1010]; inline void Q(int a,int b,int c,int d,int e,int f) { cout<<"? "<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<e<<" "<<f<<endl; cin>>ans; } inline bool pd1(int n,int s) { int k=n/s; if (s==2) { Q(k,m,1,1,k+1,...
C++
f1b4048e5cd2aa0a533af9d08f7d58ba
19998b05789609bf98282d0687056311
2,600
PASSED
/*{{{*/ #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<algorithm> #include<string> #include<iostream> #include<sstream> #include<set> #include<map> #include<queue> #include<bitset> #include<vector> #include<iomanip> #include<limits.h> #include<assert.h> #define SZ(X) ((int)(X).size()) #de...
C++
f1b4048e5cd2aa0a533af9d08f7d58ba
ba0f101eb8572fa90bda19d0ac817df4
2,600
PASSED
#include<bits/stdc++.h> #define Mx 1000 using namespace std; int n,m,t,ans,p_t=0; int p[1002]; bool u[1002]; inline void init() { for(int i=2;i<=Mx;++i) { if(!u[i])p[++p_t]=i; for(int j=1;j<=p_t && p[j]<=Mx/i;++j) { u[p[j]*i]=1; if(!(i%p[j]))break; } } } inline int calc(int x) { in...
C++
f1b4048e5cd2aa0a533af9d08f7d58ba
973c5773505af32d4715ca15a4ae67f7
2,600
PASSED
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <ctype.h> #include <queue> #include <cstring> #include <set> #include <bitset> #include <map> #include <chrono> #include <random> #include <unordered_map> #include <stdio.h> using namespace std; typedef long long ll; typedef long do...
C++
f1b4048e5cd2aa0a533af9d08f7d58ba
1e24307beb3bba579fdf564b922ed21b
2,600
PASSED
#include<bits/stdc++.h> using namespace std; vector<pair<int, int>> vpf(int n){ vector<pair<int, int>> res; for(int i = 2; i <= n; i += 1) if(n % i == 0){ for(res.push_back({i, 0}); n % i == 0; n /= i) res.back().second += 1; } return res; } int main(){ ios::sync_with_stdio(false);...
C++
f1b4048e5cd2aa0a533af9d08f7d58ba
43b5420aef62407a2270e39ddd553c53
2,600
PASSED
#include <bits/stdc++.h> using namespace std; int n, m; bool Query(int h, int w, int lx1, int ly1, int lx2, int ly2) { std::cout << "? " << h << " " << w << " " << lx1 + 1 << " " << ly1 + 1 << " " << lx2 + 1 << " " << ly2 + 1 << std::endl; int res = 1; std::cin >> res; return...
C++
f1b4048e5cd2aa0a533af9d08f7d58ba
919e6ed8794d12ba637102b77d7bb762
2,600
PASSED
#include <bits/stdc++.h> #define fp( i , x , y ) for( int i=(x); i<=(y); ++i ) #define fq( i , x , y ) for( int i=(y); i>=(x); --i ) #define ft( i , x ) for( int i=hd[x]; i ; i=nxt[i] ) #define ls k<<1 #define rs k<<1|1 using namespace std ; int n , m ; int ask( int h , int w , int i1 , int j1 , int i2 ...
C++
f1b4048e5cd2aa0a533af9d08f7d58ba
5bc38a019047875249a416798854fbf5
2,600
PASSED
#include<bits/stdc++.h> #define rep(i,a,b) for(int i=(a);i<=(b);++i) #define dep(i,a,b) for(int i=(a);i>=(b);--i) #define lowbit(x) (x&(-x)) #define debug(x) cout<<#x<<" :"<<x<<endl #define debug1(x) cout<<#x<<" :"<<x<<" " using namespace std; typedef unsigned long long ull; typedef long long ll; typedef doubl...
C++
1925187d2c4b9caa1e74c29d9f33f3a6
e3ff07d81da065c09ea0f3ddbbd860e1
2,600
PASSED
#include<bits/stdc++.h> #define rep(i,a,b) for(int i=(a);i<=(b);++i) #define dep(i,a,b) for(int i=(a);i>=(b);--i) #define lowbit(x) (x&(-x)) #define debug(x) cout<<#x<<" :"<<x<<endl #define debug1(x) cout<<#x<<" :"<<x<<" " using namespace std; typedef unsigned long long ull; typedef long long ll; typedef doubl...
C++
1925187d2c4b9caa1e74c29d9f33f3a6
c4c0c27feaef90f477a716375679bffd
2,600
PASSED