source_code
stringlengths
26
62k
lang_cluster
stringclasses
11 values
src_uid
stringlengths
32
32
code_uid
stringlengths
32
32
difficulty
int32
-1
3.5k
βŒ€
exec_outcome
stringclasses
1 value
#include <bits/stdc++.h> using namespace std; int main(){ int t; scanf("%d", &t); while(t--){ int n, l, r; scanf("%d %d %d", &n, &l, &r); int arr[n+2]; arr[n] = -2000000000; arr[n+1] = 2000000000; for (int i = 0; i < n; ++i) { scanf("%d", &arr[i]); } sort(arr,arr+n+2); long long int ans = 0; ...
C++
2f12b2bb23497119bb70ca0839991d68
d763d989d992734be7d0dd55248d07cb
1,300
PASSED
#include<bits/stdc++.h> using namespace std; #define ll long long int main(){ int t; cin>>t; while(t--){ int n; ll l,r; cin>>n>>l>>r; vector<ll> a(n); for(int i=0;i<n;i++) cin>>a[i]; sort(a.begin(),a.end()); ll ans=0; for(int i=0;i<n...
C++
2f12b2bb23497119bb70ca0839991d68
d20f849b1839edcb1d1f62d5b55bb0e9
1,300
PASSED
#include <bits/stdc++.h> using namespace std; #ifdef FFS #include <debug.h> #else #define debug(args...) #endif void solve() { int n, l, r; cin >> n >> l >> r; vector <int> a(n); for(auto &x : a) cin >> x; sort(a.begin(), a.end()); int64_t cnt = 0; for(int i = 0; i < n; ++i) { auto lt...
C++
2f12b2bb23497119bb70ca0839991d68
4eea0577326ad21567bc9aefc1f248aa
1,300
PASSED
#include<bits/stdc++.h> using namespace std; #define endl '\n' #define all(v) v.begin(), v.end() typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef vector<vector<int>> vii; /*****User defined function*****/ void solve_problem() { int n, l, r; cin >> n >> l >> r; vect...
C++
2f12b2bb23497119bb70ca0839991d68
2b4c6fd0451a18b9badfd377545be499
1,300
PASSED
#pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> #include <complex> #include <queue> #include <set> #include <unordered_set> #include <list> #include <chrono> #include <random> #include <iostream> #inc...
C++
2f12b2bb23497119bb70ca0839991d68
c0e66ee1a3685709601900868f13274b
1,300
PASSED
#include <bits/stdc++.h> using namespace std; int main(){ int t; cin >> t; while(t--){ int n, l, r; cin >> n >> l >> r; vector<int>V(n); for(auto &x : V) cin >> x; sort(V.begin(), V.end()); long long Ans = 0; for(int i = 0; i < n; i++){ auto F...
C++
2f12b2bb23497119bb70ca0839991d68
6590fe847ad1c6e99697d24f8c1190f3
1,300
PASSED
#include <bits/stdc++.h> using namespace std; int main() { int test; cin>>test; while(test--){ long long n,low_limit,high_limit; cin >>n>>low_limit>>high_limit; long long arr[n]={0}; for(int i=0;i<n;i++) { cin>>arr[i]; } long long count=0; sort(arr,arr+n); for(int i=0;i<n;i++)...
C++
2f12b2bb23497119bb70ca0839991d68
603696faf86b1061f224049a706e0d34
1,300
PASSED
#include <bits/stdc++.h> #define REP(i, a, b) for (int i = a; i < b; i++) #define ll long long #define all(c) (c).begin(),(c).end() #define ff first #define ss second #define pb push_back #define mp make_pair #define fast ios::sync_with_stdio(0); cin.tie(0); using namespace std; typedef priority_queue<in...
C++
2f12b2bb23497119bb70ca0839991d68
81f39e3163d29038e0cd37585b970640
1,300
PASSED
#include <bits/stdc++.h> using namespace std; int main() { long long t,n,l,r; cin>>t; while(t--){ cin>>n>>l>>r; vector<int>v; long long c=0; for(int i=0;i<n;i++){ int x;cin>>x;v.push_back(x); } sort(v.begin(),v.end()); int j=0; for(int i=0;i<n;i++){ ...
C++
2f12b2bb23497119bb70ca0839991d68
6273621c79f53c7b58799862741b2de2
1,300
PASSED
#include<bits/stdc++.h> #define ll long long #define pi pair<int,int> #define pii 3.1415926536 #define vi vector<int> #define pb push_back #define fr(a,b) for(int i = a; i < b; i++) #define rep(i,a,b) for(int i = a; i < b; i++) #define mod 1000000007 #define inf (1LL<<60) #define all(x) (x).begin(), (x).end()...
C++
b58a18119ac8375f9ad21a282292a76c
678276cc8d29415dd5b469de49d8a232
1,700
PASSED
#define _CRT_SECURE_NO_WARNINGS #define Despacito ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #pragma GCC target("popcnt") #include <iostream> #include <vector> #include <set> #include <map> #include <cmath> #include <algorithm> #include <sstream> #include <iomanip> #include <fstream> #include ...
C++
b58a18119ac8375f9ad21a282292a76c
91076a02358be4158380ba2463a2a5e7
1,700
PASSED
#include <bits/stdc++.h> using namespace std; //// using ll = long long; using ld = long double; using pii = pair<int, int>; using cd = complex<ld>; const int N = 50'000; bool isPrime[N]; vector<int> primes; void precalc() { fill(isPrime + 2, isPrime + N, true); for (int i = 2; i * i < N; i++)...
C++
b58a18119ac8375f9ad21a282292a76c
855b3d70e77fc05e69387b904c6cfe4c
1,700
PASSED
#include <bits/stdc++.h> using namespace std; // using ll = long long; using ld = long double; using pii = pair<int, int>; using cd = complex<ld>; const int N = 50'000; bool isPrime[N]; vector<int> primes; void precalc() { fill(isPrime + 2, isPrime + N, true); for (int i = 2; i * i < N; i++) {...
C++
b58a18119ac8375f9ad21a282292a76c
f60217125c8ad13b903a5a3aaac73cba
1,700
PASSED
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using pii = pair<int, int>; using cd = complex<ld>; const int N = 50'000; bool isPrime[N]; vector<int> primes; void precalc() { fill(isPrime + 2, isPrime + N, true); for (int i = 2; i * i < N; i++) { ...
C++
b58a18119ac8375f9ad21a282292a76c
1354bb3acde5367c5ddd9da08b5ac5a6
1,700
PASSED
#include<bits/stdc++.h> using namespace std; int n, m, k; void divide(int x) { for (int i = 2; i * i <= x; i ++ ) { while (x % i == 0) { x /= i; k--; } } if (x > 1) k --; } void solve() { cin >> n >> m >> k; if(k == 1) ...
C++
b58a18119ac8375f9ad21a282292a76c
65150cd2fb8b7911c966299ea4089620
1,700
PASSED
#include<bits/stdc++.h> using namespace std; int n, m, k; void divide(int x) { for (int i = 2; i * i <= x; i ++ ) { while (x % i == 0) { x /= i; k--; } } if (x > 1) k --; } void solve() { cin >> n >> m >> k; if(k == 1) ...
C++
b58a18119ac8375f9ad21a282292a76c
a655011eb6928ca52b0490dd269d791b
1,700
PASSED
#include<bits/stdc++.h> using namespace std; int n, m, k; void divide(int x) { for (int i = 2; i * i <= x; i ++ ) { while (x % i == 0) { x /= i; k--; } } if (x > 1) k--; } void solve() { cin >> n >> m >> k; if(k == 1) ...
C++
b58a18119ac8375f9ad21a282292a76c
4b335c74b7bfe9e4aa4758315a17c45d
1,700
PASSED
#include<bits/stdc++.h> using namespace std; int divide(int x, int k) { for (int i = 2; i * i <= x; i ++ ) { while (x % i == 0) { x /= i; k--; } } if (x > 1) k--; return k; } void solve() { int n, m, k; cin >> n >> m >> ...
C++
b58a18119ac8375f9ad21a282292a76c
d4dc3da8c2c9d362214847b5404e8f76
1,700
PASSED
#include<bits/stdc++.h> using namespace std; int test(int a, int k) { //ι™€εŽ»ζ―δΈͺζ•°ηš„θ΄¨ε› ε­ηŸ₯ι“θ΄¨ε› ε­δΈθƒ½ε†ι™€οΌŒζ“δ½œζ•°ε‡εŽ»1 for (int i = 2; i * i <= a; i++) { while (a % i == 0) { a /= i; k--; } } if (a > 1) k--; return k; } int main() { int t;...
C++
b58a18119ac8375f9ad21a282292a76c
d7e695c84073d28c63a0980408672740
1,700
PASSED
//https://codeforces.com/problemset/problem/1538/A import java.util.Scanner; public class Stone_Game { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int testcase = sc.nextInt(); while (testcase-- != 0) { int len = sc.nextInt(), min = 999...
Java
d5fc2bc618dd9d453a5e7ae30ccb73f3
ac9fe14d1235c3098b302363d43f1e05
800
PASSED
import java.util.*; public class solution{ public static void main(String args[]){ Scanner scn=new Scanner(System.in); int T=scn.nextInt(); for(int t=1;t<=T;t++){ int n = scn.nextInt(); int arr[]=new int[n]; int min=Integer.MAX_VALUE; int max=I...
Java
d5fc2bc618dd9d453a5e7ae30ccb73f3
de05dae941c5988f43ecffef258ed1d8
800
PASSED
import java.util.*; public class Solution{ public static void main(String[] args){ int test , val,ans; Scanner sc = new Scanner(System.in); test = sc.nextInt(); for(int i = 0 ; i < test ; i++){ int lr = 0 , rl = 0 , ll = 0, rr = 0; int index1 = -1 ,...
Java
d5fc2bc618dd9d453a5e7ae30ccb73f3
0ca0221e9fc716c7317dfa452eaeea29
800
PASSED
import java.util.*; public class Problems { public static void main(String[] args) { Scanner input=new Scanner(System.in); int t=input.nextInt(); while (t--!=0) { int n=input.nextInt(),maxPos=0,minPos=0; int[] arr=new int[n]; for (int i = 0; i < ar...
Java
d5fc2bc618dd9d453a5e7ae30ccb73f3
2e0f93156ff1a732f07db24b6728f1cf
800
PASSED
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t>0){ int n = sc.nextInt(); int min=n,iMin=0,max=-1,iMax=0,cur=0,res=0; for(int i=0;i<n;++i){ cur = sc.nextI...
Java
d5fc2bc618dd9d453a5e7ae30ccb73f3
0b64b6dd43eae33fd3cb1925a2a90c15
800
PASSED
import java.util.Scanner; public class baitap { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int testcase = sc.nextInt(); while (testcase-- != 0) { int[] a = new int[101]; int n = sc.nextInt(); int max = -1000000;...
Java
d5fc2bc618dd9d453a5e7ae30ccb73f3
0f3424177945f8b8dbbf45a83711debf
800
PASSED
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0) { int n = sc.nextInt(); int[] a = new int[n]; int max = Integer.MIN_VALUE; in...
Java
d5fc2bc618dd9d453a5e7ae30ccb73f3
00aadd4aeea5b1ee27a37bdac8eec148
800
PASSED
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; public class A_Stone_Game { public static void main(String[] args) throws IOException { InputStream...
Java
d5fc2bc618dd9d453a5e7ae30ccb73f3
c66e26d7807de6f2635d6e55f5cc2441
800
PASSED
import java.util.*; public class A_Stone_Game{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); for(int i=0;i<t;i++){ int n=sc.nextInt(); List<Integer> list=new ArrayList<>(); int min_id=0; ...
Java
d5fc2bc618dd9d453a5e7ae30ccb73f3
242edcd3148293c0258d4e641114bf0e
800
PASSED
import java.util.Scanner; public class Problem1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t > 0) { int n = sc.nextInt(); int min = sc.nextInt(); int max = min; int min...
Java
d5fc2bc618dd9d453a5e7ae30ccb73f3
6a04d9c8a1a1ba12f894b37451a35249
800
PASSED
#include<bits/stdc++.h> using namespace std; int main(){ int n,t; cin>>t; while(t--){ cin>>n; int sum=0; int A[n]; for(int i=0 ; i<n ; i++) {cin>>A[i]; sum+=A[i];} if(sum%n!=0) cout<<-1<<endl; else{ int c=0,avg=sum/n; for(int i = 0; i < n; ++i) if (A[i]>avg) c++; cou...
C++
b8554e64b92b1b9458955da7d55eba62
4f742fd98b2d3b6172e897f1010d24c3
800
PASSED
#include<bits/stdc++.h> #define int long long int using namespace std; int32_t main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int t=1; cin>>t; while(t--){ int n; cin>>n; int ar[n]; int sum = 0; for (int i = 0; ...
C++
b8554e64b92b1b9458955da7d55eba62
4bb29411d8a6c6c5745821adae399f3f
800
PASSED
#include<bits/stdc++.h> #define LL long long #define x first #define y second using namespace std; const int N=1000010; const int K=1010; typedef pair<int,int> PII; int a[N]; int main() { int t; cin >> t; while(t--) { int n; cin >> n; int avg = 0; for(int i=0; i<n;...
C++
b8554e64b92b1b9458955da7d55eba62
52afab25218beaec24dce34d1e7df6ec
800
PASSED
#include<iostream> #include<cstdio> #include<cstring> using namespace std; int t,n,a[200010]; int s,k; int main() { cin>>t; while (t--) { memset(a,0,sizeof(a)); s=0; cin>>n; for (int i=1;i<=n;i++) { scanf("%d",&a[i]); s=s+a[i]; } if (s%n!=0) printf("%d\n",-1); else { k=0; s=s/n; for ...
C++
b8554e64b92b1b9458955da7d55eba62
171db4b003a20f0afb4add4a0d24e5d0
800
PASSED
// BELIEVE IN YOURSELF #include <bits/stdc++.h> using namespace std; typedef long long ll; void speed(){ ios::sync_with_stdio(false); cout.tie(NULL); } void txt(){ freopen("input.txt", "rt", stdin); freopen("output.txt", "wt", stdout); } int main() { speed(); int t; cin >> t; int n; while(...
C++
b8554e64b92b1b9458955da7d55eba62
27d7fadc38d71ce134dc218c58b23f49
800
PASSED
#include<bits/stdc++.h> using namespace std; int t,n,num,sum; int a[1000000]; int main() { ios::sync_with_stdio(false); cin.tie(0);cout.tie(0); cin>>t; while(t--) { num=0;sum=0; cin>>n; for(int i=1;i<=n;i++) cin>>a[i],sum+=a[i]; if(sum%n!=0) { cout<<"-1"<<endl; continue; } else sum/=n; for(in...
C++
b8554e64b92b1b9458955da7d55eba62
dddf74043c1d33f7c9e3459c298a9794
800
PASSED
#include <iostream> using namespace std; int main() { int n; cin >> n; while (n--){ int k; cin >> k; int arr[k],sum = 0,cnt = 0; for (int i =0; i < k; ++i){ cin >> arr[i]; sum +=arr[i]; } if (sum % k != 0) cout << -1 << endl; else { for ( int i =0...
C++
b8554e64b92b1b9458955da7d55eba62
2b1d2175f6019721205ca4aafe1fe4ec
800
PASSED
#include <bits/stdc++.h> using namespace std; using ll = long long; constexpr int MAXN = 2e5 + 10; int num[MAXN]; int main() { // freopen("input.txt", "r", stdin); ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int tt, n; cin >> tt; while (tt--) { cin >> n; for (int i ...
C++
b8554e64b92b1b9458955da7d55eba62
7d98666f4ed5d49883a56035e91ac180
800
PASSED
#include<iostream> #include<algorithm> using namespace std; int main() { int t; cin >> t; int cho[200005]; for (int i = 0; i < t; i++) { int n = 0; int cnt = 0; cin >> n; for (int i = 0; i < n; i++) { cin >> cho[i]; cnt += cho[i]; } if (cnt % n != 0) { cout << "-1" << endl; continue; ...
C++
b8554e64b92b1b9458955da7d55eba62
6e80f7e07d7cd0c6b3a2440d5e875117
800
PASSED
#include<bits/stdc++.h> #include<algorithm> using namespace std; int main() { int t; cin>>t; for(int i=0;i<t;i++) { int n,sum=0,k=-1; cin>>n; int a[n]; for(int j=0;j<n;j++) { cin>>a[j]; sum+=a[j]; } if(sum%n==0) { ...
C++
b8554e64b92b1b9458955da7d55eba62
1cd89a6c6794e2bce1b3cde7406d86d9
800
PASSED
//jiudge: 2444 #include <bits/stdc++.h> using namespace std; int a[1010]; int main(){ int t; cin>>t; while(t--){ int l,r; cin>>l>>r; int x=0,y=0; while(l){ x=x+l; l=l/10; } while(r){ y=y+r; r=r/10; } cout<<y-x<<'\n'; } return 0; }
C++
7a51d536d5212023cc226ef1f6201174
3360212781cc127c77e1f2106fbb5a3b
1,500
PASSED
//jiudge: 2425 #include<bits/stdc++.h> using namespace std; typedef long long ll; void solve(){ int l,r,a=0; cin>>l>>r; if(l<10&&r<10){ cout<<r-l<<"\n"; return; } while(l!=0){ a+=r-l; l/=10; r/=10; } while(r!=0){ a+=r; r/=10; } cout<<a<<"\n"; } int main(){ ios::sync_with_stdio(false); int t;...
C++
7a51d536d5212023cc226ef1f6201174
949aa0a5d03ea84ca6f90d97754b9d56
1,500
PASSED
//jiudge: 2411 #include<bits/stdc++.h> using namespace std; #define itn int #define dbg(x...) do{cout<<#x<<" -> ";err(x);}while (0) void err(){cout<<'\n';} template<class T, class... Ts> void err(T arg, Ts... args) { cout<<arg<< ' '; err(args...); } #define int long long #define INF 0x3f3f3f3f #define pii pair...
C++
7a51d536d5212023cc226ef1f6201174
acdf72e7c851dc6479a350098825732f
1,500
PASSED
//jiudge: 2359 #include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ int t; ll l,r,sum; scanf("%d",&t); for(int i=1;i<=t;i++){ scanf("%lld%lld",&l,&r); sum=0; while(l!=0){ sum+=r-l; l/=10; r/=10; } while(r!=0){ sum+=r; r/=10; } printf("%lld\n",sum); } return 0...
C++
7a51d536d5212023cc226ef1f6201174
d77731e1cd3360d264c0acc18386d818
1,500
PASSED
#include<bits/stdc++.h> using namespace std; #define digit floor(log10(n) + 1) #define ll long long #define ld long double #define test_case ll t;cin>>t;while(t--) #define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr); #define all(v) begin(v),end(v) #define loop(i,x,y) for(ll...
C++
7a51d536d5212023cc226ef1f6201174
279de8bafbef60c14cc5954d809f92d3
1,500
PASSED
//jiudge: 2461 #include <bits/stdc++.h> using namespace std; int a[1010]; int main(){ int t; cin>>t; while(t--){ int l,r; cin>>l>>r; int x=0,y=0; while(l){ x=x+l; l=l/10; } while(r){ y=y+r; r=r/10; } cout<<y-x<<'\n'; } return 0; }
C++
7a51d536d5212023cc226ef1f6201174
92d252a35ab977ce7ff3d9f45d8851a8
1,500
PASSED
//jiudge: 2408 #include<stdio.h> int main(){ int t; scanf("%d",&t); for(int i=1;i<=t;i++){ int n,m,k; k=0; scanf("%d%d",&n,&m); int a[10]={0}; int s=n; while(s!=0){ a[k]=s%10; s=s/10; k++; } int sum; sum=m-n; int jin; jin=m-n; int g=0; while(jin>0){ jin=(jin+a[g])/10; g++; ...
C++
7a51d536d5212023cc226ef1f6201174
0562eeb910eb8ad907aacd68df2f8026
1,500
PASSED
//jiudge: 2150 #include <iostream> using namespace std; int n,l,r,t,ans,ans1; int main () { cin >> t; for (int i = 1; i <= t; i++){ cin >> l >> r; ans=0; while (r > 0) { ans=ans+r; r/=10; } ans1=0; while (l > 0) { ans1=ans1+l; l/=10; } cout << ans-ans1 << '\n'; } }
C++
7a51d536d5212023cc226ef1f6201174
bf5fd538bacd851fb188fba8e571deb6
1,500
PASSED
//jiudge: 2027 #include<stdio.h> int main(){ int t,l,r; scanf("%d",&t); while(t--){ scanf("%d%d",&l,&r); int sum=0; while(r>0){ sum+=r-l; r=r/10; if(l!=0){ l=l/10; } } printf("%d\n",sum); } }
C++
7a51d536d5212023cc226ef1f6201174
1680167b592d6c72aaf7df043ca42080
1,500
PASSED
#include <bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--){ long long int l,r; cin>>l>>r; long long int diff=0; int g=10; while(l!=0 || r!=0){ diff=diff+(r-l); r=r/10; l=l/10; } cout<<diff<<"\n"; } ...
C++
7a51d536d5212023cc226ef1f6201174
8cc32417fdae70f8ca587e663165171d
1,500
PASSED
// Created by ash_98 #include<bits/stdc++.h> using namespace std; #define mx 200005 #define ll long long #define mod 1000000007 int ar[mx]; char ch[mx]; int n,m,ii,k; int x,y,a,b; void solve() { scanf("%d%d%d%d",&x,&y,&a,&b); if(x>y)swap(x,y); if(a>b)swap(a,b); int be=1,en=y; ...
C++
e6eb839ef4e688796050b34f1ca599a5
a6b56c185746ad4c714b59aaaf374a95
2,100
PASSED
//Common Header Simple over C++11 #pragma GCC optimize("Ofast") #pragma GCC optimize ("unroll-loops") #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair<int,int> pii; #include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds...
C++
e6eb839ef4e688796050b34f1ca599a5
bb280e9807cdd8de77dc67f4a200bd90
2,100
PASSED
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; int T; int X, Y, A, B; long double get_cnt(int b_cnt) { long double remain_x = X - b_cnt * A; long double remain_y = Y - b_cnt * B; return b_cnt + min(remain_x / B, remain_y / A); } int get_a...
C++
e6eb839ef4e688796050b34f1ca599a5
136211406d7c70b6a9538c54f7edcd89
2,100
PASSED
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; int T; int X, Y, A, B; long double get_cnt(int b_cnt) { long double remain_x = X - b_cnt * A; long double remain_y = Y - b_cnt * B; return b_cnt + min(remain_x / B, remain_y / A); } int get_a...
C++
e6eb839ef4e688796050b34f1ca599a5
2b26af27e1a54c1e8bb4a23f63c93609
2,100
PASSED
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; int T; int X, Y, A, B; long double get_cnt(int b_cnt) { long double remain_x = X - b_cnt * A; long double remain_y = Y - b_cnt * B; return b_cnt + min(remain_x / B, remain_y / A); } int get_a...
C++
e6eb839ef4e688796050b34f1ca599a5
64b37f8c52ed95c7d6f6a7c68e967a89
2,100
PASSED
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; int T; int X, Y, A, B; long double get_cnt(int b_cnt) { long double remain_x = X - b_cnt * A; long double remain_y = Y - b_cnt * B; return b_cnt + min(remain_x / B, remain_y / A); } int get_a...
C++
e6eb839ef4e688796050b34f1ca599a5
f85156778e033a33c336930d6ff91146
2,100
PASSED
#include <bits/stdc++.h> using namespace std; long double calc(long double X, long double Y, long double A, long double B, long double C) { long double ans = C; X -= A * C; Y -= B * C; ans += min(X / B, Y / A); return ans; } long long solve(int X, int Y, int A, int B) { l...
C++
e6eb839ef4e688796050b34f1ca599a5
f39b1700cdce2f3814ac7c2a90908355
2,100
PASSED
#include <algorithm> #include <array> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <cstring> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <vector> using namesp...
C++
e6eb839ef4e688796050b34f1ca599a5
7ce2374105fe67bd04ad49e902694bb3
2,100
PASSED
// Problem: G. Gift Set // Contest: Codeforces - Codeforces Round #725 (Div. 3) // URL: https://codeforces.com/contest/1538/problem/G // Memory Limit: 256 MB // Time Limit: 2000 ms // Time : 2021-09-25 10:24:09 #include <bits/stdc++.h> #include <unordered_map> #include <unordered_set> #define mem(a, b) memset(...
C++
e6eb839ef4e688796050b34f1ca599a5
87812b553496626252fd3581e632add7
2,100
PASSED
// Problem: G. Gift Set // Contest: Codeforces - Codeforces Round #725 (Div. 3) // URL: https://codeforces.com/contest/1538/problem/G // Memory Limit: 256 MB // Time Limit: 2000 ms // Time : 2021-09-25 10:24:09 #include <bits/stdc++.h> #include <unordered_map> #include <unordered_set> #define mem(a, b) memset(...
C++
e6eb839ef4e688796050b34f1ca599a5
21038781af1fe8abaf20f8997f195871
2,100
PASSED
#include <bits/stdc++.h> #define ll long long using namespace std; ll calHahas(string s, string& t){ int n = s.size(), m = t.size(); ll cnt = 0; for (int i = 0; i <= n - m; i++){ if (s.substr(i, t.size()) == t) cnt++; } return cnt; } string calString(string a){ if (a.size() <...
C++
356bd72aa9143681f1efd695969a8c8e
5e120924f26d658590a775a939878c87
2,100
PASSED
#include <bits/stdc++.h> #define ll long long using namespace std; ll calHahas(string s, string& t){ int n = s.size(), m = t.size(); ll cnt = 0; for (int i = 0; i <= n - m; i++){ if (s.substr(i, t.size()) == t) cnt++; } return cnt; } string getPref(string& s) { return s.subst...
C++
356bd72aa9143681f1efd695969a8c8e
f4337606749e620ea141ae29f5ce1aad
2,100
PASSED
/*#pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("sse,sse2,sse3,ssse3,abm,mmx,tune=native")*/ #include <bits/stdc++.h> using namespace std; #define yesno(x) puts(reinterpret_cast<const char*>(&(const int&)(218124110 - (x) * 01453204765))) #define all(x) (x).begin(), (x...
C++
356bd72aa9143681f1efd695969a8c8e
4ca020ae7d7d59a8926dd3f75d59b65c
2,100
PASSED
#include <bits/stdc++.h> //Macro fun using ll = long long; #define pb push_back #define all(x) x.begin(), x.end() #define sz(x) (int)x.size() #define vi vector<int> #define vl vector<ll> #define pii pair<int,int> #define vii vector<pii> #define pll pair<ll,ll> #define vs vector<string> #define vll vector...
C++
356bd72aa9143681f1efd695969a8c8e
7a5e83502f3e40d3b33c9f7e79c61a42
2,100
PASSED
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> //#include <unordered_map> //#inc...
C++
356bd72aa9143681f1efd695969a8c8e
1b7dd7132d7232126ec7e7af68c92eba
2,100
PASSED
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> //#include <unordered_map> //#inc...
C++
356bd72aa9143681f1efd695969a8c8e
4931e5ed2ac55cb22b2400a043c6d956
2,100
PASSED
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> //#include <unordered_map> //#inc...
C++
356bd72aa9143681f1efd695969a8c8e
ffba138f3896331ead363720606a16d8
2,100
PASSED
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> //#include <unordered_map> //#inc...
C++
356bd72aa9143681f1efd695969a8c8e
61b47dd7f37f3880405296e7591a7649
2,100
PASSED
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> //#include <unordered_map> //#inc...
C++
356bd72aa9143681f1efd695969a8c8e
0ae494b427377fca06b0e6eca6dfafe4
2,100
PASSED
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> //#include <unordered_map> //#inc...
C++
356bd72aa9143681f1efd695969a8c8e
3d5298a82ffd4b334372b4c6dc5e9e0e
2,100
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll ceil(ll a, ll b) { if(a%b==0) return a/b; return (ll)(a/b)+1; } void solve() { ll y, n, k; cin >> y >> n >> k; if(y==k) { cout << "YES" << endl; return; } if(y < k) { cout << "NO...
C++
bdbd3420d9aa85b3143a87c5fa530f31
af3c838e6bf020a774789f51206a1dbf
2,400
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll ceil(ll a, ll b) { if(a%b==0) return a/b; return (ll)(a/b)+1; } void solve() { ll y, n, k; cin >> y >> n >> k; if(y==k) { cout << "YES" << endl; return; } if(y < k) { cout << "...
C++
bdbd3420d9aa85b3143a87c5fa530f31
20913aeda5943e2eff3e48652e04c21d
2,400
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; // return ceil(a / b) ll ceil(ll a, ll b) { if(a%b==0) return a/b; return (a-a%b)/b + 1; } void solve() { ll y, n, k; cin >> y >> n >> k; if(y==k) { cout << "YES" << endl; return; } if(...
C++
bdbd3420d9aa85b3143a87c5fa530f31
d67e40851633dbe8c3b70e2ef4f342f8
2,400
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll ceil(ll a, ll b) { if(a%b==0) return a/b; return (ll)(a/b)+1; } void solve() { ll y, n, k; cin >> y >> n >> k; if(y==k) { cout << "YES" << endl; return; } if(y < k) { cout <<...
C++
bdbd3420d9aa85b3143a87c5fa530f31
fb6c96a2fe03bacdb98ec9faaf291502
2,400
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; // return ceil(a / b) ll ceil(ll a, ll b) { if(a%b==0) return a/b; return (a-a%b)/b + 1; } void solve() { ll y, n, k; cin >> y >> n >> k; if(y==k) { cout << "YES" << endl; return; } if(...
C++
bdbd3420d9aa85b3143a87c5fa530f31
017d4501504ba8a6fb95b3d8b0eb006f
2,400
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; // return ceil(a / b) ll ceil(ll a, ll b) { if(a%b==0) return a/b; return (a-a%b)/b + 1; } void solve() { ll y, n, k; cin >> y >> n >> k; if(y==k) { cout << "YES" << endl; return; } if(...
C++
bdbd3420d9aa85b3143a87c5fa530f31
e9ea31d5621f8a937f8ebda2705bdb0c
2,400
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; // return ceil(a / b) ll ceil(ll a, ll b) { if(a%b==0) return a/b; return (a-a%b)/b + 1; } void solve() { ll y, n, k; cin >> y >> n >> k; if(y==k) { cout << "YES" << endl; return; } if(...
C++
bdbd3420d9aa85b3143a87c5fa530f31
48d916fc77287f4f88336b5183be055a
2,400
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; // return ceil(a / b) ll ceil(ll a, ll b) { if(a%b==0) return a/b; return (a-a%b)/b + 1; } void solve() { ll y, n, k; cin >> y >> n >> k; if(y==k) { cout << "YES" << endl; return; } if(...
C++
bdbd3420d9aa85b3143a87c5fa530f31
f08cf0804050257ff81e3056d90c6cc1
2,400
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; // return ceil(a / b) ll ceil(ll a, ll b) { if(a%b==0) return a/b; return (a-a%b)/b + 1; } void solve() { ll y, n, k; cin >> y >> n >> k; if(y==k) { cout << "YES" << endl; return; } if(...
C++
bdbd3420d9aa85b3143a87c5fa530f31
65f21f3231a4bc3200fdd805b25c7fba
2,400
PASSED
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using str = string; #define mset multiset #define all(x) (x).begin(), (x).end() #define sz(x) int((x).size()) #define g0 get<0> #define g1 get<1> #define g2 get<2> #define g3 get<3> ...
C++
bdbd3420d9aa85b3143a87c5fa530f31
a97bd611ec3218e3c30b37f465182f14
2,400
PASSED
#include <bits/stdc++.h> using namespace std; #include <xmmintrin.h> //speed #define ios ios_base::sync_with_stdio(false);cin.tie(0); cout.tie(0); #define nl "\n" #define int long long using namespace std; #define fr first #define sc second #define all(a) a.begin(),a.end() #define yes cout<<"YES"<<endl #def...
C++
3b8969f7f2051d559a1e375ce8275c73
9a584959615269b578b6dcbc2868d8e2
1,200
PASSED
#include <bits/stdc++.h> using namespace std; const int MAX_N = 3 * 1e5; int ids[MAX_N]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int T; cin >> T; while (T--) { int n; char c; cin >> n >> c; string s; cin >> s;...
C++
3b8969f7f2051d559a1e375ce8275c73
e6eabd739dd5559ffd96b63bd1b1ae54
1,200
PASSED
#include "bits/stdc++.h" #include "unistd.h" #pragma GCC optimize("O3") #pragma GCC target("sse4") using namespace std; #define ll long long int #define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define inp(v) for(ll i = 0; i < n; i++) cin>>v[i]; #define loop(i,st,n) for(ll i = st; i...
C++
3b8969f7f2051d559a1e375ce8275c73
12300e6356df93e8ff26e53f870667cd
1,200
PASSED
#include<bits/stdc++.h> using namespace std; int main(){ int T; cin >> T; while(T--){ char s[300005] = {0} , ans; int n , jua = 0; cin >> n; cin >> ans; for(int i = 1 ; i <= n ; i++){ cin >> s[i]; if(s[i] != ans)jua = 1; } if(!jua){ cout << 0 << endl; continue; } for(int i = 2...
C++
3b8969f7f2051d559a1e375ce8275c73
0d430a46c2d9ad35fd10d04c1c14afdf
1,200
PASSED
#include<iostream> #include<string> using namespace std; void solve() { int n; char c; string s; cin>>n>>c>>s; int flag=0; for(int i=0;i<n;i++) if(s[i]!=c) flag=1; if(!flag){ cout<<"0"<<endl; return ; } if(s[n-1]==c) { cout<<"1"<<endl; cout<<n<<end...
C++
3b8969f7f2051d559a1e375ce8275c73
535b91de2e0587e7a0a2c6746fbc70cd
1,200
PASSED
#include "bits/stdc++.h" using namespace std; int t, n; char ch; string str; int main() { cin >> t; while (t--) { cin >> n >> ch >> str; int flag = 0; for (int i = 0; i < str.size(); i++) if (str[i] != ch) { flag = 1; break; ...
C++
3b8969f7f2051d559a1e375ce8275c73
0cd660f4d5c8d8dbb983929423034802
1,200
PASSED
#include <bits/stdc++.h> using namespace std; using ll=long long int; int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif ll t; cin>>t; while(t--){ ll n; char c; cin>>n>>c; string s; cin>>s; int result=0; ll ans=0; ll res=c...
C++
3b8969f7f2051d559a1e375ce8275c73
f2277697b83e10d47a99ab9549f302d9
1,200
PASSED
#include <bits/stdc++.h> using namespace std; using ll=long long int; int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif ll t; cin>>t; while(t--){ ll n; char c; cin>>n>>c; string s; cin>>s; int result=0; ll ans=0; ll res=c...
C++
3b8969f7f2051d559a1e375ce8275c73
1f8b98cdaf0935e428deb8e076481397
1,200
PASSED
#include<bits/stdc++.h> using namespace std; #define ll long long #define all(v) ((v).begin()), ((v).end()) #define pi acos(-1) #define ln <<"\n" const int N = 1e9 + 7; void RUN(); void ROUND(int n); long long gcd(long long a, long long b); bool ok(vector<ll> &a, ll n, ll x, ll h) { ll sum = 0;...
C++
3b8969f7f2051d559a1e375ce8275c73
3e3e7ccae1f26e0fd12cfae3296c1bfe
1,200
PASSED
// JAY SWAMINARAYAN // // DIGANT SHELADIYA // // Codeforce:Digant0204 // /* β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ”Œβ”€β”€β”€β”β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ”Œβ”β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ...
C++
3b8969f7f2051d559a1e375ce8275c73
edfb68c60778e93ec14be0bcdc3c437a
1,200
PASSED
#include <bits/stdc++.h> using namespace std; #define ll long long int #define ld long double #define pb push_back #define fi first #define se second #define mp make_pair #define mt make_tuple #define all(A) A.begin(), A.end() #define sz(A) (int)A.size() typedef vector <int> vi; typedef vector <ll> vl; t...
C++
a18692e5fe2f98717608449b1d9b77f7
e97712e46140b2b13bcbbcd0a39c7f1c
1,700
PASSED
#include <cstdio> #include <cstring> #include <vector> #include <algorithm> const int maxn = (int)2e5 + 5; int par[maxn * 2]; int cnt[maxn * 2]; char c[20]; int getRoot (int x) { return par[x] < 0 ? x : par[x] = getRoot(par[x]); } bool mergeSet (int x, int y) { x = getRoot(x); y = getRoot...
C++
a18692e5fe2f98717608449b1d9b77f7
dda2fd8a0c1ace659e1e82ca9c669dd8
1,700
PASSED
#include <cstdio> #include <cstring> #include <vector> #include <algorithm> const int maxn = (int)2e5 + 5; int par[maxn * 2]; int cnt[maxn * 2]; char c[20]; int getRoot (int x) { return par[x] < 0 ? x : par[x] = getRoot(par[x]); } bool mergeSet (int x, int y) { x = getRoot(x); y = getRoot...
C++
a18692e5fe2f98717608449b1d9b77f7
37fb4b7f4abcd94d1bcf1541e6a31356
1,700
PASSED
#include <cstdio> #include <cstring> #include <vector> #include <algorithm> const int maxn = (int)2e5 + 5; int par[maxn * 2]; int cnt[maxn * 2]; char c[20]; int getRoot (int x) { return par[x] < 0 ? x : par[x] = getRoot(par[x]); } bool mergeSet (int x, int y) { x = getRoot(x); y = getRoot...
C++
a18692e5fe2f98717608449b1d9b77f7
2ccf258b3f1d14cd4ac1326b28eacbe9
1,700
PASSED
#include <cstdio> #include <cstring> #include <vector> #include <algorithm> const int maxn = (int)2e5 + 5; int par[maxn * 2]; int cnt[maxn * 2]; char c[20]; int getRoot (int x) { return par[x] < 0 ? x : par[x] = getRoot(par[x]); } bool mergeSet (int x, int y) { x = getRoot(x); y = getRoot...
C++
a18692e5fe2f98717608449b1d9b77f7
db407b859c107510816ddb599106a683
1,700
PASSED
#include <cstdio> #include <cstring> #include <vector> #include <algorithm> const int maxn = (int)2e5 + 5; int par[maxn * 2]; int cnt[maxn * 2]; char c[20]; int getRoot (int x) { return par[x] < 0 ? x : par[x] = getRoot(par[x]); } bool mergeSet (int x, int y) { x = getRoot(x); y = getRoot...
C++
a18692e5fe2f98717608449b1d9b77f7
fce538dd19c3dc374cc89944d625482e
1,700
PASSED
#include <cstdio> #include <cstring> #include <vector> #include <algorithm> const int maxn = (int)2e5 + 5; int par[maxn * 2]; int cnt[maxn * 2]; char c[20]; int getRoot (int x) { return par[x] < 0 ? x : par[x] = getRoot(par[x]); } bool mergeSet (int x, int y) { x = getRoot(x); y = getRoot...
C++
a18692e5fe2f98717608449b1d9b77f7
2a2ce1c64b69d7515a62cfbb9a3df098
1,700
PASSED
#include <cstdio> #include <cstring> #include <vector> #include <algorithm> const int maxn = (int)2e5 + 5; int par[maxn * 2]; int cnt[maxn * 2]; char c[20]; int getRoot (int x) { return par[x] < 0 ? x : par[x] = getRoot(par[x]); } bool mergeSet (int x, int y) { x = getRoot(x); y = getRoot...
C++
a18692e5fe2f98717608449b1d9b77f7
0f7685b801648e991d251eb26ccc95e1
1,700
PASSED
#include <cstdio> #include <cstring> #include <vector> #include <algorithm> const int maxn = (int)2e5 + 5; int par[maxn * 2]; int cnt[maxn * 2]; char c[20]; int getRoot (int x) { return par[x] < 0 ? x : par[x] = getRoot(par[x]); } bool mergeSet (int x, int y) { x = getRoot(x); y = getRoot...
C++
a18692e5fe2f98717608449b1d9b77f7
51a7e84a64d76c454b419bfdfbad3d12
1,700
PASSED
#include <cstdio> #include <cstring> #include <vector> #include <algorithm> const int maxn = (int)2e5 + 5; int par[maxn * 2]; int cnt[maxn * 2]; char c[20]; int getRoot (int x) { return par[x] < 0 ? x : par[x] = getRoot(par[x]); } bool mergeSet (int x, int y) { x = getRoot(x); y = getRoot...
C++
a18692e5fe2f98717608449b1d9b77f7
82f6fbffeed3e403d7d3ba3f95c91ae9
1,700
PASSED
#include <bits/stdc++.h> #define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL) #define ll long long int #define ed endl #define pb push_back #define _ " " // for #define for_si for(ll i=0;i<s.size();i++) #define for_ai for(ll i=0;i<n;i++) #define for_aj for(ll j=0;j<n;j++) #define for...
C++
a4628208668e9d838cd019e9dc03e470
6fd3968180d8d547c16e2f4f014c73ee
800
PASSED