prob_desc_description stringlengths 63 3.8k | prob_desc_output_spec stringlengths 17 1.47k ⌀ | lang_cluster stringclasses 2
values | src_uid stringlengths 32 32 | code_uid stringlengths 32 32 | lang stringclasses 7
values | prob_desc_output_to stringclasses 3
values | prob_desc_memory_limit stringclasses 19
values | file_name stringclasses 111
values | tags listlengths 0 11 | prob_desc_created_at stringlengths 10 10 | prob_desc_sample_inputs stringlengths 2 802 | prob_desc_notes stringlengths 4 3k ⌀ | exec_outcome stringclasses 1
value | difficulty int64 -1 3.5k ⌀ | prob_desc_input_from stringclasses 3
values | prob_desc_time_limit stringclasses 27
values | prob_desc_input_spec stringlengths 28 2.42k ⌀ | prob_desc_sample_outputs stringlengths 2 796 | source_code stringlengths 42 65.5k | hidden_unit_tests stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 7f52f0504484869e4014050a3d46bc5d | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
#include<string.h>
int no_of_odds(int s[26]);
int main()
{
char str[10001];
scanf("%s",str);
int s[26];
for(int i=0;i<26;i++)s[i]=0;
int count;
int n=strlen(str);
for(int i=0;i<n;i++)
s[str[i]-'a']+=1;
int number=no_of_odds(s);
count=0;
while(1>0)
{
if(number==0 && n%2... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | fcc809af5172e9741996915b75fde0df | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
int main()
{
char s[1001]={'\0'};
scanf("%s",s);
int n=strlen(s),ar[26]={0},even=0,odd=0;
for(int i=0;i<n;i++)
ar[s[i]-'a']++;
for(int i=0;i<26;i++)
{
if(ar[i]%2==0)
even++;
else
odd++;
}
if(odd%2!=0||odd==0)
printf("First");
else
printf... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 606bfb805214eedd1a66076dbcec2dd7 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <stdio.h>
#include <string.h>
#define sz 1001
int a[130],b[130];
int main ()
{
char s[sz];
int i,j,len,count=0;
scanf("%s",s);
len=strlen(s);
for (i=0; i<len; i++) a[s[i]]++;
int sum;
while (1)
{
sum=0;
count++;
for (i='a'; i<='z'; i++)
{
b[i]=a[i]%2;
sum=sum+b[i];
}
... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 4c7c0434f299ad11e79a9520e17e3a1b | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <stdio.h>
#include <string.h>
#define sz 1001
int a[130],b[130];
int main ()
{
char s[sz];
int i,j,len,count=0;
scanf("%s",s);
len=strlen(s);
for (i=0; i<len; i++) a[s[i]]++;
int sum=0;
for (i='a'; i<='z'; i++) sum+=(a[i]%2);
if (sum==0 || sum%2) printf("First\n");
els... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | d9407b0831f37f97f8ad66093d8fa60a | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
#include<string.h>
int main()
{
int no,ii,sum=0,a=0,b=0,c=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;
int q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;
char S[1001];
scanf("%s",&S);
no=strlen(S);
for(ii=0; ii<no; ii++)
{
if(S[ii]=='a')
{
a+... | |
Polycarpus got hold of a family relationship tree. The tree describes family relationships of n people, numbered 1 through n. Each person in the tree has no more than one parent.Let's call person a a 1-ancestor of person b, if a is the parent of b.Let's call person a a k-ancestor (k > 1) of person b, if person b has... | Print m space-separated integers — the answers to Polycarpus' queries. Print the answers to the queries in the order, in which the queries occur in the input. | C | ce58d35343d66b962fb23b9963783acf | 83772871bebf306963d1801c5c80c36b | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"data structures",
"binary search",
"dfs and similar",
"trees"
] | 1343057400 | ["6\n0 1 1 0 4 4\n7\n1 1\n1 2\n2 1\n2 2\n4 1\n5 1\n6 1"] | null | PASSED | 2,100 | standard input | 2 seconds | The first input line contains a single integer n (1 ≤ n ≤ 105) — the number of people in the tree. The next line contains n space-separated integers r1, r2, ..., rn, where ri (1 ≤ ri ≤ n) is the number of person i's parent or 0, if person i has no parent. It is guaranteed that family relationships don't form cycles. Th... | ["0 0 1 0 0 1 1"] | /* practice with Dukkha */
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#define N 100000
#define LN 16 /* LN = floor(log2(N - 1)) */
void srand_() {
struct timeval tv;
gettimeofday(&tv, NULL);
srand(tv.tv_sec ^ tv.tv_usec);
}
int rand_(int n) {
return (rand() * 76543LL + rand()) % n;
}
int next... | |
You are given two polynomials: P(x) = a0·xn + a1·xn - 1 + ... + an - 1·x + an and Q(x) = b0·xm + b1·xm - 1 + ... + bm - 1·x + bm. Calculate limit . | If the limit equals + ∞, print "Infinity" (without quotes). If the limit equals - ∞, print "-Infinity" (without the quotes). If the value of the limit equals zero, print "0/1" (without the quotes). Otherwise, print an irreducible fraction — the value of limit , in the format "p/q" (without the quotes), where p is the... | C | 37cf6edce77238db53d9658bc92b2cab | daf77a2b0e594e59c3ae3bcb16463124 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1339506000 | ["2 1\n1 1 1\n2 5", "1 0\n-1 3\n2", "0 1\n1\n1 0", "2 2\n2 1 6\n4 5 -7", "1 1\n9 0\n-5 2"] | NoteLet's consider all samples: You can learn more about the definition and properties of limits if you follow the link: http://en.wikipedia.org/wiki/Limit_of_a_function | PASSED | 1,400 | standard input | 2 seconds | The first line contains two space-separated integers n and m (0 ≤ n, m ≤ 100) — degrees of polynomials P(x) and Q(x) correspondingly. The second line contains n + 1 space-separated integers — the factors of polynomial P(x): a0, a1, ..., an - 1, an ( - 100 ≤ ai ≤ 100, a0 ≠ 0). The third line contains m + 1 space-separat... | ["Infinity", "-Infinity", "0/1", "1/2", "-9/5"] | /*
#include <stdio.h>
int main()
{
int n, m, i;
scanf("%d%d", &n, &m);
int ara1[n+1], ara2[m+1];
for(i = 0;i <n+1; i++){
scanf("%d", &ara1[i]);
}
for(i = 0; i <m+1; i++){
scanf("%d", &ara2[i]);
}
if(n>m && n*m>=0){
printf("Infinity");
}
else if(n>m && n*m<... | |
You are given two polynomials: P(x) = a0·xn + a1·xn - 1 + ... + an - 1·x + an and Q(x) = b0·xm + b1·xm - 1 + ... + bm - 1·x + bm. Calculate limit . | If the limit equals + ∞, print "Infinity" (without quotes). If the limit equals - ∞, print "-Infinity" (without the quotes). If the value of the limit equals zero, print "0/1" (without the quotes). Otherwise, print an irreducible fraction — the value of limit , in the format "p/q" (without the quotes), where p is the... | C | 37cf6edce77238db53d9658bc92b2cab | 905d214df4e7ac99b6a3bbdd03d5fab3 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1339506000 | ["2 1\n1 1 1\n2 5", "1 0\n-1 3\n2", "0 1\n1\n1 0", "2 2\n2 1 6\n4 5 -7", "1 1\n9 0\n-5 2"] | NoteLet's consider all samples: You can learn more about the definition and properties of limits if you follow the link: http://en.wikipedia.org/wiki/Limit_of_a_function | PASSED | 1,400 | standard input | 2 seconds | The first line contains two space-separated integers n and m (0 ≤ n, m ≤ 100) — degrees of polynomials P(x) and Q(x) correspondingly. The second line contains n + 1 space-separated integers — the factors of polynomial P(x): a0, a1, ..., an - 1, an ( - 100 ≤ ai ≤ 100, a0 ≠ 0). The third line contains m + 1 space-separat... | ["Infinity", "-Infinity", "0/1", "1/2", "-9/5"] | #include <stdio.h>
#include <math.h>
int main()
{
int n,m,min,u,y;
scanf("%d %d",&n,&m);
int a[n+1];
int i,j,k,l;
for(i=1;i<=(n+1);i++)
{
scanf("%d",&a[i]);
}
int b[m+1];
for(i=1;i<=(m+1);i++)
scanf("%d",&b[i]);
if(n>m)
{
if((a[1]<0 && b[1]... | |
You are given two polynomials: P(x) = a0·xn + a1·xn - 1 + ... + an - 1·x + an and Q(x) = b0·xm + b1·xm - 1 + ... + bm - 1·x + bm. Calculate limit . | If the limit equals + ∞, print "Infinity" (without quotes). If the limit equals - ∞, print "-Infinity" (without the quotes). If the value of the limit equals zero, print "0/1" (without the quotes). Otherwise, print an irreducible fraction — the value of limit , in the format "p/q" (without the quotes), where p is the... | C | 37cf6edce77238db53d9658bc92b2cab | d223ab0e3e452b889cbc383280e042e6 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1339506000 | ["2 1\n1 1 1\n2 5", "1 0\n-1 3\n2", "0 1\n1\n1 0", "2 2\n2 1 6\n4 5 -7", "1 1\n9 0\n-5 2"] | NoteLet's consider all samples: You can learn more about the definition and properties of limits if you follow the link: http://en.wikipedia.org/wiki/Limit_of_a_function | PASSED | 1,400 | standard input | 2 seconds | The first line contains two space-separated integers n and m (0 ≤ n, m ≤ 100) — degrees of polynomials P(x) and Q(x) correspondingly. The second line contains n + 1 space-separated integers — the factors of polynomial P(x): a0, a1, ..., an - 1, an ( - 100 ≤ ai ≤ 100, a0 ≠ 0). The third line contains m + 1 space-separat... | ["Infinity", "-Infinity", "0/1", "1/2", "-9/5"] | #include<stdio.h>
main()
{
int n,m,s1,s2,flag=0;
scanf("%d %d",&n, &m);
int a[n+1], b[m+1],i;
for(i=0; i<=n; i++)
{
scanf("%d",&a[i]);
}
for(i=0; i<=m; i++)
{
scanf("%d",&b[i]);
}
if(n>m)
{
if((a[0]<0 && b[0]<0) || (a[0]>=0 && b[0]>=0)) printf("Infinit... | |
You are given two polynomials: P(x) = a0·xn + a1·xn - 1 + ... + an - 1·x + an and Q(x) = b0·xm + b1·xm - 1 + ... + bm - 1·x + bm. Calculate limit . | If the limit equals + ∞, print "Infinity" (without quotes). If the limit equals - ∞, print "-Infinity" (without the quotes). If the value of the limit equals zero, print "0/1" (without the quotes). Otherwise, print an irreducible fraction — the value of limit , in the format "p/q" (without the quotes), where p is the... | C | 37cf6edce77238db53d9658bc92b2cab | ff8b6986a96cb3a195def9c990869f73 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1339506000 | ["2 1\n1 1 1\n2 5", "1 0\n-1 3\n2", "0 1\n1\n1 0", "2 2\n2 1 6\n4 5 -7", "1 1\n9 0\n-5 2"] | NoteLet's consider all samples: You can learn more about the definition and properties of limits if you follow the link: http://en.wikipedia.org/wiki/Limit_of_a_function | PASSED | 1,400 | standard input | 2 seconds | The first line contains two space-separated integers n and m (0 ≤ n, m ≤ 100) — degrees of polynomials P(x) and Q(x) correspondingly. The second line contains n + 1 space-separated integers — the factors of polynomial P(x): a0, a1, ..., an - 1, an ( - 100 ≤ ai ≤ 100, a0 ≠ 0). The third line contains m + 1 space-separat... | ["Infinity", "-Infinity", "0/1", "1/2", "-9/5"] | #include <stdio.h>
#include <math.h>
int gcd(int e,int f){
e=e>0?e:(-1)*e;
f=f>0?f:(-1)*f;
while(e!=f){
if (e<f){
f-=e;
}
else {
e-=f;
}
}
return e;
}
int main()
{
int n,m,a,b,x,y,i,e,f,g;
sca... | |
You are given two polynomials: P(x) = a0·xn + a1·xn - 1 + ... + an - 1·x + an and Q(x) = b0·xm + b1·xm - 1 + ... + bm - 1·x + bm. Calculate limit . | If the limit equals + ∞, print "Infinity" (without quotes). If the limit equals - ∞, print "-Infinity" (without the quotes). If the value of the limit equals zero, print "0/1" (without the quotes). Otherwise, print an irreducible fraction — the value of limit , in the format "p/q" (without the quotes), where p is the... | C | 37cf6edce77238db53d9658bc92b2cab | 84e16c325d4ac2fcb8c4522347ba4b4e | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1339506000 | ["2 1\n1 1 1\n2 5", "1 0\n-1 3\n2", "0 1\n1\n1 0", "2 2\n2 1 6\n4 5 -7", "1 1\n9 0\n-5 2"] | NoteLet's consider all samples: You can learn more about the definition and properties of limits if you follow the link: http://en.wikipedia.org/wiki/Limit_of_a_function | PASSED | 1,400 | standard input | 2 seconds | The first line contains two space-separated integers n and m (0 ≤ n, m ≤ 100) — degrees of polynomials P(x) and Q(x) correspondingly. The second line contains n + 1 space-separated integers — the factors of polynomial P(x): a0, a1, ..., an - 1, an ( - 100 ≤ ai ≤ 100, a0 ≠ 0). The third line contains m + 1 space-separat... | ["Infinity", "-Infinity", "0/1", "1/2", "-9/5"] | #include <stdio.h>
int gcd(int big, int small)
{
int tmp = 1;
while(tmp > 0)
{
tmp = big % small;
big = small, small = tmp;
}
return big;
}
int abs(int x)
{
if(x > 0)
return x;
return -x;
}
int main()
{
int n, m;
scanf("%d%d", &n, &m);
int a, b, tmp;
s... | |
You are given two polynomials: P(x) = a0·xn + a1·xn - 1 + ... + an - 1·x + an and Q(x) = b0·xm + b1·xm - 1 + ... + bm - 1·x + bm. Calculate limit . | If the limit equals + ∞, print "Infinity" (without quotes). If the limit equals - ∞, print "-Infinity" (without the quotes). If the value of the limit equals zero, print "0/1" (without the quotes). Otherwise, print an irreducible fraction — the value of limit , in the format "p/q" (without the quotes), where p is the... | C | 37cf6edce77238db53d9658bc92b2cab | 32f1007889a2515adac5a91d68f3a6d6 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1339506000 | ["2 1\n1 1 1\n2 5", "1 0\n-1 3\n2", "0 1\n1\n1 0", "2 2\n2 1 6\n4 5 -7", "1 1\n9 0\n-5 2"] | NoteLet's consider all samples: You can learn more about the definition and properties of limits if you follow the link: http://en.wikipedia.org/wiki/Limit_of_a_function | PASSED | 1,400 | standard input | 2 seconds | The first line contains two space-separated integers n and m (0 ≤ n, m ≤ 100) — degrees of polynomials P(x) and Q(x) correspondingly. The second line contains n + 1 space-separated integers — the factors of polynomial P(x): a0, a1, ..., an - 1, an ( - 100 ≤ ai ≤ 100, a0 ≠ 0). The third line contains m + 1 space-separat... | ["Infinity", "-Infinity", "0/1", "1/2", "-9/5"] | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int gcd(int a, int b)
{
int r;
while(b)
{
r=a%b; a=b; b=r;
}
return a;
}
int main()
{
int d1, d2, f1, f2, x;
scanf("%d%d",&d1,&d2);
for(int i=0;i<=d1;i++)
{
scanf("%d",&x);
if(!i) f1=x;
}
for(i... | |
You are given two polynomials: P(x) = a0·xn + a1·xn - 1 + ... + an - 1·x + an and Q(x) = b0·xm + b1·xm - 1 + ... + bm - 1·x + bm. Calculate limit . | If the limit equals + ∞, print "Infinity" (without quotes). If the limit equals - ∞, print "-Infinity" (without the quotes). If the value of the limit equals zero, print "0/1" (without the quotes). Otherwise, print an irreducible fraction — the value of limit , in the format "p/q" (without the quotes), where p is the... | C | 37cf6edce77238db53d9658bc92b2cab | 44f6218606e5e8a413c1963ead1c8338 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1339506000 | ["2 1\n1 1 1\n2 5", "1 0\n-1 3\n2", "0 1\n1\n1 0", "2 2\n2 1 6\n4 5 -7", "1 1\n9 0\n-5 2"] | NoteLet's consider all samples: You can learn more about the definition and properties of limits if you follow the link: http://en.wikipedia.org/wiki/Limit_of_a_function | PASSED | 1,400 | standard input | 2 seconds | The first line contains two space-separated integers n and m (0 ≤ n, m ≤ 100) — degrees of polynomials P(x) and Q(x) correspondingly. The second line contains n + 1 space-separated integers — the factors of polynomial P(x): a0, a1, ..., an - 1, an ( - 100 ≤ ai ≤ 100, a0 ≠ 0). The third line contains m + 1 space-separat... | ["Infinity", "-Infinity", "0/1", "1/2", "-9/5"] | #include <stdio.h>
#include <stdlib.h>
int gcd(int a, int b) {
int r;
while(b != 0) {
r = a % b;
a = b;
b = r;
}
return a;
}
int main() {
int n, m;
int deg1, deg2;
scanf("%d %d", &n, &m);
for(int i = 0, a; i <= n; i++) {
scanf("%d", &a);
i... | |
You are given two polynomials: P(x) = a0·xn + a1·xn - 1 + ... + an - 1·x + an and Q(x) = b0·xm + b1·xm - 1 + ... + bm - 1·x + bm. Calculate limit . | If the limit equals + ∞, print "Infinity" (without quotes). If the limit equals - ∞, print "-Infinity" (without the quotes). If the value of the limit equals zero, print "0/1" (without the quotes). Otherwise, print an irreducible fraction — the value of limit , in the format "p/q" (without the quotes), where p is the... | C | 37cf6edce77238db53d9658bc92b2cab | 641566cc4a88675f4f56e9d899101c2c | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1339506000 | ["2 1\n1 1 1\n2 5", "1 0\n-1 3\n2", "0 1\n1\n1 0", "2 2\n2 1 6\n4 5 -7", "1 1\n9 0\n-5 2"] | NoteLet's consider all samples: You can learn more about the definition and properties of limits if you follow the link: http://en.wikipedia.org/wiki/Limit_of_a_function | PASSED | 1,400 | standard input | 2 seconds | The first line contains two space-separated integers n and m (0 ≤ n, m ≤ 100) — degrees of polynomials P(x) and Q(x) correspondingly. The second line contains n + 1 space-separated integers — the factors of polynomial P(x): a0, a1, ..., an - 1, an ( - 100 ≤ ai ≤ 100, a0 ≠ 0). The third line contains m + 1 space-separat... | ["Infinity", "-Infinity", "0/1", "1/2", "-9/5"] | #include <stdio.h>
#include <math.h>
int main()
{
int m,n,i,c;
int a[110],b[110];
scanf("%d%d",&m,&n);
for(i=0;i<=m;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<=n;i++)
{
scanf("%d",&b[i]);
}
if(m<n) printf("0/1\n");
else if(m>n)
{
if(a[0]>0&&b[0]>0||a[0]... | |
You are given two polynomials: P(x) = a0·xn + a1·xn - 1 + ... + an - 1·x + an and Q(x) = b0·xm + b1·xm - 1 + ... + bm - 1·x + bm. Calculate limit . | If the limit equals + ∞, print "Infinity" (without quotes). If the limit equals - ∞, print "-Infinity" (without the quotes). If the value of the limit equals zero, print "0/1" (without the quotes). Otherwise, print an irreducible fraction — the value of limit , in the format "p/q" (without the quotes), where p is the... | C | 37cf6edce77238db53d9658bc92b2cab | 5cb7d9ea201c635749a434948b976d53 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1339506000 | ["2 1\n1 1 1\n2 5", "1 0\n-1 3\n2", "0 1\n1\n1 0", "2 2\n2 1 6\n4 5 -7", "1 1\n9 0\n-5 2"] | NoteLet's consider all samples: You can learn more about the definition and properties of limits if you follow the link: http://en.wikipedia.org/wiki/Limit_of_a_function | PASSED | 1,400 | standard input | 2 seconds | The first line contains two space-separated integers n and m (0 ≤ n, m ≤ 100) — degrees of polynomials P(x) and Q(x) correspondingly. The second line contains n + 1 space-separated integers — the factors of polynomial P(x): a0, a1, ..., an - 1, an ( - 100 ≤ ai ≤ 100, a0 ≠ 0). The third line contains m + 1 space-separat... | ["Infinity", "-Infinity", "0/1", "1/2", "-9/5"] | #include <stdio.h>
#include <math.h>
int main()
{
int m,n,i,c,d,y;
int a[110],b[110];
scanf("%d%d",&m,&n);
for(i=0;i<=m;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<=n;i++)
{
scanf("%d",&b[i]);
}
if(m>n)
{
if(b[0]<0&&a[0]>0||a[0]<0&&b[0]>0) printf("-Infinity"... | |
You are given two polynomials: P(x) = a0·xn + a1·xn - 1 + ... + an - 1·x + an and Q(x) = b0·xm + b1·xm - 1 + ... + bm - 1·x + bm. Calculate limit . | If the limit equals + ∞, print "Infinity" (without quotes). If the limit equals - ∞, print "-Infinity" (without the quotes). If the value of the limit equals zero, print "0/1" (without the quotes). Otherwise, print an irreducible fraction — the value of limit , in the format "p/q" (without the quotes), where p is the... | C | 37cf6edce77238db53d9658bc92b2cab | 6f04436b01f8497b8580788c531489a8 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1339506000 | ["2 1\n1 1 1\n2 5", "1 0\n-1 3\n2", "0 1\n1\n1 0", "2 2\n2 1 6\n4 5 -7", "1 1\n9 0\n-5 2"] | NoteLet's consider all samples: You can learn more about the definition and properties of limits if you follow the link: http://en.wikipedia.org/wiki/Limit_of_a_function | PASSED | 1,400 | standard input | 2 seconds | The first line contains two space-separated integers n and m (0 ≤ n, m ≤ 100) — degrees of polynomials P(x) and Q(x) correspondingly. The second line contains n + 1 space-separated integers — the factors of polynomial P(x): a0, a1, ..., an - 1, an ( - 100 ≤ ai ≤ 100, a0 ≠ 0). The third line contains m + 1 space-separat... | ["Infinity", "-Infinity", "0/1", "1/2", "-9/5"] | #include <stdio.h>
#include <stdlib.h>
int n,m,p[101],q[101],i,cmmd;
int cmmdc(int x,int y)
{
int r;
while(y!=0)
{
r=x%y;
x=y;
y=r;
}
return x;
}
int main()
{
scanf("%d %d",&n,&m);
for(i=0;i<=n;i++)
scanf("%d",&p[i]);
for(i=0;i<=m;i++)
... | |
There are $$$n$$$ products in the shop. The price of the $$$i$$$-th product is $$$a_i$$$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.In fact, the owner of the shop can change the price of some product $$$i$$$ in such a way that the difference between ... | Print $$$q$$$ integers, where the $$$i$$$-th integer is the answer $$$B$$$ on the $$$i$$$-th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition $$$|a_i - B| \le k$$$ should be satisfied (where $$$a_i$$$ is the old price of the product and $$$B$$$ is ... | C | 3b158306d335459ff55dcf29e46010e8 | b2e62aacb6734f613c16b19bedd48295 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1561559700 | ["4\n5 1\n1 1 2 3 1\n4 2\n6 4 8 5\n2 2\n1 6\n3 5\n5 2 5"] | NoteIn the first example query you can choose the price $$$B=2$$$. It is easy to see that the difference between each old price and each new price $$$B=2$$$ is no more than $$$1$$$.In the second example query you can choose the price $$$B=6$$$ and then all the differences between old and new price $$$B=6$$$ will be no ... | PASSED | 900 | standard input | 1 second | The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 100$$$) — the number of queries. Each query is presented by two lines. The first line of the query contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100, 1 \le k \le 10^8$$$) — the number of products and the value $$$k$$$. The second line ... | ["2\n6\n-1\n7"] | #include <stdio.h>
int main()
{int T,m;
scanf("%d",&T);
for(m=0;m<T;m++){
int N,k,i,j,l,min,max,price;
scanf("%d%d",&N,&k);
int A[N];
for(i=0;i<N;i++)
{
scanf("%d",&A[i]);
}
min=A[0];
for(j=1;j<N;j++)
{
if(A[j]<min)
{
min=A[j];
... | |
There are $$$n$$$ products in the shop. The price of the $$$i$$$-th product is $$$a_i$$$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.In fact, the owner of the shop can change the price of some product $$$i$$$ in such a way that the difference between ... | Print $$$q$$$ integers, where the $$$i$$$-th integer is the answer $$$B$$$ on the $$$i$$$-th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition $$$|a_i - B| \le k$$$ should be satisfied (where $$$a_i$$$ is the old price of the product and $$$B$$$ is ... | C | 3b158306d335459ff55dcf29e46010e8 | 9e3c956b715973de8d610918ebc1fe26 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1561559700 | ["4\n5 1\n1 1 2 3 1\n4 2\n6 4 8 5\n2 2\n1 6\n3 5\n5 2 5"] | NoteIn the first example query you can choose the price $$$B=2$$$. It is easy to see that the difference between each old price and each new price $$$B=2$$$ is no more than $$$1$$$.In the second example query you can choose the price $$$B=6$$$ and then all the differences between old and new price $$$B=6$$$ will be no ... | PASSED | 900 | standard input | 1 second | The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 100$$$) — the number of queries. Each query is presented by two lines. The first line of the query contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100, 1 \le k \le 10^8$$$) — the number of products and the value $$$k$$$. The second line ... | ["2\n6\n-1\n7"] | #include<stdio.h>
int main()
{ int t,n,k,i,max=0,a,min=100000001;
scanf("%d",&t);
while(t!=0) {max=0;min=100000001;
scanf("%d%d",&n,&k);
for(i=0; i<n; i++) {
scanf("%d",&a);
if(a>max) max=a;
if(a<min) min=a;
}
if(min+k>=max-k) printf("%d\n",min+k); else printf("-1\n");
t--;}
}
| |
There are $$$n$$$ products in the shop. The price of the $$$i$$$-th product is $$$a_i$$$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.In fact, the owner of the shop can change the price of some product $$$i$$$ in such a way that the difference between ... | Print $$$q$$$ integers, where the $$$i$$$-th integer is the answer $$$B$$$ on the $$$i$$$-th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition $$$|a_i - B| \le k$$$ should be satisfied (where $$$a_i$$$ is the old price of the product and $$$B$$$ is ... | C | 3b158306d335459ff55dcf29e46010e8 | 62d7eb68a2860e2199398630a8c45aae | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1561559700 | ["4\n5 1\n1 1 2 3 1\n4 2\n6 4 8 5\n2 2\n1 6\n3 5\n5 2 5"] | NoteIn the first example query you can choose the price $$$B=2$$$. It is easy to see that the difference between each old price and each new price $$$B=2$$$ is no more than $$$1$$$.In the second example query you can choose the price $$$B=6$$$ and then all the differences between old and new price $$$B=6$$$ will be no ... | PASSED | 900 | standard input | 1 second | The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 100$$$) — the number of queries. Each query is presented by two lines. The first line of the query contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100, 1 \le k \le 10^8$$$) — the number of products and the value $$$k$$$. The second line ... | ["2\n6\n-1\n7"] | #include<stdio.h>
int main()
{
int t, m;
scanf("%d",&t);
m=t-1;
int arr[t];
while(t--)
{
int n,k,min=1e8,max=0;
scanf("%d%d",&n,&k);
int ar;
for(int i=0;i<n;i++)
{
scanf("%d",&ar);
if(ar>max)
max=ar;
if(ar<min)
min=ar;
}
if(max-min>(2*k))
arr[... | |
There are $$$n$$$ products in the shop. The price of the $$$i$$$-th product is $$$a_i$$$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.In fact, the owner of the shop can change the price of some product $$$i$$$ in such a way that the difference between ... | Print $$$q$$$ integers, where the $$$i$$$-th integer is the answer $$$B$$$ on the $$$i$$$-th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition $$$|a_i - B| \le k$$$ should be satisfied (where $$$a_i$$$ is the old price of the product and $$$B$$$ is ... | C | 3b158306d335459ff55dcf29e46010e8 | 462218ab43b3b24d7c92b9e148785f19 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1561559700 | ["4\n5 1\n1 1 2 3 1\n4 2\n6 4 8 5\n2 2\n1 6\n3 5\n5 2 5"] | NoteIn the first example query you can choose the price $$$B=2$$$. It is easy to see that the difference between each old price and each new price $$$B=2$$$ is no more than $$$1$$$.In the second example query you can choose the price $$$B=6$$$ and then all the differences between old and new price $$$B=6$$$ will be no ... | PASSED | 900 | standard input | 1 second | The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 100$$$) — the number of queries. Each query is presented by two lines. The first line of the query contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100, 1 \le k \le 10^8$$$) — the number of products and the value $$$k$$$. The second line ... | ["2\n6\n-1\n7"] | #include <stdio.h>
int q, n, k, a[102];
int main(){
scanf("%d", &q);
while (q != 0){
int i;
scanf("%d%d", &n, &k);
for (i = 0; i < n; i++) scanf("%d", &a[i]);
int min = a[0] + k, max = a[0] - k;
for (i = 1; i < n; i ++){
if (a[i] + k < min) min = a[i] + k;
... | |
There are $$$n$$$ products in the shop. The price of the $$$i$$$-th product is $$$a_i$$$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.In fact, the owner of the shop can change the price of some product $$$i$$$ in such a way that the difference between ... | Print $$$q$$$ integers, where the $$$i$$$-th integer is the answer $$$B$$$ on the $$$i$$$-th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition $$$|a_i - B| \le k$$$ should be satisfied (where $$$a_i$$$ is the old price of the product and $$$B$$$ is ... | C | 3b158306d335459ff55dcf29e46010e8 | 31993798aee6393d9e0edfabc03d7b3e | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1561559700 | ["4\n5 1\n1 1 2 3 1\n4 2\n6 4 8 5\n2 2\n1 6\n3 5\n5 2 5"] | NoteIn the first example query you can choose the price $$$B=2$$$. It is easy to see that the difference between each old price and each new price $$$B=2$$$ is no more than $$$1$$$.In the second example query you can choose the price $$$B=6$$$ and then all the differences between old and new price $$$B=6$$$ will be no ... | PASSED | 900 | standard input | 1 second | The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 100$$$) — the number of queries. Each query is presented by two lines. The first line of the query contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100, 1 \le k \le 10^8$$$) — the number of products and the value $$$k$$$. The second line ... | ["2\n6\n-1\n7"] | #include<stdio.h>
#include<math.h>
int main()
{
long long int T,N,K,i,j,l,k,f,min;
scanf("%lld",&T);
for(i=0;i<T;i++)
{
f=0;
min=0;
scanf("%lld %lld",&N,&K);
long long int ar[N];
scanf("%lld",&ar[0]);
min=ar[0];
// printf("min=%lld",min);
for(j=1;j<N;j++)
{
scanf("%lld",&ar[j]);
if(min>ar[j])... | |
There are $$$n$$$ products in the shop. The price of the $$$i$$$-th product is $$$a_i$$$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.In fact, the owner of the shop can change the price of some product $$$i$$$ in such a way that the difference between ... | Print $$$q$$$ integers, where the $$$i$$$-th integer is the answer $$$B$$$ on the $$$i$$$-th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition $$$|a_i - B| \le k$$$ should be satisfied (where $$$a_i$$$ is the old price of the product and $$$B$$$ is ... | C | 3b158306d335459ff55dcf29e46010e8 | 2c58e91a2f3bda6e5cc4669490ade2e7 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1561559700 | ["4\n5 1\n1 1 2 3 1\n4 2\n6 4 8 5\n2 2\n1 6\n3 5\n5 2 5"] | NoteIn the first example query you can choose the price $$$B=2$$$. It is easy to see that the difference between each old price and each new price $$$B=2$$$ is no more than $$$1$$$.In the second example query you can choose the price $$$B=6$$$ and then all the differences between old and new price $$$B=6$$$ will be no ... | PASSED | 900 | standard input | 1 second | The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 100$$$) — the number of queries. Each query is presented by two lines. The first line of the query contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100, 1 \le k \le 10^8$$$) — the number of products and the value $$$k$$$. The second line ... | ["2\n6\n-1\n7"] | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define max(l,r) ((l)>(r)?l:r)
#define min(l,r) ((l)<(r)?l:r)
#define swap(l,r) {ll tp=l;l=r;r=tp;}
const ll MOD = 1000000007;
const int INF = (1<<30); // > 10^9
const ll LI... | |
There are $$$n$$$ products in the shop. The price of the $$$i$$$-th product is $$$a_i$$$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.In fact, the owner of the shop can change the price of some product $$$i$$$ in such a way that the difference between ... | Print $$$q$$$ integers, where the $$$i$$$-th integer is the answer $$$B$$$ on the $$$i$$$-th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition $$$|a_i - B| \le k$$$ should be satisfied (where $$$a_i$$$ is the old price of the product and $$$B$$$ is ... | C | 3b158306d335459ff55dcf29e46010e8 | 4b3a9f48c13acf1124bb5838de422762 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1561559700 | ["4\n5 1\n1 1 2 3 1\n4 2\n6 4 8 5\n2 2\n1 6\n3 5\n5 2 5"] | NoteIn the first example query you can choose the price $$$B=2$$$. It is easy to see that the difference between each old price and each new price $$$B=2$$$ is no more than $$$1$$$.In the second example query you can choose the price $$$B=6$$$ and then all the differences between old and new price $$$B=6$$$ will be no ... | PASSED | 900 | standard input | 1 second | The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 100$$$) — the number of queries. Each query is presented by two lines. The first line of the query contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100, 1 \le k \le 10^8$$$) — the number of products and the value $$$k$$$. The second line ... | ["2\n6\n-1\n7"] | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define max(l,r) ((l)>(r)?l:r)
#define min(l,r) ((l)<(r)?l:r)
#define swap(l,r) {ll tp=l;l=r;r=tp;}
const ll MOD = 1000000007;
const int INF = (1<<30); // > 10^9
const ll LI... | |
There are $$$n$$$ products in the shop. The price of the $$$i$$$-th product is $$$a_i$$$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.In fact, the owner of the shop can change the price of some product $$$i$$$ in such a way that the difference between ... | Print $$$q$$$ integers, where the $$$i$$$-th integer is the answer $$$B$$$ on the $$$i$$$-th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition $$$|a_i - B| \le k$$$ should be satisfied (where $$$a_i$$$ is the old price of the product and $$$B$$$ is ... | C | 3b158306d335459ff55dcf29e46010e8 | ec936d4af6ef05c078c90c2236fab5b4 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1561559700 | ["4\n5 1\n1 1 2 3 1\n4 2\n6 4 8 5\n2 2\n1 6\n3 5\n5 2 5"] | NoteIn the first example query you can choose the price $$$B=2$$$. It is easy to see that the difference between each old price and each new price $$$B=2$$$ is no more than $$$1$$$.In the second example query you can choose the price $$$B=6$$$ and then all the differences between old and new price $$$B=6$$$ will be no ... | PASSED | 900 | standard input | 1 second | The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 100$$$) — the number of queries. Each query is presented by two lines. The first line of the query contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100, 1 \le k \le 10^8$$$) — the number of products and the value $$$k$$$. The second line ... | ["2\n6\n-1\n7"] | #include <stdio.h>
void solve(){
int n, k;
scanf("%d%d", &n, &k);
int mx = 0, mn = 1e8 + 1;
for(int i = 0; i < n; i++){
int a;
scanf("%d", &a);
if(mx < a) mx = a;
if(mn > a) mn = a;
}
if(mn + 2 * k < mx) printf("-1\n");
else printf("%d\n", mn + k);
}
int mai... | |
There are $$$n$$$ products in the shop. The price of the $$$i$$$-th product is $$$a_i$$$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.In fact, the owner of the shop can change the price of some product $$$i$$$ in such a way that the difference between ... | Print $$$q$$$ integers, where the $$$i$$$-th integer is the answer $$$B$$$ on the $$$i$$$-th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition $$$|a_i - B| \le k$$$ should be satisfied (where $$$a_i$$$ is the old price of the product and $$$B$$$ is ... | C | 3b158306d335459ff55dcf29e46010e8 | c7484d3919c2df0aa62cff892106c590 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1561559700 | ["4\n5 1\n1 1 2 3 1\n4 2\n6 4 8 5\n2 2\n1 6\n3 5\n5 2 5"] | NoteIn the first example query you can choose the price $$$B=2$$$. It is easy to see that the difference between each old price and each new price $$$B=2$$$ is no more than $$$1$$$.In the second example query you can choose the price $$$B=6$$$ and then all the differences between old and new price $$$B=6$$$ will be no ... | PASSED | 900 | standard input | 1 second | The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 100$$$) — the number of queries. Each query is presented by two lines. The first line of the query contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100, 1 \le k \le 10^8$$$) — the number of products and the value $$$k$$$. The second line ... | ["2\n6\n-1\n7"] | #include <stdio.h>
int a[200];
void swap(int *a, int *b){
int tmp;
tmp = *a; *a = *b; *b = tmp;
}
void bubble_sort(int *a, int sz){
for(int i = 0; i < sz - 1; i++){
for(int j = i + 1; j < sz; j++){
if(a[i] > a[j]) swap(&a[i], &a[j]);
}
}
}
void solve(){
int n, k;
... | |
There are $$$n$$$ products in the shop. The price of the $$$i$$$-th product is $$$a_i$$$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.In fact, the owner of the shop can change the price of some product $$$i$$$ in such a way that the difference between ... | Print $$$q$$$ integers, where the $$$i$$$-th integer is the answer $$$B$$$ on the $$$i$$$-th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition $$$|a_i - B| \le k$$$ should be satisfied (where $$$a_i$$$ is the old price of the product and $$$B$$$ is ... | C | 3b158306d335459ff55dcf29e46010e8 | 1283433b81e1ef45e67948c715a5c526 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1561559700 | ["4\n5 1\n1 1 2 3 1\n4 2\n6 4 8 5\n2 2\n1 6\n3 5\n5 2 5"] | NoteIn the first example query you can choose the price $$$B=2$$$. It is easy to see that the difference between each old price and each new price $$$B=2$$$ is no more than $$$1$$$.In the second example query you can choose the price $$$B=6$$$ and then all the differences between old and new price $$$B=6$$$ will be no ... | PASSED | 900 | standard input | 1 second | The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 100$$$) — the number of queries. Each query is presented by two lines. The first line of the query contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100, 1 \le k \le 10^8$$$) — the number of products and the value $$$k$$$. The second line ... | ["2\n6\n-1\n7"] | #include <stdio.h>
int a[150];
void solve(){
int n, k;
int mx = 0, mn = 1e8 + 1;
scanf("%d%d", &n, &k);
for(int i = 0; i < n; i++){
int x;
scanf("%d", &x);
if(mx < x) mx = x;
if(mn > x) mn = x;
}
if(mx - mn > 2 * k) printf("-1\n");
else printf("%d\n", mn + k... | |
There are $$$n$$$ products in the shop. The price of the $$$i$$$-th product is $$$a_i$$$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.In fact, the owner of the shop can change the price of some product $$$i$$$ in such a way that the difference between ... | Print $$$q$$$ integers, where the $$$i$$$-th integer is the answer $$$B$$$ on the $$$i$$$-th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition $$$|a_i - B| \le k$$$ should be satisfied (where $$$a_i$$$ is the old price of the product and $$$B$$$ is ... | C | 3b158306d335459ff55dcf29e46010e8 | 070c778ad6d179dfae89b10f0a596587 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1561559700 | ["4\n5 1\n1 1 2 3 1\n4 2\n6 4 8 5\n2 2\n1 6\n3 5\n5 2 5"] | NoteIn the first example query you can choose the price $$$B=2$$$. It is easy to see that the difference between each old price and each new price $$$B=2$$$ is no more than $$$1$$$.In the second example query you can choose the price $$$B=6$$$ and then all the differences between old and new price $$$B=6$$$ will be no ... | PASSED | 900 | standard input | 1 second | The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 100$$$) — the number of queries. Each query is presented by two lines. The first line of the query contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100, 1 \le k \le 10^8$$$) — the number of products and the value $$$k$$$. The second line ... | ["2\n6\n-1\n7"] | #include <stdio.h>
int solve () {
int min, max, x, n, k, i = 0;
scanf("%d %d", &n, &k);
for (; i < n; i++) {
scanf("%d", &x);
if (i == 0) {
min = x;
max = x;
}
if (x < min) min = x;
if (x > max) max = x;
}
if (min + k < max - k) return -1;
return min + k;
}
int main () {
int q, i = 0;
scanf("%... | |
There are $$$n$$$ products in the shop. The price of the $$$i$$$-th product is $$$a_i$$$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.In fact, the owner of the shop can change the price of some product $$$i$$$ in such a way that the difference between ... | Print $$$q$$$ integers, where the $$$i$$$-th integer is the answer $$$B$$$ on the $$$i$$$-th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition $$$|a_i - B| \le k$$$ should be satisfied (where $$$a_i$$$ is the old price of the product and $$$B$$$ is ... | C | 3b158306d335459ff55dcf29e46010e8 | 415a631bfcc9e2dd023903d763c46d3f | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1561559700 | ["4\n5 1\n1 1 2 3 1\n4 2\n6 4 8 5\n2 2\n1 6\n3 5\n5 2 5"] | NoteIn the first example query you can choose the price $$$B=2$$$. It is easy to see that the difference between each old price and each new price $$$B=2$$$ is no more than $$$1$$$.In the second example query you can choose the price $$$B=6$$$ and then all the differences between old and new price $$$B=6$$$ will be no ... | PASSED | 900 | standard input | 1 second | The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 100$$$) — the number of queries. Each query is presented by two lines. The first line of the query contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100, 1 \le k \le 10^8$$$) — the number of products and the value $$$k$$$. The second line ... | ["2\n6\n-1\n7"] | #include <stdio.h>
int abs(int x);
int main(){
int queryNum;
scanf("%d", &queryNum);
for (int i = 0; i < queryNum; i++){
int max = 0, min = 100000000, n, k, a;
scanf("%d %d", &n, &k);
for (int i = 0; i < n; i++){
scanf("%d", &a);
if (a > max)
... | |
There are $$$n$$$ products in the shop. The price of the $$$i$$$-th product is $$$a_i$$$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.In fact, the owner of the shop can change the price of some product $$$i$$$ in such a way that the difference between ... | Print $$$q$$$ integers, where the $$$i$$$-th integer is the answer $$$B$$$ on the $$$i$$$-th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition $$$|a_i - B| \le k$$$ should be satisfied (where $$$a_i$$$ is the old price of the product and $$$B$$$ is ... | C | 3b158306d335459ff55dcf29e46010e8 | 3f1555cb4d11cea3e93d7602643cef18 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1561559700 | ["4\n5 1\n1 1 2 3 1\n4 2\n6 4 8 5\n2 2\n1 6\n3 5\n5 2 5"] | NoteIn the first example query you can choose the price $$$B=2$$$. It is easy to see that the difference between each old price and each new price $$$B=2$$$ is no more than $$$1$$$.In the second example query you can choose the price $$$B=6$$$ and then all the differences between old and new price $$$B=6$$$ will be no ... | PASSED | 900 | standard input | 1 second | The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 100$$$) — the number of queries. Each query is presented by two lines. The first line of the query contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100, 1 \le k \le 10^8$$$) — the number of products and the value $$$k$$$. The second line ... | ["2\n6\n-1\n7"] | #include <stdio.h>
int main()
{
int t, n, k, i, maxx, minn;
int a[105];
scanf("%d", &t);
while(t--)
{
scanf("%d %d", &n, &k);
for(i=0;i<n;i++)
{
scanf("%d", &a[i]);
if(i==0||a[i]>maxx) maxx = a[i];
if(i==0||a[i]<minn) minn = a[i];
... | |
There are $$$n$$$ products in the shop. The price of the $$$i$$$-th product is $$$a_i$$$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.In fact, the owner of the shop can change the price of some product $$$i$$$ in such a way that the difference between ... | Print $$$q$$$ integers, where the $$$i$$$-th integer is the answer $$$B$$$ on the $$$i$$$-th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition $$$|a_i - B| \le k$$$ should be satisfied (where $$$a_i$$$ is the old price of the product and $$$B$$$ is ... | C | 3b158306d335459ff55dcf29e46010e8 | 2cb4d28cd2085be4724eb03d573df8d3 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1561559700 | ["4\n5 1\n1 1 2 3 1\n4 2\n6 4 8 5\n2 2\n1 6\n3 5\n5 2 5"] | NoteIn the first example query you can choose the price $$$B=2$$$. It is easy to see that the difference between each old price and each new price $$$B=2$$$ is no more than $$$1$$$.In the second example query you can choose the price $$$B=6$$$ and then all the differences between old and new price $$$B=6$$$ will be no ... | PASSED | 900 | standard input | 1 second | The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 100$$$) — the number of queries. Each query is presented by two lines. The first line of the query contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100, 1 \le k \le 10^8$$$) — the number of products and the value $$$k$$$. The second line ... | ["2\n6\n-1\n7"] | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
int valid(int ar[],int n,int k,int mid){
int i;
int flag = 0;
for(i=0;i<n;i++){
if(mid>=ar[i]){
if((k+ar[i])<mid){
flag = 1;
break;
}
}
else if(m... | |
There are $$$n$$$ products in the shop. The price of the $$$i$$$-th product is $$$a_i$$$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.In fact, the owner of the shop can change the price of some product $$$i$$$ in such a way that the difference between ... | Print $$$q$$$ integers, where the $$$i$$$-th integer is the answer $$$B$$$ on the $$$i$$$-th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition $$$|a_i - B| \le k$$$ should be satisfied (where $$$a_i$$$ is the old price of the product and $$$B$$$ is ... | C | 3b158306d335459ff55dcf29e46010e8 | 549d8b73a566169a74321d942916f862 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1561559700 | ["4\n5 1\n1 1 2 3 1\n4 2\n6 4 8 5\n2 2\n1 6\n3 5\n5 2 5"] | NoteIn the first example query you can choose the price $$$B=2$$$. It is easy to see that the difference between each old price and each new price $$$B=2$$$ is no more than $$$1$$$.In the second example query you can choose the price $$$B=6$$$ and then all the differences between old and new price $$$B=6$$$ will be no ... | PASSED | 900 | standard input | 1 second | The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 100$$$) — the number of queries. Each query is presented by two lines. The first line of the query contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100, 1 \le k \le 10^8$$$) — the number of products and the value $$$k$$$. The second line ... | ["2\n6\n-1\n7"] | #include<stdio.h>
int main()
{
long long int t,i,n,k,max,min,j,a,b,s;
scanf("%lld",&t);
for(i=0;i<t;i++)
{
scanf("%lld %lld",&n,&k);
max=0;
min=100000001;
for(j=0;j<n;j++)
{
scanf("%lld",&a);
if(a>max)
{
max=a;
... | |
There are $$$n$$$ products in the shop. The price of the $$$i$$$-th product is $$$a_i$$$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.In fact, the owner of the shop can change the price of some product $$$i$$$ in such a way that the difference between ... | Print $$$q$$$ integers, where the $$$i$$$-th integer is the answer $$$B$$$ on the $$$i$$$-th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition $$$|a_i - B| \le k$$$ should be satisfied (where $$$a_i$$$ is the old price of the product and $$$B$$$ is ... | C | 3b158306d335459ff55dcf29e46010e8 | dab351b9f50ff007e625d52b353d759f | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1561559700 | ["4\n5 1\n1 1 2 3 1\n4 2\n6 4 8 5\n2 2\n1 6\n3 5\n5 2 5"] | NoteIn the first example query you can choose the price $$$B=2$$$. It is easy to see that the difference between each old price and each new price $$$B=2$$$ is no more than $$$1$$$.In the second example query you can choose the price $$$B=6$$$ and then all the differences between old and new price $$$B=6$$$ will be no ... | PASSED | 900 | standard input | 1 second | The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 100$$$) — the number of queries. Each query is presented by two lines. The first line of the query contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100, 1 \le k \le 10^8$$$) — the number of products and the value $$$k$$$. The second line ... | ["2\n6\n-1\n7"] | #include <stdio.h>
#include <stdlib.h>
int main()
{
int q,i,min,max;
scanf("%d",&q);
int answ[q],n,k;
for(int j=0;j<q;j++){
scanf("%d%d",&n,&k);
int a[n];
scanf("%d",&a[0]);
min=max=a[0];
for(i=1;i<n;i++){
scanf("%d",&a[i]);
if(min>a[i])mi... | |
There are $$$n$$$ products in the shop. The price of the $$$i$$$-th product is $$$a_i$$$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.In fact, the owner of the shop can change the price of some product $$$i$$$ in such a way that the difference between ... | Print $$$q$$$ integers, where the $$$i$$$-th integer is the answer $$$B$$$ on the $$$i$$$-th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition $$$|a_i - B| \le k$$$ should be satisfied (where $$$a_i$$$ is the old price of the product and $$$B$$$ is ... | C | 3b158306d335459ff55dcf29e46010e8 | 5b0eb9c68749ef1f71ebdb198219666b | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1561559700 | ["4\n5 1\n1 1 2 3 1\n4 2\n6 4 8 5\n2 2\n1 6\n3 5\n5 2 5"] | NoteIn the first example query you can choose the price $$$B=2$$$. It is easy to see that the difference between each old price and each new price $$$B=2$$$ is no more than $$$1$$$.In the second example query you can choose the price $$$B=6$$$ and then all the differences between old and new price $$$B=6$$$ will be no ... | PASSED | 900 | standard input | 1 second | The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 100$$$) — the number of queries. Each query is presented by two lines. The first line of the query contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100, 1 \le k \le 10^8$$$) — the number of products and the value $$$k$$$. The second line ... | ["2\n6\n-1\n7"] | #include<stdio.h>
#include<malloc.h>
void swap(int*x,int*y)
{
int temp;
temp=*x;
*x=*y;
*y=temp;
}
void bubblesort(int arr[],int num)
{
int i,j;
for(i=0;i<num-1;i++)
{
for(j=0;j<num-1-i;j++)
{
if(arr[j]>arr[j+1])
swap(&arr[j],&arr[j+1]);
}
... | |
There are $$$n$$$ products in the shop. The price of the $$$i$$$-th product is $$$a_i$$$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.In fact, the owner of the shop can change the price of some product $$$i$$$ in such a way that the difference between ... | Print $$$q$$$ integers, where the $$$i$$$-th integer is the answer $$$B$$$ on the $$$i$$$-th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition $$$|a_i - B| \le k$$$ should be satisfied (where $$$a_i$$$ is the old price of the product and $$$B$$$ is ... | C | 3b158306d335459ff55dcf29e46010e8 | 9a3ed271366e45d421e078433a07e2c1 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1561559700 | ["4\n5 1\n1 1 2 3 1\n4 2\n6 4 8 5\n2 2\n1 6\n3 5\n5 2 5"] | NoteIn the first example query you can choose the price $$$B=2$$$. It is easy to see that the difference between each old price and each new price $$$B=2$$$ is no more than $$$1$$$.In the second example query you can choose the price $$$B=6$$$ and then all the differences between old and new price $$$B=6$$$ will be no ... | PASSED | 900 | standard input | 1 second | The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 100$$$) — the number of queries. Each query is presented by two lines. The first line of the query contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100, 1 \le k \le 10^8$$$) — the number of products and the value $$$k$$$. The second line ... | ["2\n6\n-1\n7"] | #include<stdio.h>
#include<malloc.h>
void swap(int*x,int*y)
{
int temp;
temp=*x;
*x=*y;
*y=temp;
}
void bubblesort(int arr[],int num)
{
int i,j;
for(i=0;i<num-1;i++)
{
for(j=0;j<num-1-i;j++)
{
if(arr[j]>arr[j+1])
swap(&arr[j],&arr[j+1]);
}
... | |
There are $$$n$$$ products in the shop. The price of the $$$i$$$-th product is $$$a_i$$$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.In fact, the owner of the shop can change the price of some product $$$i$$$ in such a way that the difference between ... | Print $$$q$$$ integers, where the $$$i$$$-th integer is the answer $$$B$$$ on the $$$i$$$-th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition $$$|a_i - B| \le k$$$ should be satisfied (where $$$a_i$$$ is the old price of the product and $$$B$$$ is ... | C | 3b158306d335459ff55dcf29e46010e8 | cf21c0c761bf5a93d24caef6836d4a36 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1561559700 | ["4\n5 1\n1 1 2 3 1\n4 2\n6 4 8 5\n2 2\n1 6\n3 5\n5 2 5"] | NoteIn the first example query you can choose the price $$$B=2$$$. It is easy to see that the difference between each old price and each new price $$$B=2$$$ is no more than $$$1$$$.In the second example query you can choose the price $$$B=6$$$ and then all the differences between old and new price $$$B=6$$$ will be no ... | PASSED | 900 | standard input | 1 second | The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 100$$$) — the number of queries. Each query is presented by two lines. The first line of the query contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100, 1 \le k \le 10^8$$$) — the number of products and the value $$$k$$$. The second line ... | ["2\n6\n-1\n7"] | #include<stdio.h>
int main()
{ int t,i;
scanf("%d",&t);
for(i=0;i<t;i++)
{ long int n,k;
scanf("%ld %ld",&n,&k);
long int a[n],j,l;
for(j=0;j<n;j++)
{ scanf("%ld",&a[j]);
}
long int min=a[0],max=a[1];
for(l=0;l<n;l++)
{ if(a[l]>max)
max=a[l];
else
max=max+1-1;
if(a[l]<min)
min=a[l];
else
min=min+1-1;
}
if(... | |
There are $$$n$$$ products in the shop. The price of the $$$i$$$-th product is $$$a_i$$$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.In fact, the owner of the shop can change the price of some product $$$i$$$ in such a way that the difference between ... | Print $$$q$$$ integers, where the $$$i$$$-th integer is the answer $$$B$$$ on the $$$i$$$-th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition $$$|a_i - B| \le k$$$ should be satisfied (where $$$a_i$$$ is the old price of the product and $$$B$$$ is ... | C | 3b158306d335459ff55dcf29e46010e8 | 0492e5b7992dbfe7fb213312f317021a | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1561559700 | ["4\n5 1\n1 1 2 3 1\n4 2\n6 4 8 5\n2 2\n1 6\n3 5\n5 2 5"] | NoteIn the first example query you can choose the price $$$B=2$$$. It is easy to see that the difference between each old price and each new price $$$B=2$$$ is no more than $$$1$$$.In the second example query you can choose the price $$$B=6$$$ and then all the differences between old and new price $$$B=6$$$ will be no ... | PASSED | 900 | standard input | 1 second | The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 100$$$) — the number of queries. Each query is presented by two lines. The first line of the query contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100, 1 \le k \le 10^8$$$) — the number of products and the value $$$k$$$. The second line ... | ["2\n6\n-1\n7"] | #include<stdio.h>
int main(void)
{
int i,j,n,q;
scanf("%d",&q);
long int a,k,min,max;
for(i=0;i<q;i++)
{
scanf("%d %ld",&n,&k);
for(j=0,max=-1;j<n;j++)
{
scanf("%ld",&a);
if(!j)
min=a;
else
min=min>a?a:min;
... | |
There are $$$n$$$ products in the shop. The price of the $$$i$$$-th product is $$$a_i$$$. The owner of the shop wants to equalize the prices of all products. However, he wants to change prices smoothly.In fact, the owner of the shop can change the price of some product $$$i$$$ in such a way that the difference between ... | Print $$$q$$$ integers, where the $$$i$$$-th integer is the answer $$$B$$$ on the $$$i$$$-th query. If it is impossible to equalize prices of all given products with restriction that for all products the condition $$$|a_i - B| \le k$$$ should be satisfied (where $$$a_i$$$ is the old price of the product and $$$B$$$ is ... | C | 3b158306d335459ff55dcf29e46010e8 | 1b8683603f9c1a3337859a043497f14d | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1561559700 | ["4\n5 1\n1 1 2 3 1\n4 2\n6 4 8 5\n2 2\n1 6\n3 5\n5 2 5"] | NoteIn the first example query you can choose the price $$$B=2$$$. It is easy to see that the difference between each old price and each new price $$$B=2$$$ is no more than $$$1$$$.In the second example query you can choose the price $$$B=6$$$ and then all the differences between old and new price $$$B=6$$$ will be no ... | PASSED | 900 | standard input | 1 second | The first line of the input contains one integer $$$q$$$ ($$$1 \le q \le 100$$$) — the number of queries. Each query is presented by two lines. The first line of the query contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100, 1 \le k \le 10^8$$$) — the number of products and the value $$$k$$$. The second line ... | ["2\n6\n-1\n7"] | #include <stdio.h>
int main()
{
int q;
scanf("%d", &q);
for(int i=0; i<q; i++){
int n;
long long int min, max;
scanf("%d", &n);
long long int k, ara[n];
scanf("%I64d", &k);
for(int j=0; j<n; j++){
scanf("%I64d", &ara[j]);
}
min =... | |
Pavel has several sticks with lengths equal to powers of two.He has $$$a_0$$$ sticks of length $$$2^0 = 1$$$, $$$a_1$$$ sticks of length $$$2^1 = 2$$$, ..., $$$a_{n-1}$$$ sticks of length $$$2^{n-1}$$$. Pavel wants to make the maximum possible number of triangles using these sticks. The triangles should have strictly p... | Print a single integer — the maximum possible number of non-degenerate triangles that Pavel can make. | C | a8f3e94845cb15a483ce8f774779efac | 9a13216aa625a7e00b9eda8f3b04381e | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"dp",
"greedy",
"fft",
"ternary search",
"brute force"
] | 1554550500 | ["5\n1 2 2 2 2", "3\n1 1 1", "3\n3 3 3"] | NoteIn the first example, Pavel can, for example, make this set of triangles (the lengths of the sides of the triangles are listed): $$$(2^0, 2^4, 2^4)$$$, $$$(2^1, 2^3, 2^3)$$$, $$$(2^1, 2^2, 2^2)$$$.In the second example, Pavel cannot make a single triangle.In the third example, Pavel can, for example, create this se... | PASSED | 1,900 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 300\,000$$$) — the number of different lengths of sticks. The second line contains $$$n$$$ integers $$$a_0$$$, $$$a_1$$$, ..., $$$a_{n-1}$$$ ($$$1 \leq a_i \leq 10^9$$$), where $$$a_i$$$ is the number of sticks with the length equal to $$$2^i$$$. | ["3", "0", "3"] | #include<stdio.h>
#define ll long long
int main()
{
long long int n;
scanf("%lld",&n);
ll cnt=0,cnt1=0,temp;
for(int i=0;i<n;i++)
{
scanf("%lld",&temp);
if(temp==1)
cnt1++;
else if(temp==2)
{
if(cnt1>0)
{
cnt1--;
cnt++;
}
else
cnt1+=2;
}
else
{
while(temp>=2&&cnt1)
{
... | |
Pavel has several sticks with lengths equal to powers of two.He has $$$a_0$$$ sticks of length $$$2^0 = 1$$$, $$$a_1$$$ sticks of length $$$2^1 = 2$$$, ..., $$$a_{n-1}$$$ sticks of length $$$2^{n-1}$$$. Pavel wants to make the maximum possible number of triangles using these sticks. The triangles should have strictly p... | Print a single integer — the maximum possible number of non-degenerate triangles that Pavel can make. | C | a8f3e94845cb15a483ce8f774779efac | a100fe7b2e217df5488c86a0e1fb3d3d | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"dp",
"greedy",
"fft",
"ternary search",
"brute force"
] | 1554550500 | ["5\n1 2 2 2 2", "3\n1 1 1", "3\n3 3 3"] | NoteIn the first example, Pavel can, for example, make this set of triangles (the lengths of the sides of the triangles are listed): $$$(2^0, 2^4, 2^4)$$$, $$$(2^1, 2^3, 2^3)$$$, $$$(2^1, 2^2, 2^2)$$$.In the second example, Pavel cannot make a single triangle.In the third example, Pavel can, for example, create this se... | PASSED | 1,900 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 300\,000$$$) — the number of different lengths of sticks. The second line contains $$$n$$$ integers $$$a_0$$$, $$$a_1$$$, ..., $$$a_{n-1}$$$ ($$$1 \leq a_i \leq 10^9$$$), where $$$a_i$$$ is the number of sticks with the length equal to $$$2^i$$$. | ["3", "0", "3"] | #include<stdio.h>
int main(void){
unsigned long n,p;unsigned long long g=0;int count=0;
scanf("%lu\n",&n);
while(n>0){
scanf("%lu",&p);
while(p>1){
if(count!=0){
count--;
g++;
p=p-2;
}
else{
g=g+p/3;
if((p%3)==1)
count++;
else if((p%3)==2)
count=count+2;
p=0;
... | |
Pavel has several sticks with lengths equal to powers of two.He has $$$a_0$$$ sticks of length $$$2^0 = 1$$$, $$$a_1$$$ sticks of length $$$2^1 = 2$$$, ..., $$$a_{n-1}$$$ sticks of length $$$2^{n-1}$$$. Pavel wants to make the maximum possible number of triangles using these sticks. The triangles should have strictly p... | Print a single integer — the maximum possible number of non-degenerate triangles that Pavel can make. | C | a8f3e94845cb15a483ce8f774779efac | c261af7304e6af20abfb823cd39d89dd | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"dp",
"greedy",
"fft",
"ternary search",
"brute force"
] | 1554550500 | ["5\n1 2 2 2 2", "3\n1 1 1", "3\n3 3 3"] | NoteIn the first example, Pavel can, for example, make this set of triangles (the lengths of the sides of the triangles are listed): $$$(2^0, 2^4, 2^4)$$$, $$$(2^1, 2^3, 2^3)$$$, $$$(2^1, 2^2, 2^2)$$$.In the second example, Pavel cannot make a single triangle.In the third example, Pavel can, for example, create this se... | PASSED | 1,900 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 300\,000$$$) — the number of different lengths of sticks. The second line contains $$$n$$$ integers $$$a_0$$$, $$$a_1$$$, ..., $$$a_{n-1}$$$ ($$$1 \leq a_i \leq 10^9$$$), where $$$a_i$$$ is the number of sticks with the length equal to $$$2^i$$$. | ["3", "0", "3"] | #include<stdio.h>
int main()
{
long long int n,basket=0,c=0,pair,a;
scanf("%lld", &n);
for(int i=1;i<=n;i++)
{
scanf("%lld", &a);
pair=a/2;
if (basket<(a/2))
pair=basket;
basket-=pair;
a-=2*pair;
c+=pair+a/3;
basket+=a%3;
}
printf("%lld", c);
return 0;
} | |
Pavel has several sticks with lengths equal to powers of two.He has $$$a_0$$$ sticks of length $$$2^0 = 1$$$, $$$a_1$$$ sticks of length $$$2^1 = 2$$$, ..., $$$a_{n-1}$$$ sticks of length $$$2^{n-1}$$$. Pavel wants to make the maximum possible number of triangles using these sticks. The triangles should have strictly p... | Print a single integer — the maximum possible number of non-degenerate triangles that Pavel can make. | C | a8f3e94845cb15a483ce8f774779efac | 309811e127444cb4573c451d296f33c9 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"dp",
"greedy",
"fft",
"ternary search",
"brute force"
] | 1554550500 | ["5\n1 2 2 2 2", "3\n1 1 1", "3\n3 3 3"] | NoteIn the first example, Pavel can, for example, make this set of triangles (the lengths of the sides of the triangles are listed): $$$(2^0, 2^4, 2^4)$$$, $$$(2^1, 2^3, 2^3)$$$, $$$(2^1, 2^2, 2^2)$$$.In the second example, Pavel cannot make a single triangle.In the third example, Pavel can, for example, create this se... | PASSED | 1,900 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 300\,000$$$) — the number of different lengths of sticks. The second line contains $$$n$$$ integers $$$a_0$$$, $$$a_1$$$, ..., $$$a_{n-1}$$$ ($$$1 \leq a_i \leq 10^9$$$), where $$$a_i$$$ is the number of sticks with the length equal to $$$2^i$$$. | ["3", "0", "3"] | #include<stdio.h>
int main()
{
long long N, count=0;
long long int carry=0;
scanf("%lli", &N);
long long int curr;
while (N>0)
{
scanf("%lli", &curr);
while (carry>0 && curr>1)
{
carry--;
curr=curr-2;
... | |
Pavel has several sticks with lengths equal to powers of two.He has $$$a_0$$$ sticks of length $$$2^0 = 1$$$, $$$a_1$$$ sticks of length $$$2^1 = 2$$$, ..., $$$a_{n-1}$$$ sticks of length $$$2^{n-1}$$$. Pavel wants to make the maximum possible number of triangles using these sticks. The triangles should have strictly p... | Print a single integer — the maximum possible number of non-degenerate triangles that Pavel can make. | C | a8f3e94845cb15a483ce8f774779efac | 6b5b3a1f21519b84fe5c903fef053cc2 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"dp",
"greedy",
"fft",
"ternary search",
"brute force"
] | 1554550500 | ["5\n1 2 2 2 2", "3\n1 1 1", "3\n3 3 3"] | NoteIn the first example, Pavel can, for example, make this set of triangles (the lengths of the sides of the triangles are listed): $$$(2^0, 2^4, 2^4)$$$, $$$(2^1, 2^3, 2^3)$$$, $$$(2^1, 2^2, 2^2)$$$.In the second example, Pavel cannot make a single triangle.In the third example, Pavel can, for example, create this se... | PASSED | 1,900 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 300\,000$$$) — the number of different lengths of sticks. The second line contains $$$n$$$ integers $$$a_0$$$, $$$a_1$$$, ..., $$$a_{n-1}$$$ ($$$1 \leq a_i \leq 10^9$$$), where $$$a_i$$$ is the number of sticks with the length equal to $$$2^i$$$. | ["3", "0", "3"] | #include<stdio.h>
int main()
{
unsigned long long N, count=0;
long long int carry=0;
scanf("%I64u", &N);
long long int curr;
while (N>0)
{
scanf("%I64d", &curr);
while (carry>0 && curr>1)
{
carry--;
curr=curr-2;
count++;
}
count=count+(curr/3);
carry=carry+(curr%3)... | |
Pavel has several sticks with lengths equal to powers of two.He has $$$a_0$$$ sticks of length $$$2^0 = 1$$$, $$$a_1$$$ sticks of length $$$2^1 = 2$$$, ..., $$$a_{n-1}$$$ sticks of length $$$2^{n-1}$$$. Pavel wants to make the maximum possible number of triangles using these sticks. The triangles should have strictly p... | Print a single integer — the maximum possible number of non-degenerate triangles that Pavel can make. | C | a8f3e94845cb15a483ce8f774779efac | b7947f91f0361cd6d5349f83abc44a69 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"dp",
"greedy",
"fft",
"ternary search",
"brute force"
] | 1554550500 | ["5\n1 2 2 2 2", "3\n1 1 1", "3\n3 3 3"] | NoteIn the first example, Pavel can, for example, make this set of triangles (the lengths of the sides of the triangles are listed): $$$(2^0, 2^4, 2^4)$$$, $$$(2^1, 2^3, 2^3)$$$, $$$(2^1, 2^2, 2^2)$$$.In the second example, Pavel cannot make a single triangle.In the third example, Pavel can, for example, create this se... | PASSED | 1,900 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 300\,000$$$) — the number of different lengths of sticks. The second line contains $$$n$$$ integers $$$a_0$$$, $$$a_1$$$, ..., $$$a_{n-1}$$$ ($$$1 \leq a_i \leq 10^9$$$), where $$$a_i$$$ is the number of sticks with the length equal to $$$2^i$$$. | ["3", "0", "3"] | #include<stdio.h>
#include<stdlib.h>
#include<stdint.h>
#include<inttypes.h>
typedef int64_t i64;
typedef int32_t i32;
static void print_int(i64 n){if(n<0){putchar('-');n=-n;}if(n==0){putchar('0');return;}int s[20],len=0;while(n>0){s[len++]=n%10+'0';n/=10;}while(len>0){putchar(s[--len]);}}
static i64 read_int(void){i... | |
Pavel has several sticks with lengths equal to powers of two.He has $$$a_0$$$ sticks of length $$$2^0 = 1$$$, $$$a_1$$$ sticks of length $$$2^1 = 2$$$, ..., $$$a_{n-1}$$$ sticks of length $$$2^{n-1}$$$. Pavel wants to make the maximum possible number of triangles using these sticks. The triangles should have strictly p... | Print a single integer — the maximum possible number of non-degenerate triangles that Pavel can make. | C | a8f3e94845cb15a483ce8f774779efac | 4a8e31be5fc4ab7c7cafcbcd6527e28b | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"dp",
"greedy",
"fft",
"ternary search",
"brute force"
] | 1554550500 | ["5\n1 2 2 2 2", "3\n1 1 1", "3\n3 3 3"] | NoteIn the first example, Pavel can, for example, make this set of triangles (the lengths of the sides of the triangles are listed): $$$(2^0, 2^4, 2^4)$$$, $$$(2^1, 2^3, 2^3)$$$, $$$(2^1, 2^2, 2^2)$$$.In the second example, Pavel cannot make a single triangle.In the third example, Pavel can, for example, create this se... | PASSED | 1,900 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 300\,000$$$) — the number of different lengths of sticks. The second line contains $$$n$$$ integers $$$a_0$$$, $$$a_1$$$, ..., $$$a_{n-1}$$$ ($$$1 \leq a_i \leq 10^9$$$), where $$$a_i$$$ is the number of sticks with the length equal to $$$2^i$$$. | ["3", "0", "3"] | #include<stdio.h>
long long n,a[300000],l=0,mg=0;
int main()
{
scanf("%lld",&n);
for(long long i=0;i<n;i++)
{
scanf("%lld",&a[i]);
}
for(long long i =0;i<n;i++)
{
if (l<=a[i]/2)
{
mg+=l;
a[i]=a[i]-2*l;
l=0;
}
else
{
mg+=a[... | |
Pavel has several sticks with lengths equal to powers of two.He has $$$a_0$$$ sticks of length $$$2^0 = 1$$$, $$$a_1$$$ sticks of length $$$2^1 = 2$$$, ..., $$$a_{n-1}$$$ sticks of length $$$2^{n-1}$$$. Pavel wants to make the maximum possible number of triangles using these sticks. The triangles should have strictly p... | Print a single integer — the maximum possible number of non-degenerate triangles that Pavel can make. | C | a8f3e94845cb15a483ce8f774779efac | 7a7c511e02065d76be4c5f28a58c8566 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"dp",
"greedy",
"fft",
"ternary search",
"brute force"
] | 1554550500 | ["5\n1 2 2 2 2", "3\n1 1 1", "3\n3 3 3"] | NoteIn the first example, Pavel can, for example, make this set of triangles (the lengths of the sides of the triangles are listed): $$$(2^0, 2^4, 2^4)$$$, $$$(2^1, 2^3, 2^3)$$$, $$$(2^1, 2^2, 2^2)$$$.In the second example, Pavel cannot make a single triangle.In the third example, Pavel can, for example, create this se... | PASSED | 1,900 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 300\,000$$$) — the number of different lengths of sticks. The second line contains $$$n$$$ integers $$$a_0$$$, $$$a_1$$$, ..., $$$a_{n-1}$$$ ($$$1 \leq a_i \leq 10^9$$$), where $$$a_i$$$ is the number of sticks with the length equal to $$$2^i$$$. | ["3", "0", "3"] | #include<stdio.h>
#define ll long long
ll min(ll a, ll b)
{
return a<b?a:b;
}
int main()
{
ll mi,n,a,one=0,set=0;
scanf("%lld",&n);
//n=300000;
for(ll i=0; i<n; i++)
{
scanf("%lld",&a);
// a=1000000000;
mi= min(one,a/2);
set+= mi; one-= mi; a-= 2*mi;
set+= a/3;
a= a%3;
one+=a;
}
printf("%lld\... | |
Pavel has several sticks with lengths equal to powers of two.He has $$$a_0$$$ sticks of length $$$2^0 = 1$$$, $$$a_1$$$ sticks of length $$$2^1 = 2$$$, ..., $$$a_{n-1}$$$ sticks of length $$$2^{n-1}$$$. Pavel wants to make the maximum possible number of triangles using these sticks. The triangles should have strictly p... | Print a single integer — the maximum possible number of non-degenerate triangles that Pavel can make. | C | a8f3e94845cb15a483ce8f774779efac | 88ce42878c283de74fdf255b61ce6191 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"dp",
"greedy",
"fft",
"ternary search",
"brute force"
] | 1554550500 | ["5\n1 2 2 2 2", "3\n1 1 1", "3\n3 3 3"] | NoteIn the first example, Pavel can, for example, make this set of triangles (the lengths of the sides of the triangles are listed): $$$(2^0, 2^4, 2^4)$$$, $$$(2^1, 2^3, 2^3)$$$, $$$(2^1, 2^2, 2^2)$$$.In the second example, Pavel cannot make a single triangle.In the third example, Pavel can, for example, create this se... | PASSED | 1,900 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 300\,000$$$) — the number of different lengths of sticks. The second line contains $$$n$$$ integers $$$a_0$$$, $$$a_1$$$, ..., $$$a_{n-1}$$$ ($$$1 \leq a_i \leq 10^9$$$), where $$$a_i$$$ is the number of sticks with the length equal to $$$2^i$$$. | ["3", "0", "3"] | #include<stdio.h>
#define ll long long
long long arr[300005];
#define min(a,b) (a>b)?b:a
int n;
long long solve()
{
// for(int i=0;i<n;i++)
// printf("%lld ",arr[i]);
long long c2=0,c4=0;
long long ans=0;
for(long long i=0;i<n;i++)
{
if(arr[i]==0 || arr[i]==1)
continue;
long long p1=arr[i]%3;
if(p1==1)
... | |
Pavel has several sticks with lengths equal to powers of two.He has $$$a_0$$$ sticks of length $$$2^0 = 1$$$, $$$a_1$$$ sticks of length $$$2^1 = 2$$$, ..., $$$a_{n-1}$$$ sticks of length $$$2^{n-1}$$$. Pavel wants to make the maximum possible number of triangles using these sticks. The triangles should have strictly p... | Print a single integer — the maximum possible number of non-degenerate triangles that Pavel can make. | C | a8f3e94845cb15a483ce8f774779efac | 4576c021aad26d2947bac5f2d1d3b22e | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"dp",
"greedy",
"fft",
"ternary search",
"brute force"
] | 1554550500 | ["5\n1 2 2 2 2", "3\n1 1 1", "3\n3 3 3"] | NoteIn the first example, Pavel can, for example, make this set of triangles (the lengths of the sides of the triangles are listed): $$$(2^0, 2^4, 2^4)$$$, $$$(2^1, 2^3, 2^3)$$$, $$$(2^1, 2^2, 2^2)$$$.In the second example, Pavel cannot make a single triangle.In the third example, Pavel can, for example, create this se... | PASSED | 1,900 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 300\,000$$$) — the number of different lengths of sticks. The second line contains $$$n$$$ integers $$$a_0$$$, $$$a_1$$$, ..., $$$a_{n-1}$$$ ($$$1 \leq a_i \leq 10^9$$$), where $$$a_i$$$ is the number of sticks with the length equal to $$$2^i$$$. | ["3", "0", "3"] | #include<stdio.h>
int main()
{
long long int N,i, gr=0, rem=0;
scanf("%lld", &N);
long long int ar[N];
for(i=0;i<N;i++)
{
scanf("%lld", &ar[i]);
}
for(i=0;i<N;i++)
{
if(ar[i]>=2)
{
if(rem==0)
{
gr+=ar[i]/3;
... | |
Pavel has several sticks with lengths equal to powers of two.He has $$$a_0$$$ sticks of length $$$2^0 = 1$$$, $$$a_1$$$ sticks of length $$$2^1 = 2$$$, ..., $$$a_{n-1}$$$ sticks of length $$$2^{n-1}$$$. Pavel wants to make the maximum possible number of triangles using these sticks. The triangles should have strictly p... | Print a single integer — the maximum possible number of non-degenerate triangles that Pavel can make. | C | a8f3e94845cb15a483ce8f774779efac | 376f2e65b67d050b308298d1e49141c6 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"dp",
"greedy",
"fft",
"ternary search",
"brute force"
] | 1554550500 | ["5\n1 2 2 2 2", "3\n1 1 1", "3\n3 3 3"] | NoteIn the first example, Pavel can, for example, make this set of triangles (the lengths of the sides of the triangles are listed): $$$(2^0, 2^4, 2^4)$$$, $$$(2^1, 2^3, 2^3)$$$, $$$(2^1, 2^2, 2^2)$$$.In the second example, Pavel cannot make a single triangle.In the third example, Pavel can, for example, create this se... | PASSED | 1,900 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 300\,000$$$) — the number of different lengths of sticks. The second line contains $$$n$$$ integers $$$a_0$$$, $$$a_1$$$, ..., $$$a_{n-1}$$$ ($$$1 \leq a_i \leq 10^9$$$), where $$$a_i$$$ is the number of sticks with the length equal to $$$2^i$$$. | ["3", "0", "3"] | #include<stdio.h>
#include<stdlib.h>
int read()
{
int x=0;
char ch = getchar();
while( ch<'0' || ch>'9' ) ch = getchar();
while( ch>='0' && ch<='9' ){
x = (x<<3) + (x<<1) + ch - 48;
ch = getchar();
}
return x;
}
int a[300005]={};
int main()
{
int n;
long long pair=0, ans=0; //见祖宗警告
n = read();
for( int i=... | |
Pavel has several sticks with lengths equal to powers of two.He has $$$a_0$$$ sticks of length $$$2^0 = 1$$$, $$$a_1$$$ sticks of length $$$2^1 = 2$$$, ..., $$$a_{n-1}$$$ sticks of length $$$2^{n-1}$$$. Pavel wants to make the maximum possible number of triangles using these sticks. The triangles should have strictly p... | Print a single integer — the maximum possible number of non-degenerate triangles that Pavel can make. | C | a8f3e94845cb15a483ce8f774779efac | 85fd3392c55513afe4e53bd087d1259a | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"dp",
"greedy",
"fft",
"ternary search",
"brute force"
] | 1554550500 | ["5\n1 2 2 2 2", "3\n1 1 1", "3\n3 3 3"] | NoteIn the first example, Pavel can, for example, make this set of triangles (the lengths of the sides of the triangles are listed): $$$(2^0, 2^4, 2^4)$$$, $$$(2^1, 2^3, 2^3)$$$, $$$(2^1, 2^2, 2^2)$$$.In the second example, Pavel cannot make a single triangle.In the third example, Pavel can, for example, create this se... | PASSED | 1,900 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 300\,000$$$) — the number of different lengths of sticks. The second line contains $$$n$$$ integers $$$a_0$$$, $$$a_1$$$, ..., $$$a_{n-1}$$$ ($$$1 \leq a_i \leq 10^9$$$), where $$$a_i$$$ is the number of sticks with the length equal to $$$2^i$$$. | ["3", "0", "3"] | #include<stdio.h>
int a[300010];
long long s,t;
int ans,n,i;
int main()
{
scanf("%d",&n);
for(i=0;i<n;i++)scanf("%d",&a[i]);
t=0;ans=0;
for(i=n-1;i>=0;i--)
{
s+=a[i];
if(a[i]==0)continue;
if(a[i]%2==0)t=t+a[i]/2;
if(a[i]==1)
{
if(t>0)t--;else ans++;
}
el... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | 1e4a43ef962e80ed64885ed27c3d08db | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include<stdio.h>
#include<string.h>
int main()
{
int t,i,j,l;
char s[1000][1000];
scanf("%d",&t);
for(i=0;i<t;i++)
{
scanf("%s",s[i]);
}
for(i=0;i<t;i++)
{
l = strlen(s[i]);
for(j=0;j<l;j = j+2)
{
printf("%c",s[i][j]);
}
if(l%2... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | 4662c80d6aaca2aa9e8dab32173b74fc | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include<stdio.h>
#include<string.h>
int main()
{
int t,i,a,b;
char string[100];
scanf("%d",&t);
for(i=1;i<=t;i++)
{
scanf("%s",string);
a=strlen(string);
printf("%c",string[0]);
for(b=1;b<a-1;b=b+2)
{
printf("%c",string[b]);
}
pri... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | ca28a905c7ece727a19ff4c6f3867bde | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include<stdio.h>
#include<string.h>
int main()
{
int t,i,a,b;
char string[100];
scanf("%d",&t);
for(i=1;i<=t;i++)
{
scanf("%s",string);
a=strlen(string);
printf("%c",string[0]);
for(b=1;b<a-1;b=b+2)
{
printf("%c",string[b]);
}
pri... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | 81f551abfe4c988d84bc3986d943c028 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include<stdio.h>
#include<string.h>
int main(){
int n;
scanf("%d",&n);
while(n--){
char a[101];
int c;
scanf("%s",&a);
c=strlen(a);
for(int i=0;i<c;){
if(a[i]=... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | da856ee23dd3141aac010c44939a624f | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include <stdio.h>
#include <string.h>
int t, i, j, n, k;
char a[101], b[101];
int main()
{
scanf("%d", &t);
for(i=0; i<t; i++)
{
scanf("%s", &b);
n=strlen(b);
if(n==2) printf("%s\n", b);
else
{
a[0]=b[0]; k=1;
for(j=1; j<n-2; j=j+2)
{
a[k]=b[j];
k++;
}
a[k]=b[n-1];
for(j=0; j<=... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | 37be7b3b35427fa20ca8b634056072fe | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include<stdio.h>
#include<string.h>
int main(){
char a[100];
int i,t,l;
scanf("%d",&t);
while(t!=0){
scanf("%s",a);
l=strlen(a);
for(i=0;i<l;i++){
if(i%2==1||i==0){
printf("%c",a[i]);
}
}
printf("\n");
t--;
}
}
| |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | 450002142b6bb0d13f88c225db16a503 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct arry
{
char *ch;
};
char *original(char *arr,int l)
{
int i,k=0;
char *c=(char *)malloc(100*sizeof(char));
for(i=0;arr[i]!='\0';i+=2)
{
c[k++]=arr[i];
}
c[k++]=arr[l-1];
c[k++]='\0';
return c;
free(c);
}
int main()
{
int t;
scan... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | eabbbcb73adba64bf0348eedccd81276 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include<stdio.h>
int main()
{
int n;
scanf("%d",&n);
while(n--)
{
int l;
char s[100];
scanf("%s",s);
l=strlen(s);
printf("%c",s[0]);
for(int i=0;i<l-1;i++)
{
i=i+1;
printf("%c",s[i]);
}
printf("\n");
}... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | ac6d9eb734fa2b412f7b14142da9bea6 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include<stdio.h>
#include<string.h>
main()
{
int i,l,n,j;
scanf("%d",&n);
char s[100],t[100];
for(i=0;i<n;i++){
scanf("%s",&s);
l = strlen(s);
for(j=0;j<l-2;j++){
if(j%2==0){
printf("%c",s[j]);
}
... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | 74470386fc9f111db5926502f2a6a561 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include<stdio.h>
#include<string.h>
main()
{
int i,l,n,j;
scanf("%d",&n);
getchar();
char s[100],t[100];
for(i=0;i<n;i++){
scanf("%s",&s);
getchar();
l = strlen(s);
for(j=0;j<l-2;j++){
if(j%2==0){
printf("%c",s[j])... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | e34bf192e962c2df8d873d3146381970 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include<stdio.h>
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
char ch[100],i,flag=0,j;
scanf("%s",ch);
for(i=0;ch[i]!='\0';i++)
{
flag++;
}
if(flag<=2)
{
printf("%s\n",ch);
}
el... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | 0e7c1349c45410b0c348c137dad69813 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include<stdio.h>
#include<stdio.h>
int main(){
int t;
scanf("%d",&t);
while(t--){
char s[100];
scanf("%s",s);
int i;
printf("%c",s[0]);
printf("%c",s[1]);
if(strlen(s) == 2){
printf("\n");
} else {
for(i = 3; s[i] != '\0';i++){... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | a022d467c5de8a436aaaa98debf6ec2f | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include <stdio.h>
#include <string.h>
int main()
{
int t,i;
char b[100];
scanf("%d",&t);
for(int x=0;x<t;x++)
{
char a[100]={};
int j=1;
scanf("%s",b);
if(strlen(b)==2)
printf("%s",b);
else
{
a[0]=b[0];
for(i=1;i... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | 7e11270777d5cfffc9d0c8499ba2e48c | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include<stdio.h>
#include<string.h>
int main()
{
int i,j,n,l;
char a[105];
while(scanf("%d",&n)!=EOF){
for(i=1;i<=n;i++){
scanf("%s",&a);
j=strlen(a);
for(l=0;l<j;l++){
if(l%2==0||l==j-1){printf("%c",a[l]);}
}printf("\n");
}
}
return 0;
} | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | 4a26263248185b718b245c303493e93b | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include<stdio.h>
#include<string.h>
int main()
{
int i,j,n,l;
char a[105];
while(scanf("%d",&n)!=EOF){
for(i=1;i<=n;i++){
scanf("%s",&a);
j=strlen(a);
printf("%c%c",a[0],a[1]);
for(l=3;l<j;l=l+2){
printf("%c",a[l]);
}printf("\n");
}
}
return 0;
}
| |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | c04f8c82effbb4e656d967049a47e2e1 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include<stdio.h>
#include<string.h>
int main()
{
char s[1000];
char s1[100];
char b;
int t,l,i,j;
scanf("%d",&t);
while(t--)
{
scanf("%s",&s);
l=strlen(s);
if(l==2)
{
printf("%s\n",s);
}
else{
for(i=0,... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | d3909afdc7e9d7f3991e83ebd853545b | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main(void)
{
int a, i = 0, A;
char m[101], M[101] = { 0 };
scanf("%d", &a);
A = a;
while (a--)
{
i = 0;
while (i++ < 100)
{
M[i] = 0, m[i] = 0;
}
scanf("%s", m);
i = 0;
while(m[2*i]!=0)
{
M[i] = m[2 * i];
i++;
}
M[i] = m[2 * i -... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | 2fc472cf7092c94803ac397d3bccd74a | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include<stdio.h>
#include<string.h>
int main(){
int t;
scanf("%d",&t);
while(t--){
char stringInput[100],stringOutput[100];
scanf("%s",stringInput);
int n = strlen(stringInput);
if(n!=2){
stringOutput[0]=stringInput[0];
int j=1, i;
for(i=1;;i++){
... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | 14b48bbcf978115659a6d4745738d5b3 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | /*
* File: main.c
* Description: Codeforce problemset 1267A - Short Substrings.
* Created on: Aug 15 2020 22:11 +0700
* Author: tbtt
*/
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <string.h>
#define MAX_LEN 100
int
main (void)
{
#ifndef ONLINE_JUDGE
freopen ("input.txt", ... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | ec9bac0c409c6e02d20be83c77c0788c | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include<stdio.h>
int main()
{
char S[101];
int t,count;
scanf("%d",&t);
for(int i=0;i<t;i++)
{
scanf("%s",S);
for(int j=0;S[j]!='\0';j+=2)
{
if(S[j+1]=='\0')
{
printf("%c",S[j]);
break;
}
else i... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | 3784f8b25fc50b9c7a78dfa274539901 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include<stdio.h>
int main()
{
char S[101];
int t,count;
scanf("%d",&t);
for(int i=0;i<t;i++)
{
scanf("%s",S);
for(int j=0;S[j]!='\0';j++)
{
if(S[j+1]=='\0')
{
printf("%c",S[j]);
}
else if((j%2)==0)
... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | afcee7d77f1b2c1268ad9f243e004f46 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include<stdio.h>
int main()
{
char S[101],prev;
int t,count;
scanf("%d",&t);
for(int i=0;i<t;i++)
{
scanf("%s",S);
printf("%c",S[0]);
prev = S[0];
count = 1;
for(int j=1;S[j]!='\0';j++)
{
if(S[j+1]=='\0')
{
pri... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | e07f8207a8f5b2a4e646a3ff60e94f81 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include<stdio.h>
#include<string.h>
int main()
{
int t,j;scanf("%d",&t);
while(t>0)
{
int i,x,n,len;
char str1[100];
scanf("%s",&str1);
len=strlen(str1);char str2[100];
for(i=0; i<=(len-1)/2; i++) {
str2[i]=str1[i*2];}
str2[(len-1)/2+1]=s... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | 6c7937cbfb271bb353060fba7a454553 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include<stdio.h>
#include<string.h>
int main()
{
int t;
scanf("%d",&t);
while(t)
{
char str[100];
int i,n;
scanf("%s",str);
n=strlen(str);
for(i=0;i<n-1;i++)
{
if(i%2==0)
printf("%c",str[i]);
}
printf("%c\n",st... | |
Alice guesses the strings that Bob made for her.At first, Bob came up with the secret string $$$a$$$ consisting of lowercase English letters. The string $$$a$$$ has a length of $$$2$$$ or more characters. Then, from string $$$a$$$ he builds a new string $$$b$$$ and offers Alice the string $$$b$$$ so that she can guess ... | Output $$$t$$$ answers to test cases. Each answer is the secret string $$$a$$$, consisting of lowercase English letters, that Bob came up with. | C | ac77e2e6c86b5528b401debe9f68fc8e | c3442ace980bb1bc984dd71b557456da | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"strings"
] | 1592318100 | ["4\nabbaac\nac\nbccddaaf\nzzzzzzzzzz"] | NoteThe first test case is explained in the statement.In the second test case, Bob came up with the string $$$a$$$="ac", the string $$$a$$$ has a length $$$2$$$, so the string $$$b$$$ is equal to the string $$$a$$$.In the third test case, Bob came up with the string $$$a$$$="bcdaf", substrings of length $$$2$$$ of stri... | PASSED | 800 | standard input | 2 seconds | The first line contains a single positive integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then $$$t$$$ test cases follow. Each test case consists of one line in which the string $$$b$$$ is written, consisting of lowercase English letters ($$$2 \le |b| \le 100$$$) — the string Bob came u... | ["abac\nac\nbcdaf\nzzzzzz"] | #include <stdio.h>
#include <string.h>
int main(void)
{
int n;
char s[100];
scanf("%d", &n);
while(n--)
{
scanf("%s", &s);
for(int i = 0, a = strlen(s); i < a; i++)
{
if(i == 0 || i % 2 == 0 || i == a-1)
printf("%c", s[i]);
}
printf("\n");
}
return 0;
}
| |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | 13510315afa589a9ba004a58e83f5a8d | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include <stdio.h>
int main()
{
int a,i,s[200005],sum=0,sum1=0,count=0;
scanf("%d",&a);
for(i=0;i<a;i++)
{
scanf("%d",&s[i]);
sum=sum+s[i];
}
if(sum%2==1)
{
sum++;
}
for(i=0;i<a;i++)
{
sum1=sum1+s[i];
count++;
if(sum1>=(sum/2))
... | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | 0109ae21806be0b08a1409934e5dd6d3 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include <stdio.h>
int main()
{
long long int num,i,j,sum=0,count=0,sum1=0,s[1000005];
scanf("%lld",&num);
for(i=0;i<num;i++)
{
scanf("%lld",&s[i]);
sum=sum+s[i];
}
for(i=0;i<num;i++)
{
sum1=sum1+s[i];
count++;
if(sum1>=(1.0)*(sum)/2)
{
break;
}
}
printf("%lld",count);
} | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | adad1b6385b954f7214851eb72ad57f0 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include<stdio.h>
int ara[10000000];
int main()
{
int i,a,sum1=0;
double sum=0;
scanf("%d",&a);
for(i=0;i<a;i++){
scanf("%d",&ara[i]);
sum+=ara[i];
}
for(i=0;i<a;i++){
sum1+=ara[i];
if((sum/2)<=sum1){
printf("%d\n",i+1);
return 0;
... | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | 25bb1612ed142efee4a4089b59ecbc26 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include<stdio.h>
int main ()
{
int n,i,x=0,b=0;
int count
;
scanf("%d",&n);
int a[n];
for(i=0; i<n; i++)
{
scanf("%d",&a[i]);
b=b+a[i];
}
for(i=0; i<n; i++)
{
x=x+a[i];
if(b%2==0)
{
if(x>=b/2)
{
... | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | 844fded27743c6c8b67af1a1b767e0b5 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include<stdio.h>
int main()
{
int n,a[200005];
int i,s=0,x=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
s += a[i];
}
if(s%2 != 0)
{
s = s/2 + 1;
}
else
{
s = s/2;
}
for(i=0;i<n;i++)
{
x += a[i];
... | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | 8599351e8516823e6be50239ada0f990 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include<stdio.h>
int main()
{
int long i,n,a[200000]={0},sum=0,sum1=0;
scanf("%ld",&n);
for(i=1;i<=n;i++)
{
scanf("%ld",&a[i]);
sum+=a[i];
}
i=0;
while(sum1<sum/2.0)
{
i++;
sum1+=a[i];
}
printf("%ld",i);
return 0;
} | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | c0341a557253a4e0c0bbc080325c0c6f | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include<stdio.h>
int main()
{
int i,t,arr[200000],count=0;
double sum=0,sum2=0;
scanf("%d",&t);
for(i=0;i<t;i++)
{
scanf("%d",&arr[i]);
sum+=arr[i];
}
int total = ceil(sum/2);
//printf("%d",total);
for(i=0;i<t;i++)
{
sum2+=arr[i];
count++;
... | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | 3faf5cb9f5937a1d475803addcbd6422 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include<stdio.h>
#include<stdlib.h>
int main()
{
long n,i;
long long s1=0,s2=0;
scanf("%ld",&n);
int *a=malloc(n*sizeof(int));
for(i=0;i<n;i++){
scanf("%d",&a[i]);
s1+=a[i];}
for(i=0;i<n;i++)
{
s2+=a[i];
if(s2>=(s1+1)/2)
{
printf("%ld",i+1);
... | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | 2f63a2bd9fe4d6720a7837d04ba8dd83 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include<stdio.h>
int main()
{
int n, i, s = 0, c = 0;
scanf("%d", &n);
int a[2000001];
for (i = 0; i<n; i++)
{
scanf("%d", &a[i]);
s = s + a[i];
}
for (i = 0; i<n; i++)
{
if (c * 2 < s)
{
c = c + a[i];
}
else
{
break;
}
}
printf("%d\n", i);
return 0;
}
| |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | a99d5307c04e45123e269fec8c959ea7 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include <stdio.h>
int pro[200010];
int n;
int sum = 0;
int k = 0;
int i;
int day;
int main() {
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &pro[i]);
sum += pro[i];
}
for (i = 0; i < n; i++) {
k += pro[i];
if (2 * k >= sum) {
day = i + 1;
break;
}
}
printf("%d", day);
return 0;
} | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | 7b6b5469f37748ff1a41e24d6f63f561 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include<stdio.h>
int main()
{
int n,i,sum=0,p,num=0;
scanf("%d",&n);
int a[n];
for(i=0;i<n;i=i+1)
{
scanf("%d",&a[i]);
sum=sum+a[i];
}
if(sum%2==0)
{
p=sum/2;
}
else
{
p=(sum/2)+1;
}
for(i=0;i<n;i=i+1)
{
num=num+a[i];
... | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | 216c3731a306846518b22b967b38a7a6 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include<stdio.h>
int main()
{
int n,i,j,r,c=0,sum=0;
scanf("%d",&n);
int ar[n];
for(i=0;i<n;i++)
{
scanf("%d",&ar[i]);
sum+=ar[i];
}
for(i=0;i<n;i++)
{
c+=ar[i];
if(c>=sum/2 +(sum%2))
{
printf("%d",i+1);
break;
}
... | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | 893db2730d0f030f1c605076be1babd6 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include <stdio.h>
#define N 200000
int main() {
static int aa[N];
int n, i, sum1, sum2;
scanf("%d", &n);
sum1 = 0;
for (i = 0; i < n; i++) {
scanf("%d", &aa[i]);
sum1 += aa[i];
}
sum2 = 0;
for (i = 0; i < n; i++) {
sum2 += aa[i];
... | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | 53e72695bd74579d1890568d4bbe5e9f | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include<stdio.h>
int main()
{
int n,p[2000000],i,r,count=0;
double sum=0, a=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&p[i]);
a=a+p[i];
}
a=a/2;
for(i=0;i<n;i++)
{
if(sum<a)
{
sum=sum+p[i];
count++;
}else break;
}
printf(... | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | 3e71b7af1c794d9ce7e343d46da8cfa5 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include <stdio.h>
int main()
{
int n,a[200000],b,c=0,i,j,sum=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
sum+=a[i];
}
for(i=0;i<n;i++){
c+=a[i];
if(c>=sum/2.00){
break;
}
}
printf("%d",i+1);
}
| |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | 7201c4d1da002113ca962b9f4f3a2c23 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include <stdio.h>
int main(void) {
int n,m[200000],i,j,k=0,l,a=0;
scanf("%d",&n);
if(n==1)
{
printf("1");
}
else
{
for(i=0;i<n;i++)
{
scanf("%d",&m[i]);
k=k+m[i];
}
if((k%2)==0)
{
l=k/2;
}
else
{
l=(k/2)+1;
}
for(j=0;j<n;j++)
{
a=a+m[j];
if(a>=l)
... | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | d150756153f3f64b4e7aef8365e8fc65 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include <stdio.h>
int main(void) {
// your code goes here
long n,sum=0,i,c=0;
scanf("%ld", &n);
long a[n];
for(i=0;i<n;i++)
{
scanf("%ld", &a[i]);
sum+=a[i];
}
for(i=0;i<n;i++)
{
c+=a[i];
if(c>=(sum+1)/2)
break;
}
printf("%ld", i+1);
return 0;
} | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | a3c633eed4b8c338a10ce0a49107e150 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include <stdio.h>
int main(void){
int n;
int lala[200002] = {0};
scanf("%d", &n);
int counter = 0;
for(int i = 0; i < n; i ++){
scanf("%d", &(lala[i]));
counter += lala[i];
}
int temp = 0;
for(int i = 0; i < n; i ++){
temp += lala[i];
if(counter % 2 == 0){
if(temp >= (counter/2)){
printf("%d\n"... | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | c7228e5362c70cc75478d838bcccde37 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include<stdio.h>
int main()
{
long long int i,t,num=0;
double sum=0;
scanf("%lld",&t);
long long int a[t];
for(i=0;i<t;i++)
{
scanf("%lld",&a[i]);
sum=sum+a[i];
}
sum=sum/2;
for(i=0;i<t;i++)
{
num=num+a[i];
if(num>=sum)
break;
}
... | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | fffc0a2f388599d4f05a247f48c1a0b9 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include <stdio.h>
int main() {
int n;
scanf("%d",&n);
int a[n];
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
}
int sum1=a[0],sum2=a[n-1],i=0,j=n-1;
while(i!=j){
if(sum1 >= sum2){
j--;
sum2 += a[j];
}
else{
i++;
... | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | 4c6d90cb6e9e2ebed8a22c16ced16d30 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include <stdio.h>
#include <memory.h>
#define DATA_SIZE 200005
int data[DATA_SIZE];
int main()
{
int n, sum = 0;
memset(data, 0, sizeof(data));
scanf("%d", &n);
for (int i = 0; i < n; ++i)
{
scanf("%d", data + i);
sum += data[i];
}
int half = sum % 2 ? (sum >> 1) + 1 : (sum >> 1);
sum = 0;
for (int i = ... | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | 1f4904d54032f91ef4f60a0cf8604bea | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include<stdio.h>
int main()
{
int n;
scanf("%d",&n);
int a[n], i, sum=0, sum1=0;
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
sum+=a[i];
}
for(i=0;i<n;i++)
{
sum1+=a[i];
if(sum1>=(0.5*sum))
break;
}
printf("%d",i+1);
}
| |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | 0b2d02431d53125c47f6b24deeee84c7 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include<stdio.h>
int main()
{
long long n;
scanf("%lld",&n);
long long ar[n],sum=0,temp=0,p=0;
for(long long i=0;i<n;i++)
{
scanf("%lld",&ar[i]);
sum+=ar[i];
}
if(sum%2!=0)
sum+=1;
for(long long i=0;i<n;i++)
{
temp+=ar[i];
if(temp>=sum/2)
{
p=i;
brea... | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | 354bc68dac739281a222f632332a9a73 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include <stdio.h>
int main(){
long n;
scanf("%ld",&n);
double probsolvedfromday1[n];
for(int i=0;i<n;i++){
double solved;
scanf("%lf",&solved);
if(i>0){
probsolvedfromday1[i]=probsolvedfromday1[i-1]+solved;
}
else{
probsolvedfromday1[i]=solved;
}
}
double totalsolved=probsolvedfromday1[n-1];
... | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | e3bb19be53c42ad5e67d642d5c1ae9d0 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include <stdio.h>
int main()
{
long long int num,i,j,sum=0,count=0,sum1=0,s[1000005];
scanf("%lld",&num);
for(i=0;i<num;i++)
{
scanf("%lld",&s[i]);
sum=sum+s[i];
}
for(i=0;i<num;i++)
{
sum1=sum1+s[i];
count++;
if(sum1>=(1.0)*(sum)/2)
{
break;
}
}
printf("%lld",count);
} | |
Polycarp has created his own training plan to prepare for the programming contests. He will train for $$$n$$$ days, all days are numbered from $$$1$$$ to $$$n$$$, beginning from the first.On the $$$i$$$-th day Polycarp will necessarily solve $$$a_i$$$ problems. One evening Polycarp plans to celebrate the equator. He wi... | Print the index of the day when Polycarp will celebrate the equator. | C | 241157c465fe5dd96acd514010904321 | d0a940dd3c302da239501508fa73732b | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1523370900 | ["4\n1 3 2 1", "6\n2 2 2 2 2 2"] | NoteIn the first example Polycarp will celebrate the equator on the evening of the second day, because up to this day (inclusive) he will solve $$$4$$$ out of $$$7$$$ scheduled problems on four days of the training.In the second example Polycarp will celebrate the equator on the evening of the third day, because up to ... | PASSED | 1,300 | standard input | 2 seconds | The first line contains a single integer $$$n$$$ ($$$1 \le n \le 200\,000$$$) — the number of days to prepare for the programming contests. The second line contains a sequence $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10\,000$$$), where $$$a_i$$$ equals to the number of problems, which Polycarp will solve on the $$$... | ["2", "3"] | #include<stdio.h>
#include<stdlib.h>
void fun(int [],int );
void fun(int a[],int n)
{
int i,sum=0,ans=0;
for(i=0;i<n;i++)
{
sum=sum+a[i];
}
for(i=0;i<n;i++)
{
ans=ans+a[i];
if(sum%2==0)
{
if(ans>=sum/2)
{
printf("%d\n",i+1);... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.