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
for _ in range(int(input())): n,k=map(int,input().split()) s=input() last1=n-1 numbers=1 for i in range(n-1,-1,-1): if s[i]=='0': if last1-i>k: numbers+=1 last1=i else: if last1-i<=k: numbers-=1 last1...
Python
fd85ebe1dc975a71c72fac7eeb944a4a
75a99ff5f01d7194d34689f4207b70a0
1,300
PASSED
import math t=int(input()) for _ in range(t): n,m=map(int, input().split()) s=input() l=list(s) l1=[] for i in range(len(l)): if l[i]=='1': l1.append(i) if len(l1)==0: num=math.ceil(n/(m+1)) print(num) else: val=l1[0]//(m+1) for i in range(...
Python
fd85ebe1dc975a71c72fac7eeb944a4a
792e56ad2c5c45d5c4ba2ebe6b6580a9
1,300
PASSED
""" ____ _ _____ / ___|___ __| | ___| ___|__ _ __ ___ ___ ___ | | / _ \ / _` |/ _ \ |_ / _ \| '__/ __/ _ \/ __| | |__| (_) | (_| | __/ _| (_) | | | (_| __/\__ \ \____\___/ \__,_|\___|_| \___/|_| \___\___||___/ """ """ โ–‘โ–‘โ–ˆโ–ˆโ–„โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–„โ–ˆโ–ˆ โ–‘โ–„โ–€โ–‘โ–ˆโ–„โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–„โ–ˆโ–‘โ–‘โ–ˆโ–‘ โ–‘โ–ˆโ–‘โ–„โ–‘โ–ˆโ–„โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–„โ–ˆโ–‘โ–„โ–‘โ–ˆโ–‘ โ–‘โ–ˆโ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ...
Python
fd85ebe1dc975a71c72fac7eeb944a4a
c133846ccc65f3d29ae4d2edad2a9eb9
1,300
PASSED
def string(n,k,s): ans=0 if s[0]=="0" and "1" not in s[:k+1]: s="1"+s[1:] ans+=1 for i in range(k,n): if s[i]=="0": if "1" not in s[i-k:i+k+1]: ans+=1 s=s[:i]+"1"+s[i+1:] return ans t=int(input()) array=[] for i in range(t): a,b=l...
Python
fd85ebe1dc975a71c72fac7eeb944a4a
1c115040e255e26b8fa95a112eb15af7
1,300
PASSED
for _ in range(int(input())): n,k = map(int, input().split()) s = input() ans = 0 i = 0 while i<n: if s[i]=='0': j = i+1 while j<n: if s[j]=='0': j+=1 else: break if i==0 and j==n: ...
Python
fd85ebe1dc975a71c72fac7eeb944a4a
3dea635d46a1163e54aebaa49e5680ad
1,300
PASSED
from math import inf for _ in range(int(input())): n, k = map(int, input().split()) s = input() kk = inf f = True ans = 0 li = -inf i = 0 for c in s: if c == '0': if kk >= k: kk = 0 ans += 1 li = i else: ...
Python
fd85ebe1dc975a71c72fac7eeb944a4a
bad249437e068c085c33438e3ce7a00d
1,300
PASSED
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #in...
C++
0870110338a84f76d4870d06dc9da2df
52a9f6cb9735c52c18bd54ec39b82c55
1,500
PASSED
#include <iostream> using namespace std; int n,m,x; char s[31][31]; int lower[26], upper[26]; int main() { cin >> n >> m >> x; for(int i=0;i<26;i++){ lower[i] = 0; upper[i] = 0; } for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ cin >> s[i][j]; } } bool h...
C++
0870110338a84f76d4870d06dc9da2df
919655a3342f687c2c7465132fc4a66b
1,500
PASSED
#include <iostream> using namespace std; int n,m,x; char s[31][31]; int lower[26], upper[26]; int main() { cin >> n >> m >> x; for(int i=0;i<26;i++){ lower[i] = 0; upper[i] = 0; } for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ cin >> s[i][j]; if(s[i][j]!='S...
C++
0870110338a84f76d4870d06dc9da2df
e634ce5a47882e9ff52002d278c36433
1,500
PASSED
#include <iostream> #include <sstream> #include <string> #include <vector> #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> #include <bitset> #include <list> #include <set> #include <map> using namespace std; #define DO(N) while(N--) #define REP(I, N) for (int I=0;I<int(N);++I) #define FOR(I...
C++
0870110338a84f76d4870d06dc9da2df
aa6cf5c34bf361c8e5f234c16650a95b
1,500
PASSED
//============================================================================ // Name : Keyboard.cpp // Author : alpc92 // Version : // Copyright : copyright by alpc92 // Description : Hello World in C++, Ansi-style //============================================================================ #incl...
C++
0870110338a84f76d4870d06dc9da2df
6cff987fafe47df02e9f6e43e55eb69e
1,500
PASSED
#include <cstdio> #include <string> #include <cstring> #include <iostream> #include <vector> #include <cmath> using namespace std; #define mp make_pair #define pb push_back typedef pair<int,int> pii; vector<pii> key[256]; int _kb[256], kb[50][50]; string s; int n, m, i, j, q, x, y, v, u, mindist, ans; char ch; int...
C++
0870110338a84f76d4870d06dc9da2df
18c61bfd3fcbd56446d9750eb3197c74
1,500
PASSED
#include <cstdio> #include <cstdlib> #include <cstring> #include <climits> #include <cmath> #include <ctime> #include <cassert> #include <iostream> #include <fstream> #include <sstream> #include <iomanip> #include <complex> #include <string> #include <vector> #include <list> #include <deque> #include <stack> #include <...
C++
0870110338a84f76d4870d06dc9da2df
c6ebb820173b21ced497a5c2f2f1dfaa
1,500
PASSED
//A,Elebereth,Gilthoniel mantae! #include<iostream> #include<algorithm> #include<cmath> #include<string> #include<vector> #include<set> #include<map> #include<cstdio> #include<fstream> #include<stack> #include<queue> #include<cstring> using namespace std; int n,m,x; bool T=1; int s=0; map<char,bool> z; map<char,vector...
C++
0870110338a84f76d4870d06dc9da2df
d0f2653fda30f6ad943eb687aec32b54
1,500
PASSED
#include <vector> #include <list> #include <map> #include <set> #include <deque> #include <queue> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <complex> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <c...
C++
0870110338a84f76d4870d06dc9da2df
b004d9babdfdfd4b627fd6bd39afa52c
1,500
PASSED
#include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> using namespace std; char mat[33][33]; char txt[500005]; int hav[300]; int yes[300]; int main() { int n, m, x, q, i, j, ii, jj, xx, yy, count, flag; char c; while( scanf("%d%d%d",&n, &m, &x) != EOF ) { for(...
C++
0870110338a84f76d4870d06dc9da2df
03554b86a6c5da28abe17cfa364ab069
1,500
PASSED
import java.io.*; import java.util.*; import java.math.*; public class E { public StringBuilder interleave(int n, char first, char second) throws Exception { StringBuilder sb = new StringBuilder(""); for(int i = 0; i < n; i++) { sb.append(first); sb.append(second); } return sb; } public String...
Java
7f45fba2c06fe176a2b634e8988076c2
65c7dec889d2d61ee2effbb31953c4cd
1,900
PASSED
import java.io.*; import java.util.*; public class Codeforces { static boolean isp[] = new boolean[1000001]; public static void main(String[] args) throws IOException{ Scanner s = new Scanner(System.in); StringBuffer sb = new StringBuffer(); int n = s.nextInt(); String a = s.next(); String b = s.next();...
Java
7f45fba2c06fe176a2b634e8988076c2
fdc25c6c4726bc19753fcf03e835f861
1,900
PASSED
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class Solver { public static void main(String[] args) throws IOException { new Solver().read(); } static Scanner in = new Scanner(System.in); st...
Java
7f45fba2c06fe176a2b634e8988076c2
9633f8ce23fea0e743c6c3bd89b9583d
1,900
PASSED
import javax.print.attribute.standard.PrinterMessageFromOperator; import java.io.*; import java.math.BigDecimal; import java.math.BigInteger; import java.util.*; public class Main { public static void main(String[] args) throws Exception { new Main().run();} // int[] h,ne,to,wt; // int ct = 0; // ...
Java
7f45fba2c06fe176a2b634e8988076c2
cade708d84fb485ebb0420ddade4513b
1,900
PASSED
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class Main { public static void main(String[] args) { new Thread(null, new Runnable() { public void run() { solve(); ...
Java
7f45fba2c06fe176a2b634e8988076c2
b13c2373ae6722175771e483595460af
1,900
PASSED
import java.util.*; import java.io.*; import java.text.*; public class E { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); PrintWriter pw = new PrintWriter(System.out); int n = sc.nextInt(); String x = sc.next(); String y = sc.next(); HashSet<String> abc = ...
Java
7f45fba2c06fe176a2b634e8988076c2
57199266c0f76cd98263d5d725de8192
1,900
PASSED
import java.io.*; import java.util.*; import java.math.*; public class E { static class InputReader { BufferedReader reader; StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream), 32768); token...
Java
7f45fba2c06fe176a2b634e8988076c2
ae9d0ce9ed3888f1ad8fba6ddef71dfb
1,900
PASSED
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(); PrintWriter out = new PrintWriter(Sy...
Java
7f45fba2c06fe176a2b634e8988076c2
d8941d2fa372bfe76c065ed3bf95e4ec
1,900
PASSED
/** * Created at 03:18 on 2019-08-31 */ import java.io.*; import java.util.*; public class Main { static FastScanner sc = new FastScanner(); static Output out = new Output(System.out); static final int[] dx = {0, 1, 0, -1}; static final int[] dy = {-1, 0, 1, 0}; static final long MOD = (long) (1e9 + 7)...
Java
7f45fba2c06fe176a2b634e8988076c2
91ee07811bae5b6458cb66cec41e29fd
1,900
PASSED
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Set; import java.io.IOException; import java.io.InputStreamReader; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import j...
Java
7f45fba2c06fe176a2b634e8988076c2
c583035e3ff7420b6def00eebb89f115
1,900
PASSED
#include <bits/stdc++.h> using namespace std; using ll = long long int; typedef pair<ll,ll> pll; using ld = long double; #define sz(v) (ll)v.size() #define pb push_back #define mp make_pair #define f first #define s second #define gcd(a,b) __gcd(a,b) #define all(v) v.begin(),v.end() inline ll getx(ll a,ll b,ll c) { ...
C++
79b58eb781cd73ccf7994866b9a8b695
a4efc15501a1c5380a8c8f85b8396631
1,700
PASSED
#include<bits/stdc++.h> using namespace std; #define int long long int #define m_p make_pair #define pb push_back #define ppb pop_back #define f first #define s second #define pii pair<int,int> #define ios ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define double long double const double pi=3.14159265358979; ...
C++
79b58eb781cd73ccf7994866b9a8b695
d2b9f64fec30c977b130c15796a3c1dc
1,700
PASSED
#include<bits/stdc++.h> using namespace std; #define int long long int #define m_p make_pair #define pb push_back #define ppb pop_back #define f first #define s second #define pii pair<int,int> #define ios ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define double long double const double pi=3.14159265358979; ...
C++
79b58eb781cd73ccf7994866b9a8b695
da2cae8cca518abda0beeb452f0df78c
1,700
PASSED
/* ุจูุณู’ู…ู ุงู„ู„ูŽู‘ู‡ู ุงู„ุฑูŽู‘ุญู’ู…ูŽูฐู†ู ุงู„ุฑูŽู‘ุญููŠู…ู */ //codeforces #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #define FASTIO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); #define mp make_pair #define pb push_back #define sz(v) ((int)v.size()) #...
C++
79b58eb781cd73ccf7994866b9a8b695
810bf2774f6aed4879c1b71ea392d364
1,700
PASSED
#include<bits/stdc++.h> using namespace std; int main() { int t; scanf("%d",&t); while(t--) { unsigned long long ng,nr,nb,i,j,k; unsigned long long sum=0,min=0,x,y,z; scanf("%lld %lld %lld",&nr,&ng,&nb); unsigned long long a[nr],b[ng],c[nb]; for(i=0;i<nr;i++) scanf("%lld",&a[i]); for(i=0;i<ng...
C++
79b58eb781cd73ccf7994866b9a8b695
bd2e080ea8fa42358af2b8d78d829a00
1,700
PASSED
#include<bits/stdc++.h> using namespace std; unsigned long long ng,nr,nb,i,j,k; unsigned long long sum=0; unsigned long long m=0; void solve(unsigned long long *a,unsigned long long *b,unsigned long long *c) { j=1; k=1; for(i=1;i<=a[0];i++){ while(j<b[0] && b[j+1]<=a[i])j++; while(k<c[0] && c[k]<a[i]...
C++
79b58eb781cd73ccf7994866b9a8b695
70fd466df1ba398c2eaca54e7ab68904
1,700
PASSED
#include<iostream> #include<cstring> #include<algorithm> #include<cmath> #include<cstdlib> #include<climits> #include<stack> #include<vector> #include<queue> #include<set> #include<bitset> #include<map> //#include<regex> #include<cstdio> #include <iomanip> #pragma GCC optimize(2) #define up(i,a,b) for(int i=a;i<b;i++)...
C++
79b58eb781cd73ccf7994866b9a8b695
d67b472f3bbcc0c0071ac57551e5eb34
1,700
PASSED
#pragma ggCC optimize("Ofast") # define _CRT_SECURE_NO_WARNINggS # include <iostream> # include <cmath> # include <algorithm> # include <stdio.h> # include <cstdint> # include <cstring> # include <string> # include <cstdlib> # include <vector> # include <bitset> # include <map> # include <queue> # include <ctime> # in...
C++
79b58eb781cd73ccf7994866b9a8b695
95de31ac05192a8d0fde7e9fa88be844
1,700
PASSED
#include<bits/stdc++.h> using namespace std; int const nax = 3e5 + 10; using ll = long long ; const ll inf = 1e17; int r[nax], g[nax], b[nax]; int nr, ng, nb; int bs (int * x, int val, int sz) { int l = 1, r = sz; int ans = -1; while (l <= r) { int mid = l + r >> 1; if (x[mid] <= val) ...
C++
79b58eb781cd73ccf7994866b9a8b695
27550ae117174fd03d6bd026022753a2
1,700
PASSED
#include<bits/stdc++.h> #define watch(x) cout << (#x) << " is " << (x) << endl using namespace std; ///////////////////////////////////Nikhil Srivastava//////////////////////////////////////// ///////////////////////////////////IIT Jodhpur////////////////////////////////////////////// /////////////////////////////////...
C++
adaae163882b064bf7257e82e8832ffb
71a628490b51de31987df5295c9c5a24
1,500
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long int ll; #define watch(x) cout << (#x) << " is " << (x) << endl #define mod(x, m) ((((x) % (m)) + (m)) % (m)) #define max3(a, b, c) max(a, max(b, c)) #define min3(a, b, c) min(a, min(b, c)) #define gcd __gcd #define nof1 __builtin_popcountll typedef long ...
C++
adaae163882b064bf7257e82e8832ffb
30af25bf184ecc5f8c8ed91e74297280
1,500
PASSED
#include<bits/stdc++.h> using namespace std; typedef long long int ll; #define watch(x) cout << (#x) << " is " << (x) << endl #define mod(x, m) ((((x) % (m)) + (m)) % (m)) #define max3(a, b, c) max(a, max(b, c)) #define min3(a, b, c) min(a, min(b, c)) #define gcd __gcd #define nof1 __builtin_popcountll typedef long ...
C++
adaae163882b064bf7257e82e8832ffb
0a4d13b8c8456fc9fb21f894efec3def
1,500
PASSED
#include<bits/stdc++.h> using namespace std; std::vector<long long> g[100001]; std::map<long double, long double> mp,pro; long double ans=0,k; void dfs(long long a) { long long c=0; mp[a]=1; for (long long i = 0; i < g[a].size(); ++i) { if (mp[g[a][i]]==0) { if (a!=1) { k=g[a].size()-1; pro[g[a][i...
C++
adaae163882b064bf7257e82e8832ffb
7746243073b02199b78c4432e37bcef6
1,500
PASSED
#include<bits/stdc++.h> using namespace std; std::vector<long long> g[100001]; std::map<long double, long double> p,mp,pro; long double ans=0,s=0,sum=0,k; void dfs(long long a) { long long c=0; mp[a]=1; for (long long i = 0; i < g[a].size(); ++i) { if (mp[g[a][i]]==0) { p[g[a][i]]=a; if (a!=1) { ...
C++
adaae163882b064bf7257e82e8832ffb
e0da24723c2c7ead2d045641f721f98d
1,500
PASSED
#include <cstdio> #include <vector> #include <queue> using namespace std; const int MAXN=100000; vector <int> v[MAXN+5]; vector <int> isl; long double ans; int N,vi[MAXN+5],k,a,f; double d[MAXN+5],p[MAXN+5],c[MAXN+5]; queue <int> q; void bfs(){ for(int i=0;i<=N;i++){vi[i]=d[i]=0;c[i]=1;} q.push(1); d[1]=0;...
C++
adaae163882b064bf7257e82e8832ffb
ba87ebfb58b06fcf0c26eb1df6745550
1,500
PASSED
#include <bits/stdc++.h> using namespace std; vector <vector<int>> g; vector <pair <int, int>> leaf; vector <vector <int>> nw_g; unordered_map <int, long double> um; void nw_gr(int v, int p){ for (int i = 0; i < g[v].size(); i++){ int nw = g[v][i]; if (p != nw){ nw_g[v].push_back(n...
C++
adaae163882b064bf7257e82e8832ffb
1219b36e84b6cedac21c3c012a5506cb
1,500
PASSED
#include<bits/stdc++.h> using namespace std; #define int long long #define krish ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define localin freopen("in.txt","r",stdin); #define localout freopen("out1.txt","w",stdout); const int MAX=1e5+5; #define endl "\n" #defi...
C++
adaae163882b064bf7257e82e8832ffb
1af5dedabb27d4c690751378ca1adbd8
1,500
PASSED
#include <bits/stdc++.h> #include <chrono> using namespace std; using namespace std::chrono; typedef long long ll; int MOD = 1e9 + 7; ll getTimeSinceEpoch() { return duration_cast< milliseconds >(system_clock::now().time_since_epoch()).count(); } bool yes(bool b) { cout << (b ? "Yes" : "No") << "\n"; r...
C++
adaae163882b064bf7257e82e8832ffb
633800c229dc3f1b7f320108d5942b56
1,500
PASSED
#include <bits/stdc++.h> using namespace std;; int main(){ int t; cin >> t; while (t--){ int n; cin >> n; int arr[n]; for (int i = 0; i < n; i++){ cin >> arr[i]; } sort(arr, arr+n); int ans = 0; long long cur = 0; for (int i = 0; i < n; i++){ cur++; if (cur >= arr[i]){ an...
C++
8e766dea94dc2033ba2d5759d7e5cd80
95aa0dee12a2d9d1ee52b25afee5ad5f
1,200
PASSED
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; vector <int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a.begin(), a.end()); int ans = 0, cur = 0; for ...
C++
8e766dea94dc2033ba2d5759d7e5cd80
70d6e3d4b0232321dedf7b3464e3297c
1,200
PASSED
#include <bits/stdc++.h> using namespace std;; int main(){ int t; cin >> t; while (t--){ int n; cin >> n; int arr[n]; for (int i = 0; i < n; i++){ cin >> arr[i]; } sort(arr, arr+n); int ans = 0; int cur = 0; for (int i = 0; i < n; i++){ cur++; if (cur >= arr[i]){ ans++; ...
C++
8e766dea94dc2033ba2d5759d7e5cd80
fec77751ae62e052182dcee00a1a1397
1,200
PASSED
#include <bits/stdc++.h> using namespace std; int bil, num, numA, arr[1000001], sum, rest; int main(){ scanf("%d", &bil); for(int z = 0; z < bil; z++){ scanf("%d", &num); sum = 0; rest = 0; for(int i = 0; i < num; i++){ scanf("%d", &numA); arr[numA]++; ...
C++
8e766dea94dc2033ba2d5759d7e5cd80
9efdee95bb44157bdb4bee7f5d31260d
1,200
PASSED
#include <bits/stdc++.h> #define f first #define s second using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t; cin>>t; while(t--){ int a, b, cur, temp=0, sum=0; cin>>a; vector <int> arr; for(int i=0; i<a; i++){ cin>>b; arr.push_back(b); } s...
C++
8e766dea94dc2033ba2d5759d7e5cd80
b5b8a14c3e8e45130486886d38c99174
1,200
PASSED
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(0); cin.tie(NULL);cout.tie(NULL); int t; cin>>t; while(t--) { int n; cin>>n; vector<int> a(n); for(int i=0;i<n;i++) { cin >> a[i]; } sor...
C++
8e766dea94dc2033ba2d5759d7e5cd80
99a948671c46c6aca4fafece336cd7d0
1,200
PASSED
#define ll long long int #include<bits/stdc++.h> using namespace std; int main(void){ #ifndef ONLINE_JUDGE freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif int t,i; cin>>t; while(t--){ int n,c=0,p=0; cin>>n; int a[n]; // map<int,int>mp; for...
C++
8e766dea94dc2033ba2d5759d7e5cd80
b0cc7eff4db30a09f49763e55be43afe
1,200
PASSED
#include <bits/stdc++.h> #include<cmath> #include<cstring> #define pb push_back #define pi acos(-1.0) #define loop(i,a,n) for(int i=a;i<n;i++) #define rloop(i,n,a) for(int i=n;i>=a;i--) #define ll long long int #define ff first #define ss second #d...
C++
8e766dea94dc2033ba2d5759d7e5cd80
eda184a54ed2ff2214e797519394cf9e
1,200
PASSED
#include <bits/stdc++.h> using namespace std; const int MAX = 2e5 + 10, inf = 1e9; int dp[MAX], a[MAX]; int fn(int i) { if(i < 0) { return -inf; } if(!i) { return 0; } int &res = dp[i]; if(res != -1) { return res; } res = max(1 + fn(i - a[i]), fn(i - 1)); return res; } main() { // ios:...
C++
8e766dea94dc2033ba2d5759d7e5cd80
e456dcde4d6e0fc64c0ee6337b19ffbb
1,200
PASSED
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; vector <int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a.begin(), a.end()); int ans = 0, cur = 0; ...
C++
8e766dea94dc2033ba2d5759d7e5cd80
5862beca466bd2e95108b7c963b102c1
1,200
PASSED
#include<bits/stdc++.h> using namespace std; /* int main(){ int aa[16] = {60, 45, 36, 30, 20, 18, 15, 12, 10, 9, 6, 5, 4, 3, 2, 1}; set<int> s; for(int i = 0; i < 16; i++){ s.insert(aa[i]); } int t; cin >> t; while(t--){ int ang; cin >> ang; for(int i = 0; i < 16; i++){ if(aa[i] <= ang && ang % aa[i]...
C++
a9cd97046e27d799c894d8514e90a377
88626a5d23a95c69009f8c25784bc594
800
PASSED
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long int t,a,b; cin>>t; while(t--) { cin>>a>>b; cout<<a<<" "<<2*a<<"\n"; } return 0; }
C++
a9cd97046e27d799c894d8514e90a377
475ff9dd2ec285c31a24879d1ec3c6f7
800
PASSED
/******************************************* * @ashutoshjv661 * * *******************************************/ #include<bits/stdc++.h> using namespace std; typedef vector <int> vi; typedef pair< int ,int > pii; #define endl "\n" #define sd(val) scanf("%d",&val) #define ss(val) scanf("%s",&val) #define sl(val) sca...
C++
a9cd97046e27d799c894d8514e90a377
b7569ae8be40690d308cb9b9b1359ae5
800
PASSED
#include<bits/stdc++.h> using namespace std; #define ll long long #define st first #define nd second #define PI pair<int , int> int main(){ int t; cin>>t; while(t--){ int l , r; cin>>l>>r; cout<<l<<" "<<l+l<<endl; } }
C++
a9cd97046e27d799c894d8514e90a377
45236829686f8e58e96ea22351d7840e
800
PASSED
#include <iostream> using namespace std; int main(){ int t,l,r; cin>>t; while(t--){ cin>>l>>r; cout<<l<<" "<<l*2<<endl; } return 0; }
C++
a9cd97046e27d799c894d8514e90a377
a099754af75878e9954c461e33f3056b
800
PASSED
#include<iostream> #include<conio.h> using namespace std; int main(){ int l,r,x,y; cin>>x; for(int k=0;k<x;k++) { cin>>l; cin>>r; for(int i=2;i<=r;i++) { if(i*l <= r ) { cout<<l<<" "<<i*l<<endl; break; } } } }
C++
a9cd97046e27d799c894d8514e90a377
72f35d8c802a943645fecaac3ba8d3f2
800
PASSED
#include<bits/stdc++.h> using namespace std; int main() { long int l,r,i,j,a,b,c,k,n; cin>>n; for(k=0;k<n;k++) { cin>>l>>r; cout<<l<<" "<<l+l<<endl; } }
C++
a9cd97046e27d799c894d8514e90a377
36d3e27ef8f07dbe4c0f93202786292a
800
PASSED
#include<bits/stdc++.h> #define ll long long using namespace std; int main() { int t; cin>>t; for(int i=0;i<t;i++) { ll l,r,status=0; cin>>l>>r; cout<<l<<" "<<2*l<<endl; } }
C++
a9cd97046e27d799c894d8514e90a377
2075dee9b2a1ac47c4ff7997326821cc
800
PASSED
#include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t; cin >> t; while(t--){ long long l,r; cin >> l >> r; if(l*2 <= r){ cout << l << " " << l*2 << "\n"; } } return 0; }
C++
a9cd97046e27d799c894d8514e90a377
24a1cf81265733323f9df47d6ba85a93
800
PASSED
#include <iostream> #include <string> #define ll long long #define str string using namespace std; int main(){ ll n,l,r; cin>>n; while(n--){ cin>>l>>r; cout<<l<<" "<<l*2<<endl; } }
C++
a9cd97046e27d799c894d8514e90a377
cfeca7979561f4f044221dad395bdcc6
800
PASSED
๏ปฟusing System; using System.Collections.Generic; using System.IO; using System.Text; namespace Dijkstra { internal class Program { private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10); private static readonly StreamWr...
C#
bda2ca1fd65084bb9d8659c0a591743d
58e58852155b22d447b5469f3e05f064
1,900
PASSED
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using DataStructures; namespace ProblemSolver { class Program { static int N, M; static List<Pair<int, int>>[] adj; static public int[] P; static public long[] L; ...
C#
bda2ca1fd65084bb9d8659c0a591743d
7ec26af8bdec9609afb0f0e82f3818d9
1,900
PASSED
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using DataStructures; namespace ProblemSolver { class Program { static int N, M; static List<Pair<int, int>>[] adj; static public int[] P; static pub...
C#
bda2ca1fd65084bb9d8659c0a591743d
920fad6d66813f629475de16e59d15be
1,900
PASSED
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using DataStructures; namespace ProblemSolver { class Program { static int N, M; static List<Pair<int, int>>[] adj; static public int[] P; static pub...
C#
bda2ca1fd65084bb9d8659c0a591743d
01e8cd12b1bccbed68e1a1b2d5bb7c9d
1,900
PASSED
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using DataStructures; namespace Problem_Solver { class Program { static int N, M; static List<Tuple<int, int>>[] adj; static public int[] P; static public lo...
C#
bda2ca1fd65084bb9d8659c0a591743d
251316b954165141ef38b177f44e3835
1,900
PASSED
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using DataStructures; namespace Problem_Solver { class Program { static int N, M; static List<Pair<int, int>>[] adj; static public int[] P; static pu...
C#
bda2ca1fd65084bb9d8659c0a591743d
4246d1367554cc90622aa8a4424c4bb9
1,900
PASSED
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Codeforce { public class Dijtrak { class Edge : IComparable<Edge> { public int vertex; public long value; public Edge(int v, long v...
C#
bda2ca1fd65084bb9d8659c0a591743d
ad34c4f3e2b4fd09c4d6ee50c637c85c
1,900
PASSED
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication3 { class Program { struct Pair { public Int64 first; public Int64 second; public Pair(Int64 V, Int64 l) ...
C#
bda2ca1fd65084bb9d8659c0a591743d
83c26ba7176282c06189dde7078924f3
1,900
PASSED
๏ปฟusing System; using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; using System.Text; using System.Threading; // (ใฅยฐฯ‰ยฐ)ใฅ๏พeโ˜…ใ‚œใƒปใ€‚ใ€‚ใƒปใ‚œใ‚œใƒปใ€‚ใ€‚ใƒปใ‚œโ˜†ใ‚œใƒปใ€‚ใ€‚ใƒปใ‚œใ‚œใƒปใ€‚ใ€‚ใƒปใ‚œ public class Solver { public class Heap<T> { private readonly List<T> data; private readonly Compari...
C#
bda2ca1fd65084bb9d8659c0a591743d
470bd47093d0f6956220bcad309175a2
1,900
PASSED
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Codeforce { public class Dijtrak { class Edge : IComparable<Edge> { public int vertex; public long value; public Edge(int v, long v...
C#
bda2ca1fd65084bb9d8659c0a591743d
bb484c5d4841913103e7a26667548054
1,900
PASSED
#include <iostream> #include <math.h> #include <algorithm> #include <set> #include <map> #include <vector> #include <queue> #include <utility> using namespace std; const int MAX_V = 10000000; int main() { long long x; vector<pair<long long, long long> > ans; cin >> x; long long n = 1, s_i = 0, ss_i...
C++
5891432c43cfee35a212ad92d7da2a64
71cd330cc5bd51705768cef210f6e0b0
1,900
PASSED
#include <cstdio> #include <cmath> #include <climits> #include <vector> #include <iostream> using namespace std; long long int cnt = 0; void solve(unsigned long long int x){ int cbx3 = (int)pow(x, 1.0/3.0)*3; vector<pair<int, long long int> > ans; int ans_num = 0; int i; long long int a = 0; x *= 6; for(i = 1 ;...
C++
5891432c43cfee35a212ad92d7da2a64
b43f5cfaf5df19c1cfff8c99fc08bfbd
1,900
PASSED
#include <bits/stdc++.h> using namespace std; #define ull unsigned long long long long x; long long solve(long long n) { ull lhs = n; lhs *= (n+1); ull rhs = x; rhs *= 6; if (rhs % lhs > 0) return -1; rhs /= lhs; rhs -= 1; rhs += n; if (rhs < 0) return -1; if (rhs % 3 > 0) return -1; if (rhs/3 >= n)...
C++
5891432c43cfee35a212ad92d7da2a64
28e3977aff5476cb546c613cb3a6fbdb
1,900
PASSED
//By :Prajwal Sonawane //Email :prajwalsonawane35@gmail.com //Language:C++ #include <bits/stdc++.h> using namespace std; #define fi first #define se second #define pb push_back #define endl '\n' #define all(x) (x).begin(), (x).end() #define digits(x) floor(log10(n) + 1) #define countbits(x) ((int)log2(x)+1); #d...
C++
5891432c43cfee35a212ad92d7da2a64
6f078ec667e2911e92738bc86ae4abae
1,900
PASSED
#include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cst...
C++
5891432c43cfee35a212ad92d7da2a64
cad5d9d09f2cd9e6bff0f33458fcbb0c
1,900
PASSED
/*\ \\\\\ |||||||||||in the name of god ///// \*/ #include <bits/stdc++.h> #define ll long long #define pb push_back #define F first #define S second #define mp make_pair #define an size() using namespace std; const ll del=10723; const ll mod=1e9+7; const ll maxn=1e7+500; vector<pair<ll,ll> > ans; ll g[maxn]; ll ...
C++
5891432c43cfee35a212ad92d7da2a64
dd0665bcfc1c012d34601741fd4cf83d
1,900
PASSED
#include <iostream> #include <set> #include <map> #include <cmath> #include <climits> #include <vector> #include <queue> #include <algorithm> using namespace std; using ll = long long; constexpr ll MAX = 1e18 + 1; vector<ll> sq_sums; ll square_sum(ll n) { if (n % 2 == 0) { if (n % 3 == 0) { ...
C++
5891432c43cfee35a212ad92d7da2a64
4be113f9109d7b4bffced1d7af8c8278
1,900
PASSED
#include <iostream> #include <set> #include <map> #include <cmath> #include <climits> #include <vector> #include <queue> #include <algorithm> using namespace std; using ll = long long; constexpr ll MAX = 1e18 + 1; vector<ll> sq_sums; ll square_sum(ll n) { if (n % 2 == 0) { if (n % 3 == 0) { ...
C++
5891432c43cfee35a212ad92d7da2a64
751ace240efa8faa4c704721474ea347
1,900
PASSED
#include <bits/stdc++.h> #define mp make_pair #define pb push_back #define pf push_front #define pp pop_back #define ppf pop_front #define fi first #define se second #define maxn 100005 typedef long long ll; using namespace std; #define pi pair<int,int> vector<pair<ll,ll> > v; int main() { /* Enter your code here....
C++
5891432c43cfee35a212ad92d7da2a64
6c6c89ecc6b075a5a83872dcbeb98f81
1,900
PASSED
#include<iostream> #include<cstdio> #include<string> #include<cstring> #include<vector> #include<algorithm> #include<cmath> #include<queue> using namespace std; typedef long long ll; typedef pair<ll,ll>PLL; typedef vector<int> vint; const int maxn=1e5+10; const int mod=1e9+7; ll n,m,x; vector<PLL>ans; bool cmp(PLL a,...
C++
5891432c43cfee35a212ad92d7da2a64
1e4a25c39796397697602cc7ddc6ba5a
1,900
PASSED
#include <iostream> #include <cstdio> #include <cstring> using namespace std; int b[55]; void init() { int i,j,len=1,flag; b[0]=2; for (i=3;i<=1000;i++) { flag=1; for (j=2;j*j<=i;j++) { if (i%j==0) { flag=0; } } ...
C++
b3108315889607dabcd3112bcfe3fb54
1fab02b38f2f62b03e455f5e4824aef7
1,700
PASSED
#include<stdio.h> #include<string.h> #include<math.h> #define N 10001 #define M 10001 #define ll __int64 bool is[N]; int p[M]; int pnum; int getprm(int n) { int i,j,k=0; int s,e=(int)(sqrt(0.0+n)+1); memset(is,1,sizeof(is)); p[k++]=2; is[0]=is[1]=0; for(i=4;i<n;i+=2) is[i]=0; for(i=3;i<e;i+=...
C++
b3108315889607dabcd3112bcfe3fb54
9d0edff496bd981e281396e4f5d763da
1,700
PASSED
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<queue> #include<stack> #include<vector> using namespace std; #define INF 1000000000 const int maxn=30005; bool notp[maxn]; int p[maxn],cou=0; unsigned __int64 ans[55]; void getP() { for(int i=2; i<maxn; i++) i...
C++
b3108315889607dabcd3112bcfe3fb54
8a7b3fa4e221abf0f6377847297faef3
1,700
PASSED
#include <cstdio> #include <cstring> #include <string> #include <algorithm> #include <cmath> #include <vector> #include <queue> #include <stack> using namespace std; const int mod=1; const int eps=1e-6; // /*int main() { int t; scanf("%d",&t); int b,a; for(int caseno=1;caseno<=t;caseno++) { ...
C++
b3108315889607dabcd3112bcfe3fb54
47476e63a3184855cedc1b2f91d0cc1f
1,700
PASSED
#include <stdio.h> #include <iostream> #include <string> #include <string.h> #define DEPTH 10000 #define MAX 100 using namespace std; typedef int bignum_t[MAX+1]; void write(const bignum_t a,ostream& os=cout){ int i,j; for (os<<a[i=a[0]],i--;i;i--) for (j=DEPTH/10;j;j/=10) os<<a[i]/j%10; } void mul(bignum_t a...
C++
b3108315889607dabcd3112bcfe3fb54
e38fd3256aac34563effcc298590b7f2
1,700
PASSED
#include<stdio.h> #include<iostream> #include<string.h> #include<math.h> #include<stdlib.h> #include<map> #include<string> #include<queue> #include<algorithm> #define mod 1000000007 #define maxn 100005 #define ll __int64 using namespace std; int main() { int i,j,n; scanf("%d",&n); if(n == 2) printf("-1\n"); els...
C++
b3108315889607dabcd3112bcfe3fb54
d4c3dff18b1c2129888d042f9a881455
1,700
PASSED
#include<cstdio> #include<cstring> #include<algorithm> #include<set> #include<iostream> using namespace std; typedef unsigned long long ll; #define N 100000 set<ll> st; set<ll>::iterator it; ll a[N]; int cnt; void init() { int i; a[0]=6;a[1]=10;a[2]=15; cnt=3; st.insert(a[0]); st.insert(a[1]); st.inser...
C++
b3108315889607dabcd3112bcfe3fb54
1c27302eb38a7a0b32206c6d23306b84
1,700
PASSED
#include<stdio.h> #include<iostream> using namespace std; int main(){ int n; scanf("%d", &n); long long temp = 2LL; if(n == 2){ printf("-1\n"); return 0; } for(int i = 0; i < n - 2; i++){ long long out = temp * 3LL; cout<<out<<endl; temp *= 2LL; } ...
C++
b3108315889607dabcd3112bcfe3fb54
927fca77ee101a5c427c2af25b64f135
1,700
PASSED
#include<bits/stdc++.h> using namespace std; int n; int prm; int prime[110]; int ans[110]; int con; void getPrime() { prm=1; prime[1]=2; for(int i=3;i<=1000;i++) { if(prm==100) break; int f=0; for(int j=2;j<i;j++) { if(i%j==0) { ...
C++
b3108315889607dabcd3112bcfe3fb54
075e3743d82aec6da5b2142aa95d278d
1,700
PASSED
#include"iostream" #include<stdio.h> using namespace std; int ok[100000]; int prim[10000]; int num; void solve() { int i,j; for(i=2;i<30000;i++) if(!ok[i]) { prim[num++]=i; // cout<<i<<endl; for(j=2*i;j<30000;j+=i) ok[j]=1; } } long long...
C++
b3108315889607dabcd3112bcfe3fb54
bc3b3acb8792f760c40d721a95675109
1,700
PASSED
import java.util.*; import java.io.*; public class cubessorting { static class FastScanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); String next() { while (!st.hasMoreTokens()) { t...
Java
b34f29e6fb586c22fa1b9e559c5a6c50
a39629d614cd1f20997dd32d6439999d
900
PASSED
import java.lang.reflect.Array; import java.util.*; public class inser { public static void main(String[] args) { Scanner in = new Scanner(System.in); int T = in.nextInt(); for (int t = 0; t < T; t++) { int n = in.nextInt(); Integer a[] = new Integer[n]; f...
Java
b34f29e6fb586c22fa1b9e559c5a6c50
8c2cb664e63a08fa089117965546bd74
900
PASSED
import java.util.*; import java.io.*; public class Main { static int mod = 1000000007; public static void solve(InputReader in, OutputWriter out) { int n = in.readInt(); int a[] = new int[n]; for(int i = 0; i<n; i++){ a[i] = in.readInt(); } boolean can = false; fo...
Java
b34f29e6fb586c22fa1b9e559c5a6c50
1d675ed40f93350e282266db96f035bb
900
PASSED
import java.util.Scanner; public class p1420A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); l: for (int t = sc.nextInt(); t-- > 0;) { int n = sc.nextInt(), a[] = new int[n]; for (int i = 0; i < n; i++) a[i] = sc.nextInt(); for (int i = 0; i < n - 1; i++) if (a[i] <=...
Java
b34f29e6fb586c22fa1b9e559c5a6c50
11e9598a82e214489346f6cd370de8fa
900
PASSED
import java.util.Scanner; public class p1420A { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { l: for (int t = sc.nextInt(); t-- > 0;) { int n = sc.nextInt(), a[] = readArray(n); for (int i = 0; i < n - 1; i++) if (a[i] <= a[i + 1]) { System.out.println("YES");...
Java
b34f29e6fb586c22fa1b9e559c5a6c50
6165cace8826b9d73c0f38d0f347cc9a
900
PASSED
public class TaskA { public static void main(String []args){ java.util.Scanner scan = new java.util.Scanner(System.in); int t = scan.nextInt(); for(int i = 0; i < t; i++) { int N = scan.nextInt(); int[] a = new int[N]; for(int j = 0; j < N; j...
Java
b34f29e6fb586c22fa1b9e559c5a6c50
ae523916f17c7f0138a811dd1a327682
900
PASSED