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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | f823fee174d069899b8321c32017f9bc | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include<stdio.h>
void sort(int a[][2],int n)
{int i,j,max,temp;
for(i=0;i<n;i++)
{max=i;
for(j=i+1;j<n;j++)
{
if(a[max][0]<a[j][0])
max=j;
else if(a[max][0]==a[j][0])
{
if(a[max][1]>a[j][1])
max=j;
}
... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | a8f0874a7e04d80bd744b2e1f3a135e3 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include<stdio.h>
int main()
{
int n,k,i,j,c=0,temp,p[50],t[50];
scanf("%d%d",&n,&k);
for(i=0;i<n;i++)
scanf("%d%d",&p[i],&t[i]);
for(i=0;i<n;i++){
for(j=i+1;j<n;j++){
if(p[i]<p[j] || (p[i]==p[j] && t[i]>t[j])){
temp=p[i];
p[i]=p[j];
... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | c8d4c1f51103e72f7728720cda5c7423 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include<stdio.h>
#include<stdlib.h>
struct Team{
int num;
int time;
}team[60];
int cmp1(const void *a,const void *b)
{
struct Team *c=(struct Team*)a;
struct Team *d=(struct Team*)b;
if(c->num!=d->num)
return d->num-c->num;
else
return c->time-d->time;
}
int main()
{
int i,j... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | 22193ff060dfbbddb854bad0e1937512 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include<stdio.h>
int main()
{
int n,k,i,j,minin,temp1,temp2,count=1;
scanf ("%d%d",&n,&k);
int pro[n],time[n];
for (i=0;i<n;i++)
scanf ("%d%d",&pro[i],&time[i]);
for (i=0;i<n-1;i++)
{
minin=i;
for (j=i+1;j<n;j++)
{
if (pro[j]>pro[minin])
minin=j;
else if (pro[j]==pro[minin])
{
... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | 74fe01fad9a243efe0a895aea7fa18e5 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include <stdio.h>
#include <stdlib.h>
void tri(int tab[50][50],int n)
{int i,x,j,y,cont;
i=n-1;
cont=1;
while(cont==1)
{
j=0;
cont=0;
while(j<i)
{
if(tab[j][0]<tab[j+1][0])
{
y=tab[j][0];
tab[j][0]=tab[j+1][0];
tab[j+1][0]=y;
x=tab[j][... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | 5c1e155ee1e7cd277a7cac5a3ff5fcda | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include<stdio.h>
void sort(int p[],int t[],int n)
{
int key1,key2,i,j;
for(i=2;i<=n;i++)
{
key1=p[i],key2=t[i];
for(j=i-1;j>=1 && p[j]<=key1;j--)
{
if(p[j]==key1)
{
if(t[j]<=key2)
break;
p[j+1]=p[j];
t[j+1]=t[j];
}
else
{
p[j+1]=p[j];
t[j+1]=t[j];
}
}//innerfor
p[j+1]=key1;
t[j+1]=key2;
}//outerfor
}//func
i... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | d493c9dec693c90320ef8840ec25664f | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include <stdio.h>
void sort(int d[],int n);
void merge(int d[],int x[],int y[],int l,int r);
int main()
{
int n,k;
scanf("%d %d",&n,&k);
int score[n+1],i,p,t;
for(i=0;i<n;i++)
{
scanf("%d %d",&p,&t);
score[i]= 100*p - t;
}
sort(score,n);
int cnt=0,key=score[k-1];
for(i=0;i<n;i++)
{
if(score[i]==key)
... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | 89cc43b29d7ee3da6dc7a8a3658517ce | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include<stdio.h>
#include<stdlib.h>
struct data
{
int sol;
int pan;
};
typedef struct data data;
void setVal(data *t1, data *t2)
{
t1->sol = t2->sol;
t1->pan = t2->pan;
}
void merge(data dm[], int low, int mid, int high)
{
int i = low;
int j = mid+1;
data temp[high];
int k = 0;
while(i<=mid && j<=high)
{
... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | 6518b21cef9df49a84dabb5ef09b5f24 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include <stdio.h>
int n , k, p[51] , t[51] , i , j ,ket , s, f , a[51] , c ;
int main()
{
scanf("%d %d" , &n, &k) ;
for( i = 0 ; i < n ; i++)
{
scanf("%d %d" , &p[i] , &t[i] ) ;
}
for( j = 0 ; j < n ;j++ )
{
for( i = 1 ;i< n-j ; i++)
{
if( p[i] > p[i... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | 1cf34f67f63d5302f8476d2c9d284447 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | /*
* a_rank_list.c
*
* Copyright 2012 Ygor Amaral <ygor@spider>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later versi... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | 1f06fe61fd7ef48d10847c2e5362bb3c | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | /*
* a_rank_list.c
*
* Copyright 2012 Ygor Amaral <ygor@spider>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later versi... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | d9a0ef01b601c7f51827f6de0b520253 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include<stdio.h>
int main(void)
{
int n,k,i,j,m,y,a=0;
int t[51],p[51];
scanf("%d %d",&n,&k);
for(i=0;i<n;i++)
scanf("%d %d",&p[i],&t[i]);
for(i=1;i<n;++i){
for(j=n-1;j>=i;--j){
if(p[j-1]<p[j]) {
m=p[j-1];
p[j-1]=p[j];
p[j]=m;
... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | cc0b2f11c652bc19e005d0e83193f8a2 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include<stdio.h>
#include<stdlib.h>
long long p[6000];
int cmp (const void * a, const void * b)
{
return ( -*(int*)a + *(int*)b );
}
void main(){
long long n,k,i,a,b;
scanf("%lld %lld",&n,&k);
long long c[n];
for(i=0;i<n;i++){
scanf("%lld %lld",&a,&b);
c[i]=a*100-b;
p[c[i]]++;}
qsort(c,n,sizeof(long long),cmp);... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | c597e59ce0e430128e0decc793fa69c7 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include<stdio.h>
#include<limits.h>
struct friend{
int pr;
int pl;
};
void mergeSort(struct friend *,int,int);
void merge(struct friend *,int,int,int);
int main(){
int i,n,d,j;
scanf("%d%d",&n,&d);
struct friend ar[n],ptr;
for(i=0;i<n;i++){
scanf("%d%d",&ar[i].pr,&ar[i].pl);
}
//mergeSort(ar,0,n-1);
for(i... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | f1ee80a51403d1a5d4346ac75d409106 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include<stdio.h>
#include<stdlib.h>
typedef struct {
int p,t;
}Rank;
int cmp ( const void *x, const void *y ) {
const Rank *a = (const Rank *)x;
const Rank *b = (const Rank *)y;
if( a->p != b->p )
return b->p - a->p;
else
return a->t - b->t;
}
int main()
{
Rank a[51];
int n, k, i, j = 0, c, b;
scanf("%d%d"... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | f27bba8ea210d0fef44a919eb6ce9cdd | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include<stdio.h>
int main(){
int i,j,n,k,a[50][2],m=0,p,t,t1,c=0;
scanf("%d%d",&n,&k);
for(i=0;i<n;i++){
scanf("%d%d",&a[i][0],&a[i][1]);
}
for(i=0;i<n;i++){
for(j=i+1;j<n;j++){
if(a[j][0]>a[i][0] || (a[j][0]==a[i][0] && a[j][1]<a[i][1])){
t=a[i][0]; ... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | eac276e2f393a4ef9d655935403b013d | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include<stdio.h>
#include<string.h>
int a[100],b[100];
int main()
{
int n,m,i,j,count,t;
while(scanf("%d%d",&n,&m)!=EOF)
{
for(i=0; i<n; i++)
{
scanf("%d%d",&a[i],&b[i]);
}
for(i=0; i<n-1; i++)
{
for(j=i+1; j<n; j++)
{
... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | 5b3a31f2cdf210ec659a73fa04acc81c | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include<stdio.h>
struct point
{
int p;
int t;
};
void swap(int i ,int j,struct point a[])
{
int x, y;
x=a[i].p;
a[i].p=a[j].p;
a[j].p=x;
y=a[i].t;
a[i].t=a[j].t;
a[j].t=y;
}
int partition (struct point a[],int low,int high)
{
// pivot (Element to be placed at right position)
int pivoti = high;
... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | 3500eb35a556add62d366080124a6e4c | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | //Rank List
#include<stdio.h>
int main(){
int i , n , c=0 , k , temp , j ;
scanf("%d%d",&n,&k);
int a[n] , b[n];
for(i=0;i<n;i++)
{
scanf("%d%d",&a[i],&b[i]);
}
//printf("\n");
for(i=0;i<n-1;i++)
{
for(j=i+1;j<n;j++)
{
if(a[i]<a[j])
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
temp = b[i];
b[i] = b[j];
b[j] = temp;
}
}
}
... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | fae804a9666684f45dff2bed25ee1cf8 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include <stdio.h>
#include <stdlib.h>
typedef struct cont {
int p, t;
} cont_t;
int s(const void *a, const void *b) {
cont_t *ca = (cont_t*)a, *cb = (cont_t*)b;
if(ca->p != cb->p) {
if(ca->p > cb->p) return -1;
else return 1;
}
if(ca->t < cb->t) return -1;
else if(ca->t == cb->t) return 0;
else return 1... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | 3cd3d49a0c4c01614845a7fdf7eabd13 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include <stdio.h>
int a[10000][2];
int main ()
{
int i,i2,c,d,counter,temp;
counter=0;
scanf ("%d %d",&i,&c);
d=i;
temp=i;
for(;i>0;i--)
{
scanf("%d %d",&a[d-i][0],&a[d-i][1]);
}
for(;d>0;d--)
{
for (i=0;i<d;i++)
{
if (a[i][0]<a[i+1][0]||(a[i][0]==a[i+1][0]&&a[i][1]>a[i+1][1]))
{
a[i][0]+=a[... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | 6090e1aea519238e9d632fd745932b24 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include<stdio.h>
#include<stdlib.h>
struct team
{
int p;
int t;
};
int compare(const void *a,const void *b)
{
if(((struct team *)b)->p == ((struct team *)a)->p)
{
return ((struct team *)a)->t - ((struct team *)b)->t;
}
return ((struct team *)b)->p - ((struct team *)a)->p ;
}
int ... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | 475c6116258c58856b45fde4d20e0bca | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include <stdio.h>
int main()
{
int n,k,i,p,t,j,c;
double m;
double ara[55];
int a[55];
scanf("%d%d",&n,&k);
for(i=0;i<n;i++) {
scanf("%d %d",&p,&t);
m=p-t/100.0;
ara[i]=m;
}
for(i=0;i<n-1;i++) {
for(j=i+1;j<n;j++) {
if(ara[i]<ara[j]) ... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | 0f17583a7477542779ff71927565b3b0 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include<stdio.h>
#define sz 200
int p[sz],t[sz];
int main()
{
int i,j,k,l,n,tp,tt,count,sp,st,tp2,tt2;
while(scanf("%d %d",&n,&k)!=EOF)
{
count=0;
for(i=1;i<=n;i++)
{
scanf("%d %d",&p[i],&t[i]);
}
for(i=1;i<n;i++)
{
for(j=i+1;j<=n;j++)... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | 05fad448607317974b9a7690e591beb3 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #pragma warning(disable:4996)
#pragma comment(linker, "/STACK:16777216")
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define PI 3.1415926535897932384
#ifndef ONLINE_JUDGE
FILE *stream;
#endif
typedef struct{
int p;
int t;
} teamResult;
int CmpTeamResult(const void *team1, const void *team2){
int ... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | 62f23625e0ed7ad5bf9a664527bb6c8f | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | # include <stdio.h>
# include <conio.h>
int main()
{
int n,k,i,j,d,a,b,c,x,y,count,swap,swap1,swap2,swap3;
scanf("%d%d", &n, &k);
int p[n], t[n];
for(i = 0; i < n; i++){
scanf("%d", &p[i]);
scanf("%d", &t[i]);
}
for(j = 0; j < n; j++){
for(d = 0; d ... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | c698944f3a8207980df92dce3c15e710 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include<stdio.h>
int main()
{
int n,k,i,j,m,l,c=1,t,t1;
scanf("%d %d",&n,&k);
int a[n],b[n];
for(i=0;i<n;i++)
scanf("%d %d",&a[i],&b[i]);
for(i=0;i<n;i++)
{
for(j=i;j<n;j++)
{
if(a[i]<a[j])
{
t=a[j];
a[j]=a[i];
... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | 05fa1f6e8116aeca2e95205f2d2e5104 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include <stdio.h>
#include <conio.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
int main (void){
int n,k,i,x,j,temp,counter=0,s;
scanf("%d %d",&n,&k);
int p[n],t[n];
for(i=0;i<n;i++){
scanf("%d %d",&p[i],&t[i]);
}
for(i=0;i<n;i++){
x=i;
for(j=i+1;j<n;j++){
... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | 71f18255c161bbba6c13c08f8816e1ac | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include<stdio.h>
#define N 50
int main() {
//Your task is to count what number of teams from the given list shared the k-th place.
//(1 ≤ k ≤ n ≤ 50).
int n,k;
scanf("%d%d",&n,&k);
//Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of ... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | 00a5345fd6de04113da54b3d34ed490c | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include<stdio.h>
struct contest
{
int p,t;
} team[60];
main()
{
int n,k,i,j,x,y,temp1,temp2,key,time,count;
scanf("%d %d",&n,&k);
for(i=0; i<n; i++)
{
scanf("%d %d",&team[i].p,&team[i].t);
}
for(i=0; i<n; i++) //sorting out only team solves
{
for(j=0; j<n-1; j++)
... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | 10e75178aeb895c5a80e41efdbfbc935 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include<stdio.h>
struct contest
{
int p,t;
} team[60];
main()
{
int n,k,i,j,x,y,temp1,temp2,key,time,count;
scanf("%d %d",&n,&k);
for(i=0; i<n; i++)
{
scanf("%d %d",&team[i].p,&team[i].t);
}
for(i=0; i<n; i++) //sorting out only team solves
{
for(j=0; j<n-1; j++)
... | |
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.You know the rules of comparing the results of two given ... | In the only line print the sought number of teams that got the k-th place in the final results' table. | C | 63e03361531999db408dc0d02de93579 | df314e18af8bc2097f4d870aa5be8fc2 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"sortings",
"binary search",
"implementation"
] | 1332516600 | ["7 2\n4 10\n4 10\n4 10\n3 20\n2 1\n2 1\n1 10", "5 4\n3 1\n3 1\n5 3\n3 1\n3 1"] | NoteThe final results' table for the first sample is: 1-3 places — 4 solved problems, the penalty time equals 10 4 place — 3 solved problems, the penalty time equals 20 5-6 places — 2 solved problems, the penalty time equals 1 7 place — 1 solved problem, the penalty time equals 10 The table shows that the second p... | PASSED | 1,100 | standard input | 2 seconds | The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces... | ["3", "4"] | #include<stdio.h>
#include<limits.h>
int main()
{
int n,k,i,maxh=0,j,s=0;
scanf("%d %d",&n,&k);
int dizi[n][2];
int sorted[n][2];
for (i=0;i<n;i++)
scanf(" %d %d",&dizi[i][0],&dizi[i][1]);
for (j=0;j<n;j++)
{
for (i=0;i<n;i++)
{
if (dizi[i][0]>dizi[maxh][0])
maxh=i;
else if (dizi[i][0]==dizi[maxh... | |
You have a string s = s1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1 ≤ i ≤ j ≤ |s|) of string s is string sisi + 1...sj. The prefix of string s of length l (1 ≤ l ≤ |s|) is string s[1..l]. The suffix of string s of length l (1 ... | In the first line, print integer k (0 ≤ k ≤ |s|) — the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | C | 3fb70a77e4de4851ed93f988140df221 | b9a3f7e4859967f89ecf1d2897096def | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 1400167800 | ["ABACABA", "AAA"] | null | PASSED | 2,000 | standard input | 1 second | The single line contains a sequence of characters s1s2...s|s| (1 ≤ |s| ≤ 105) — string s. The string only consists of uppercase English letters. | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | #include<stdio.h>
#include<string.h>
#include<math.h>
#define MAXN 100005
int next[MAXN],exkmp[MAXN];
char str[MAXN];
int sum[MAXN];
int m;
int a[MAXN],b[MAXN];
int min(int x,int y) { return x<y?x:y; }
int main(){
scanf("%s",str);
int n=strlen(str),i,k;
for (i=1,k=0; i<n; ++i){
int p=0;
if (k+next[k]-1>=i) p=m... | |
You have a string s = s1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1 ≤ i ≤ j ≤ |s|) of string s is string sisi + 1...sj. The prefix of string s of length l (1 ≤ l ≤ |s|) is string s[1..l]. The suffix of string s of length l (1 ... | In the first line, print integer k (0 ≤ k ≤ |s|) — the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | C | 3fb70a77e4de4851ed93f988140df221 | b4719d5807e71c70a69d7ee90a17117f | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 1400167800 | ["ABACABA", "AAA"] | null | PASSED | 2,000 | standard input | 1 second | The single line contains a sequence of characters s1s2...s|s| (1 ≤ |s| ≤ 105) — string s. The string only consists of uppercase English letters. | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | /*
* 432D: Prefixes and Suffixes
* TOPIC: suffix automata
* status:
*/
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define L(k) ((k) & ((~(k))+1ULL))
#define BIT(k) (1ULL<<(k))
#define MASK(k) (BIT(k)-1ULL)
#define TST(u,k) ((u)&BIT(k))
#define SET(u,k) ((u)|=BIT(k))
#define A 26
... | |
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b... | Print a single integer — the maximum number of fruit that Valera can collect. | C | 848ead2b878f9fd8547e1d442e2f85ff | bb3179ade15744d59c0ae9c92ad43ea4 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy"
] | 1402241400 | ["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"] | NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp... | PASSED | 1,400 | standard input | 1 second | The first line contains two space-separated integers n and v (1 ≤ n, v ≤ 3000) — the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ 30... | ["8", "60"] | # include <stdio.h>
int main()
{
int n,m,a,b,x[3003]={0},i,sum=0,s;
scanf("%d%d",&n,&m);
for(i=0;i<n;i++)
{
scanf("%d%d",&a,&b);
x[a]+=b;
}
s=m;
for(i=0;i<3002;i++)
{
if(x[i]<=s){ sum+=x[i]; s=m; continue; }
sum+=s;
if(x[i]-s<=m){sum=sum+x[i]-s; s=m-x[i]+s; continue ;}
sum+=m; s=0;
}
printf("%d",sum);
return 0;
}
| |
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b... | Print a single integer — the maximum number of fruit that Valera can collect. | C | 848ead2b878f9fd8547e1d442e2f85ff | 51833ccf52bf3e4cddb57ad4d62d7d49 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy"
] | 1402241400 | ["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"] | NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp... | PASSED | 1,400 | standard input | 1 second | The first line contains two space-separated integers n and v (1 ≤ n, v ≤ 3000) — the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ 30... | ["8", "60"] | #include<stdio.h>
int main(){
int a[3002],ripe[3002],cur=0,ans=0,day=0,rip=0,n=0,v=0,i=0;
for(i=0;i<3002;i++){
a[i]=0;
ripe[i]=0;
}
scanf("%d %d",&n,&v);
for(i=0;i<n;i++){
scanf("%d",&day);
scanf("%d",&rip);
ripe[day]=ripe[day]+rip;
}
for(i=0;i<3002;i++){
if(cur+ripe[i]<=v){
ans=ans+cur+ripe[i];
... | |
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b... | Print a single integer — the maximum number of fruit that Valera can collect. | C | 848ead2b878f9fd8547e1d442e2f85ff | 59f09a5aa3289d3649acb31b614ea65c | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy"
] | 1402241400 | ["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"] | NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp... | PASSED | 1,400 | standard input | 1 second | The first line contains two space-separated integers n and v (1 ≤ n, v ≤ 3000) — the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ 30... | ["8", "60"] | #include<stdio.h>
struct d{
int x,y;
} p[4000];
int comp(struct d *a,struct d*b){
if((*a).x-(*b).x>=0) return 1;
else return -1;
}
int main() {
int a,b,c,d,e,t,m,n,i,j,k,v,ans=0;
scanf("%d %d",&n,&v);
for(i=0;i<n;++i){
scanf("%d %d",&p[i].x,&p[i].y);
}
qsort(p,n,sizeof(stru... | |
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b... | Print a single integer — the maximum number of fruit that Valera can collect. | C | 848ead2b878f9fd8547e1d442e2f85ff | 30f346c1c20cb20cc87e06ec05f70b0a | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy"
] | 1402241400 | ["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"] | NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp... | PASSED | 1,400 | standard input | 1 second | The first line contains two space-separated integers n and v (1 ≤ n, v ≤ 3000) — the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ 30... | ["8", "60"] | /* بِسْمِ اللهِ الرَّحْمٰنِ الرَّحِيْمِ */
/* رَّبِّ زِدْنِى عِلْمًا */
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main()
{
int n,v,pre,rotting,a[4005],b[4005],i,j,bag,collect,day,v2;
while(scanf("%d%d",&n,&v)!=EOF)
{
day=0;
bag=0;
for(i=0... | |
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b... | Print a single integer — the maximum number of fruit that Valera can collect. | C | 848ead2b878f9fd8547e1d442e2f85ff | 6ae1c6d0e36261a3cbf7e51a38adc6d1 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy"
] | 1402241400 | ["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"] | NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp... | PASSED | 1,400 | standard input | 1 second | The first line contains two space-separated integers n and v (1 ≤ n, v ≤ 3000) — the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ 30... | ["8", "60"] | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define MAX(x,y) (x)>(y) ? (x):(y)
#define MIN(x,y) (x)>(y) ? (y):(x)
#define scnn fscanf(stdin,"%i",&n)
#define scnnd fscanf(stdin,"%i %i",&n,&d)
#define scnmi fscanf(stdin,"%i",&m[i])
#define forn for(i=0;i<n;i++)
#define... | |
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b... | Print a single integer — the maximum number of fruit that Valera can collect. | C | 848ead2b878f9fd8547e1d442e2f85ff | 46b05f4b9186620ad80261a3170ef10e | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy"
] | 1402241400 | ["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"] | NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp... | PASSED | 1,400 | standard input | 1 second | The first line contains two space-separated integers n and v (1 ≤ n, v ≤ 3000) — the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ 30... | ["8", "60"] | #include<stdio.h>
int main(){
int i,a,b,c[3003][2]={0},d,e,ans=0,f;
scanf("%d %d",&a,&b);
while(a--)
{
scanf("%d %d",&d,&e);
c[d][0]+=e;
}
for(i=1;i<3002;i++)
{
if(c[i][1]<=b)
{
ans+=c[i][1];
f=b-c[i][1];
if(c[i][0]<=f)ans+=c[i][0];
else {ans+=f;c[i+1][1]=c[i][0]-f;}
}
else
{ans+=b;c[i... | |
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b... | Print a single integer — the maximum number of fruit that Valera can collect. | C | 848ead2b878f9fd8547e1d442e2f85ff | 8cb3c3c643a67f985a2b77e28451fe92 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy"
] | 1402241400 | ["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"] | NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp... | PASSED | 1,400 | standard input | 1 second | The first line contains two space-separated integers n and v (1 ≤ n, v ≤ 3000) — the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ 30... | ["8", "60"] | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main(int argc, char const *argv[])
{
int n,v,i,j=0,sum=0;
int temp;
scanf("%d %d",&n,&v);
int count=0,p_count=0;
int temp1,temp2;
int a[3001]={0};
for(i=0;i<n;i=i+1){
scanf("%d %d",&temp1,&temp2);
a[temp1]+=temp2;
}
for(i=1;i<... | |
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b... | Print a single integer — the maximum number of fruit that Valera can collect. | C | 848ead2b878f9fd8547e1d442e2f85ff | 1b62e0fb0b52653ad84bb8ab87e0db96 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy"
] | 1402241400 | ["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"] | NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp... | PASSED | 1,400 | standard input | 1 second | The first line contains two space-separated integers n and v (1 ≤ n, v ≤ 3000) — the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ 30... | ["8", "60"] | # include <stdio.h>
int main()
{
int n,m,a,b,x[3003]={0},i,sum=0,s;
scanf("%d%d",&n,&m);
for(i=0;i<n;i++)
{
scanf("%d%d",&a,&b);
x[a]+=b;
}
s=m;
for(i=0;i<3002;i++)
{
if(x[i]<=s){ sum+=x[i]; s=m; continue; }
sum+=s;
if(x[i]-s<=m){sum=sum+x[i]-s; s=m-x[i]+s; continue ;}
sum+=m; s=0;
}
printf("%d",sum);
return 0;
} | |
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b... | Print a single integer — the maximum number of fruit that Valera can collect. | C | 848ead2b878f9fd8547e1d442e2f85ff | f60a7f25da85cbc9b23b6b7fbd0e82cb | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy"
] | 1402241400 | ["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"] | NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp... | PASSED | 1,400 | standard input | 1 second | The first line contains two space-separated integers n and v (1 ≤ n, v ≤ 3000) — the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ 30... | ["8", "60"] |
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#define sc scanf
#define pr printf
#define dnum 3010
#define Min(a,b) a>b?b:a
#define Max(a,b) a>b?a:b
int n,m,i,j,k,sum,d,t[dnum],tmp1,tmp2,max,min,ans,x,v,a[dnum];
char str[dnum];
int main()
{
// freopen... | |
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b... | Print a single integer — the maximum number of fruit that Valera can collect. | C | 848ead2b878f9fd8547e1d442e2f85ff | b09f9ccabf98d9ae851054f9104e4e24 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy"
] | 1402241400 | ["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"] | NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp... | PASSED | 1,400 | standard input | 1 second | The first line contains two space-separated integers n and v (1 ≤ n, v ≤ 3000) — the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ 30... | ["8", "60"] | #include<stdio.h>
long left[3001]={0},a[3001],b[3001],s[3001];
int main()
{
long ans=0,n,m,i,max=0;
scanf("%ld%ld",&n,&m);
for(i=1;i<=n;i++)
{
scanf("%ld%ld",&a[i],&b[i]);
if(a[i]>max)max=a[i];
s[a[i]]+=b[i];
}
for(i=1;i<=max+1;i++)
{
if(le... | |
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b... | Print a single integer — the maximum number of fruit that Valera can collect. | C | 848ead2b878f9fd8547e1d442e2f85ff | 064cf3ce63e647d41b1ac3644a2cf2a2 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy"
] | 1402241400 | ["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"] | NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp... | PASSED | 1,400 | standard input | 1 second | The first line contains two space-separated integers n and v (1 ≤ n, v ≤ 3000) — the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ 30... | ["8", "60"] | #include<stdio.h>
int main()
{
int n,v,i,sum=0,max=0;
scanf("%d%d",&n,&v);
int a[4000],b[4000],s[4000]={0};
for(i=1;i<=n;i++)
{
scanf("%d",&a[i]);
scanf("%d",&b[i]);
s[a[i]]=s[a[i]]+b[i];
if(a[i]>max)max=a[i];
}
int c,d;
if(s[1]<v)
{
c=0;
... | |
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b... | Print a single integer — the maximum number of fruit that Valera can collect. | C | 848ead2b878f9fd8547e1d442e2f85ff | c1dd0fc272d0071ff7b41d3aa13dc0f9 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy"
] | 1402241400 | ["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"] | NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp... | PASSED | 1,400 | standard input | 1 second | The first line contains two space-separated integers n and v (1 ≤ n, v ≤ 3000) — the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ 30... | ["8", "60"] | #include<stdio.h>
#include<stdlib.h>
long long int num_trees,j,i;
int num_fruits[10000000]={0};
int main()
{
int var,max_collect,ans,remaining_fruits,num_days=0;
scanf("%lld%d", &num_trees, &max_collect);
for(i=0;i<(num_trees+5);i++)
{
num_fruits[i]=0;
}
int max=0;
for(i=0;i<num_tree... | |
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b... | Print a single integer — the maximum number of fruit that Valera can collect. | C | 848ead2b878f9fd8547e1d442e2f85ff | 5abf3a3e026895178dd22cfa095db438 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy"
] | 1402241400 | ["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"] | NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp... | PASSED | 1,400 | standard input | 1 second | The first line contains two space-separated integers n and v (1 ≤ n, v ≤ 3000) — the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ 30... | ["8", "60"] | #include<stdio.h>
int min(int x,int y){
if(x>y)
return y;
else
return x;
}
int main(){
int tmp,ans=0,i,j,k,l,n,m,today,last,x,y;
int a[3005]={0};
scanf("%d%d",&n,&k);
for(i=0;i<n;i++){
scanf("%d%d",&x,&y);
a[x] += y;
}
last = 0;
for(i=1;i<=3001;i++){
tmp = k;
if(last >= tmp){
ans += tmp;
last... | |
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b... | Print a single integer — the maximum number of fruit that Valera can collect. | C | 848ead2b878f9fd8547e1d442e2f85ff | 8ed47617b2d1c11ed4e53449fb3045cf | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy"
] | 1402241400 | ["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"] | NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp... | PASSED | 1,400 | standard input | 1 second | The first line contains two space-separated integers n and v (1 ≤ n, v ≤ 3000) — the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ 30... | ["8", "60"] | #include <stdio.h>
int tree[3005];
int main()
{
int n,v,max=0,ans=0,i,a,b;
scanf("%d%d",&n,&v);
while(n--)
{
scanf("%d%d",&a,&b);
tree[a]+=b;
if(a>max)
max=a;
}
for(i=1;i<=max+1;i++)
{
if(tree[i]<=v)
{
if(tree[i-1]<=v-tree[i])
... | |
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b... | Print a single integer — the maximum number of fruit that Valera can collect. | C | 848ead2b878f9fd8547e1d442e2f85ff | a1755d624b972a7727ebd76739955352 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy"
] | 1402241400 | ["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"] | NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp... | PASSED | 1,400 | standard input | 1 second | The first line contains two space-separated integers n and v (1 ≤ n, v ≤ 3000) — the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ 30... | ["8", "60"] | #include<stdio.h>
#include<string.h>
int main()
{
long int qian[4000];
long int hou[4000];
int n,v;
long int num;
int i;
int a,b,m;
while(scanf("%d %d",&n,&v)!=EOF)
{
m=0;
memset(qian,0,sizeof(qian));
memset(hou,0,sizeof(hou));
for(i=1;i<=n;i++)
{... | |
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b... | Print a single integer — the maximum number of fruit that Valera can collect. | C | 848ead2b878f9fd8547e1d442e2f85ff | 331bafb575ba8d6822986ca24641dc9a | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy"
] | 1402241400 | ["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"] | NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp... | PASSED | 1,400 | standard input | 1 second | The first line contains two space-separated integers n and v (1 ≤ n, v ≤ 3000) — the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ 30... | ["8", "60"] | #include<stdio.h>
int main()
{
int i,j,tree,v,now;
scanf("%d %d",&tree,&v);
int day,f,a[3002]={0};
for(i=0;i<tree;i++)
{
scanf("%d %d",&day,&f);
a[day]+=f;
}
int prev=0;
__int64 tot=0;
for(j=1;j<=3001;j++)
{
now=a[j];
if(now+prev<=v)
{
... | |
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b... | Print a single integer — the maximum number of fruit that Valera can collect. | C | 848ead2b878f9fd8547e1d442e2f85ff | 6b29994eea0a62132026aa20f8ba3a09 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy"
] | 1402241400 | ["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"] | NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp... | PASSED | 1,400 | standard input | 1 second | The first line contains two space-separated integers n and v (1 ≤ n, v ≤ 3000) — the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ 30... | ["8", "60"] | // c99.c by Bill Weinman <http://bw.org/>
#include <stdio.h>
int min(int a,int b)
{
if(a>b)return b;
else return a;
}
int main()
{
int i,n,v,x,n1;
scanf("%d%d",&n,&v);
int d[3005];
for(i=0;i<3005;i++)
{
d[i]=0;
}
for(i=0;i<n;i++)
{
scanf("%d%d",&x,&n1);
d[x]=d[x]+n1;
}
int sum,v1,z;
sum=0;
for(i=1... | |
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b... | Print a single integer — the maximum number of fruit that Valera can collect. | C | 848ead2b878f9fd8547e1d442e2f85ff | 4b6af1b10496566991d39f8d07bf4fe3 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy"
] | 1402241400 | ["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"] | NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp... | PASSED | 1,400 | standard input | 1 second | The first line contains two space-separated integers n and v (1 ≤ n, v ≤ 3000) — the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ 30... | ["8", "60"] | #include<stdio.h>
#include<stdlib.h>
#define MAX 3005
int main() {
int n,v;
long int a[MAX],b[MAX],tv;
int day,num;
long int j,i,temp;
long long int col,cur;
long int max,rem;
scanf("%d %d",&n,&v);
for(i=0;i<MAX;i++) {
b[i]=a[i]=0;
}
max=0;
for(i=0;i<n;i++) {
scanf("%d %d",&day,&num);
b[i]=day;
a[i]=num... | |
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b... | Print a single integer — the maximum number of fruit that Valera can collect. | C | 848ead2b878f9fd8547e1d442e2f85ff | c1cf9fc19c8469579cb8181942ae4a30 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy"
] | 1402241400 | ["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"] | NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp... | PASSED | 1,400 | standard input | 1 second | The first line contains two space-separated integers n and v (1 ≤ n, v ≤ 3000) — the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ 30... | ["8", "60"] | #include<stdio.h>
#include<string.h>
int tree[3010],f[3010][2];
int main()
{
int n,v,i,j,k,res,a,b,temp;
while(scanf("%d%d",&n,&v)!=EOF)
{
res=0;
memset(tree,0,sizeof(tree));
for(i=0;i<n;i++)
{
scanf("%d%d",&a,&b);
if(tree[a]==0)
{
... | |
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b... | Print a single integer — the maximum number of fruit that Valera can collect. | C | 848ead2b878f9fd8547e1d442e2f85ff | 75ee0f8b3b3e587957b870d20f1db69a | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy"
] | 1402241400 | ["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"] | NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp... | PASSED | 1,400 | standard input | 1 second | The first line contains two space-separated integers n and v (1 ≤ n, v ≤ 3000) — the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≤ ai, bi ≤ 30... | ["8", "60"] | #include<stdio.h>
int main(void)
{
int no_trees,max_fruits,i,day,no_fruits[4000],remain,collect,max_day,array[3];
scanf("%d", &no_trees);
scanf("%d", &max_fruits);
max_day=0;
for(i=1;i<=4000;i++)
{
no_fruits[i]=0;
}
for(i=1;i<=no_trees;i++)
{
scanf("%d", &day);
... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | f2ea0b357e0cae2b1abe25ee3586db06 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int n,i,a,b,c,y=2;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d %d",&a,&b);
if(a!=b)
{
printf("rat... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | 50fea4402c7bde1eec7aa90f7d9f8e8d | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include <stdio.h>
int n, i, a, b, a1 = 1e9, k;
int main()
{
scanf("%d", &n);
for(i = 0; i < n; i++){
scanf("%d%d", &a, &b);
if (a != b){
k = 1;
break;
}
if(a > a1)
k = 2;
a1 = a;
}
switch(k){
case 1:
printf("rate... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | 3a7e0c95e438d078d7eddb018ef0a565 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include<stdio.h>
int main()
{
int n,i,j,k=0,c=0;
scanf("%d",&n);
int a[n][2];
for(i=0;i<n;i++)
{
for(j=0;j<2;j++)
{
scanf("%d",&a[i][j]);
}
if(a[i][0]!=a[i][1])
{
k++;
}
}
if(k>0)
{
printf("rated\n");
}... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | d75ca9cab8ff937e122686095654a663 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include <stdio.h>
#include <stdlib.h>
void main(int argc, const char * argv[]) {
int n,i;
scanf("%d",&n);
int before[n],after[n];
for ( i=0;i<n;i++)
{
scanf("%d%d",&before[i],&after[i]);
if (before[i]!=after[i])
{
printf("rated\n");
return;
... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | afab21d0c0d9bc5359bd95059c67bef8 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include <stdio.h>
typedef enum{
false,
true
} bool;
int main(){
int n; scanf("%d",&n);
int matrix[n][2];
int i, j;
bool maybe=1;
bool sure=0;
for(i=0; i<n; i++){
scanf("%d %d",&matrix[i][0], &matrix[i][1]);
if(matrix[i][0]!=matrix[i][1])
sure=1;
if(i>0)
if(matrix[i][0]>matrix[i-1][0] || matrix[i][1... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | 19e007f5bf1118081e8cf21c999cf5ac | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include <stdio.h>
int main(){
int n,i,f=0;
scanf("%d",&n);
int a[n][2];
for (i=0;i<n;i++){
scanf("%d %d",&a[i][0],&a[i][1]);
if (a[i][0]!=a[i][1])
f=1;
}
if (f==1){
printf("rated");
return 0;
}
f=0;
for (i=0;i<n-1;i++){
if (a[i+1][... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | fbba3e647d5b7064b7adab9e36676433 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
int m,n,a[1010],b[1010];
int i,j;
int flag=0;
while(~scanf("%d",&n))
{
flag=0;
for(i=0;i<n;i++)
{
scanf("%d%d",&a[i],&b[i]);
if(a[i]!=b[i])
flag=1;
}
... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | 1602778a941e289ce2b4cd014d14978b | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include<stdio.h>
int main()
{
int i,count=0,j,n;
int a[10000],b[10000];
while(scanf("%d",&n)==1)
{
count=0;
for(i=0;i<n;i++)
{
scanf("%d %d",&a[i],&b[i]);
if(a[i]!=b[i])
count++;
}
if(count>0)
printf("rated\n");... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | bd427b61d4da5453d542a87fb7eb49ad | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include <stdio.h>
int main()
{
int i, n, a, b, c, d, u;
scanf("%d", &n);
scanf("%d %d", &a, &b);
if (a != b) {
printf("rated\n");
return 0;
}
u = 0;
for (i = 0; i < n; i++) {
scanf("%d %d", &c, &d);
if (c != d) {
printf("rated\n");
... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | 320042f43ff20fc7cfe7f3168b8b310d | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
long long beforearr[1000001];
long long afterarr[1000001];
char str[1000001];
int func(const void *a, const void *b)
{
return (*(int*)a-*(int*)b);
}
long long max(long long a, long long b)
{
return (a>b)?a:b;
}
long long min(long long a, long long b)
{
return (... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | cb37d2080c6cf520fe8358ee56bfdc64 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include <stdio.h>
int main()
{
int n,a[1001],b[1001],i;
scanf("%d",&n);
for (i=0;i<n;i++){
scanf("%d%d",&a[i],&b[i]);
}
for (i=0;i<n;i++){
if (a[i]!=b[i])
break;
}
if (i<n){
printf("rated\n");
return 0;
}
for (i=0;i<n;i++){
if (a[i]>a[i-1] && i!=0)
break;
}
if (i=... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | a4dbafa043c10fb66f52f639d4c2a8b6 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include<stdio.h>
int main()
{
int n,i,flag=0,j;
scanf("%d",&n);
long long int a[n];
int b[n];
for(i=0;i<n;i++){
scanf("%lld%d",&a[i],&b[i]);
}
for(i=0;i<n;i++){
if(a[i]!=b[i]){
flag=1;
break;
}
else{
flag=2;
}
}
if(flag==2){
for(i=0;i<n;i++){
for(j=i+1;j<n;j++){
if((a[i]<a[j])||(b... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | cb1fc5236e6ca425760a7d28a18e6eb1 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
int n;
int cmp(const void * a, const void * b)
{
return (*(int *)b - *(int *)a);
}
bool are(int a[], int b[], int c)
{
int i;
for(i = 0; i < n; i++)
{
if(a[i] != b[i])
{
return false;
}
}
return true;
}
int main()
{
int i,a[10000],b[1000... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | f7ef44f71d7060134fc8ab1c8517ad45 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include<stdio.h>
int main(){
int i,n,ok;
scanf("%d",&n);
int c[n],t[n];
for(i=0;i<n;i++){
scanf("%d %d",&c[i],&t[i]);
}
for(i=0;i<n;i++){
if(c[i]!=t[i]){
printf("rated");
return 0;
}
}
for(i=0;i<n-1;i++){
if(c[i]<c[i+1]){
printf("unrated");
return 0;
}
}
printf("maybe");
} | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | c77216f1ce4fb91c3d2b5127a3109c71 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include<stdio.h>
int main(){
int n ,b ,index=0 ,i ,c=0;
scanf("%d" ,&n);
b=2*n;
int rate[b];
for(i=0;i<b;i++){
scanf("%d" ,&rate[i]);
if(i%2==0 && i!=0 && index==0) {
if(rate[i]>rate[i-2]) index=1;
}
else if(i%2!=0){
if(rate[i]==rate[i-1]) c++;
}
}
if(c<n) printf("rated\n");
else {
if(i... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | 762e4ac2f62899d2ba46e52e8f8c5caa | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include<stdio.h>
int main()
{
int t,x,y,x1=0,count=0,i,sum=0,d;
scanf("%d",&t);
for(i=1;i<=t;i++){
scanf("%d%d",&x,&y);
d=x-y;if(d<0) d=-d;
sum=sum+d;
if(x1>=x) count++;
x1=x;
}
if(sum!=0){
printf("rated") ;
}
else{
if(count==t-1)
... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | 7eb1da84a6faecb3f2b46d34d89c4a09 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include<stdio.h>
int main(){
int n,chk,i,x,y,j,Min;
scanf("%d",&n);
int b[n];
for(i=0,chk=1;i<n;i++){
scanf("%d%d",&x,&y);
if(x==y)b[i]=y;
else {chk=0;for(i=i;i<n;i++)scanf("%d",&x);}
}
if(chk==0)printf("rated");
else {
for(i=1,chk=1,Min=b[0];i<n;i++){
if(Min<b[i]){chk=0;break;}
else Min = b[i];
... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | 15bd4527e7abf6b07e4923f2581b8bca | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include<stdio.h>
int main(){
int n,a,b,last=10000,rated=0,unrated=0;
scanf("%d",&n);
while(n--){
scanf("%d%d",&a,&b);
if(a!=b)rated=1;
if(b > last)unrated = 1;
last = b;
}
if(rated)printf("rated\n");
else if(unrated)printf("unrated\n");
else printf("maybe\n");
return 0;
} | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | 1b51cd3b9ba0a98373dc0ca73a6e0622 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include <stdio.h>
int main()
{
int n,i;
int a[1000],b[1000];
scanf("%d",&n);
for(i = 0; i < n; i++)
{
scanf("%d%d",&a[i],&b[i]);
if (a[i] != b[i])
{
printf("rated\n");
return 0;
}
}
for(i = 1; i < n; i++)
{
if (a[i-1] < a[i])
{
printf("unrated\n");
return 0;
}
}
printf("maybe\n");
... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | 8f063dd6aa35b8aa855cdc68a9761aab | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include<stdio.h>
int main()
{
int n, a[1000], b[1000], p, c,i;
scanf("%d", &n);
for(i = 0; i < n; i++){
scanf("%d%d", &a[i], &b[i]);
}
for(i = 0; i < n; i++){
if(a[i] == b[i]){
p = 0;
}
else{
p = 1;
break;
}
}
if(p == 1){
printf("rated");
}
else{
for(i = 0; i < n-1; i++){
if(a[i] >= ... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | 2cbaf7e6a2ecb58a62b46a4ab079b8b5 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] |
#include<stdio.h>
int main()
{
int i,j,k,n,a[4126],b[4126],sum=0,sum2=0;
double c=1,x;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d %d",&a[i],&b[i]);
}
for(i=0;i<n;i++){
x= a[i]/b[i];
if(a[i]>b[i] || a[i] < b[i]){
sum=n;
break;
}
}
if (sum==n){
printf("rated");
}
else if(sum!=n){
for... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | 3459424ce8ef726a02fc50ec46f9d230 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include <stdio.h>
int main(int argc, char const *argv[])
{
int i,n;
int a,b;
int equal,increase;
int prea;
while(~scanf("%d",&n))
{
a = 0;
prea = 4200;
equal = 0;
increase = 1;
for(i = 1; i <= n; i++)
{
scanf("%d %d",&a,&b);
if(... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | 6f665f48dd53122216fce1d018dae197 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | //http://codeforces.com/contest/807/problem/0
#include<stdio.h>
int main()
{
int i,n,check; scanf("%d",&n);
int a[n],b[n];
check=0;
for(i=0;i<n;i++)
{
scanf("%d %d",&a[i],&b[i]);
if(a[i]!=b[i])
{
check=1;
break;
}
}
if(check==1)
... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | 2a6957c75166345ddf26361fa0620630 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include<stdio.h>
int main(void)
{
int i,n,trap=0,trap2=0,a[1005],b[1005];
scanf("%d",&n);
for(i=0;i<n;i++) {
scanf("%d %d",&a[i],&b[i]);
if(a[i]!=b[i]) {
trap=1;
}
if(!trap) {
if((i>0) && (a[i-1]<a[i])) {
trap2=1;
}
}
}
if(trap) {
printf("rated");
}
else {
if(trap2) {
printf("unra... | |
Is it rated?Here it is. The Ultimate Question of Competitive Programming, Codeforces, and Everything. And you are here to answer it.Another Codeforces round has been conducted. No two participants have the same number of points. For each participant, from the top to the bottom of the standings, their rating before and ... | If the round is rated for sure, print "rated". If the round is unrated for sure, print "unrated". If it's impossible to determine whether the round is rated or not, print "maybe". | C | 88686e870bd3bfbf45a9b6b19e5ec68a | 6ba0962f4ce94b7cb382aa2be80c8d44 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"sortings"
] | 1494171900 | ["6\n3060 3060\n2194 2194\n2876 2903\n2624 2624\n3007 2991\n2884 2884", "4\n1500 1500\n1300 1300\n1200 1200\n1400 1400", "5\n3123 3123\n2777 2777\n2246 2246\n2246 2246\n1699 1699"] | NoteIn the first example, the ratings of the participants in the third and fifth places have changed, therefore, the round was rated.In the second example, no one's rating has changed, but the participant in the second place has lower rating than the participant in the fourth place. Therefore, if the round was rated, s... | PASSED | 900 | standard input | 2 seconds | The first line contains a single integer n (2 ≤ n ≤ 1000) — the number of round participants. Each of the next n lines contains two integers ai and bi (1 ≤ ai, bi ≤ 4126) — the rating of the i-th participant before and after the round, respectively. The participants are listed in order from the top to the bottom of the... | ["rated", "unrated", "maybe"] | #include <stdio.h>
int main(){
int n,i,num11,num12,num21,num22,flag=0;
scanf("%d",&n);
for(i=0;i<n;i++){
if(i != 0){
num11=num21;
num12=num22;
}
scanf("%d %d",&num21,&num22);
if (i!=0){
if(num21 > num11){
flag=1;
}
}
if(num21 != num22) {
printf("rated\n");
return 0;
}
}
i... | |
You have n devices that you want to use simultaneously.The i-th device uses ai units of power per second. This usage is continuous. That is, in λ seconds, the device will use λ·ai units of power. The i-th device currently has bi units of power stored. All devices can store an arbitrary amount of power.You have a single... | If you can use the devices indefinitely, print -1. Otherwise, print the maximum amount of time before any one device hits 0 power. Your answer will be considered correct if its absolute or relative error does not exceed 10 - 4. Namely, let's assume that your answer is a and the answer of the jury is b. The checker prog... | C | 1c2fc9449989d14d9eb02a390f36b7a6 | 6c32a042118cda9ea57ff05aff93c1e3 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"math"
] | 1492356900 | ["2 1\n2 2\n2 1000", "1 100\n1 1", "3 5\n4 3\n5 2\n6 1"] | NoteIn sample test 1, you can charge the first device for the entire time until it hits zero power. The second device has enough power to last this time without being charged.In sample test 2, you can use the device indefinitely.In sample test 3, we can charge the third device for 2 / 5 of a second, then switch to char... | PASSED | 1,800 | standard input | 2 seconds | The first line contains two integers, n and p (1 ≤ n ≤ 100 000, 1 ≤ p ≤ 109) — the number of devices and the power of the charger. This is followed by n lines which contain two integers each. Line i contains the integers ai and bi (1 ≤ ai, bi ≤ 100 000) — the power of the device and the amount of power stored in the de... | ["2.0000000000", "-1", "0.5000000000"] | #include <stdio.h>
#include <float.h>
#include <stdbool.h>
#include <assert.h>
#define MAXN 100000
#define MAX(x, y) ((x) > (y)? (x): (y))
int main()
{
int n, p, a[MAXN], b[MAXN];
long long int total_consumption = 0;
scanf("%d%d", &n, &p);
for (int i = 0; i < n; i++) {
scanf("%d%d", &a[i], &b[... | |
You have n devices that you want to use simultaneously.The i-th device uses ai units of power per second. This usage is continuous. That is, in λ seconds, the device will use λ·ai units of power. The i-th device currently has bi units of power stored. All devices can store an arbitrary amount of power.You have a single... | If you can use the devices indefinitely, print -1. Otherwise, print the maximum amount of time before any one device hits 0 power. Your answer will be considered correct if its absolute or relative error does not exceed 10 - 4. Namely, let's assume that your answer is a and the answer of the jury is b. The checker prog... | C | 1c2fc9449989d14d9eb02a390f36b7a6 | c81117258b12445d5a46a0ccd78e6ed4 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"math"
] | 1492356900 | ["2 1\n2 2\n2 1000", "1 100\n1 1", "3 5\n4 3\n5 2\n6 1"] | NoteIn sample test 1, you can charge the first device for the entire time until it hits zero power. The second device has enough power to last this time without being charged.In sample test 2, you can use the device indefinitely.In sample test 3, we can charge the third device for 2 / 5 of a second, then switch to char... | PASSED | 1,800 | standard input | 2 seconds | The first line contains two integers, n and p (1 ≤ n ≤ 100 000, 1 ≤ p ≤ 109) — the number of devices and the power of the charger. This is followed by n lines which contain two integers each. Line i contains the integers ai and bi (1 ≤ ai, bi ≤ 100 000) — the power of the device and the amount of power stored in the de... | ["2.0000000000", "-1", "0.5000000000"] | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
long long a[100005];
long long b[100005];
long long n, p;
long double max(long double a, long double b) {
return a > b ? a : b;
}
int main(void) {
while(scanf("%I64d%I64d", &n, &p) != -1) {
memset(a, 0, sizeof(a));
memset(b, 0, sizeof(b));;
l... | |
Mishka got an integer array $$$a$$$ of length $$$n$$$ as a birthday present (what a surprise!).Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjacent Replacements Algorithm". This algorithm can be represented as a sequence of steps: Replace each o... | Print $$$n$$$ integers — $$$b_1, b_2, \dots, b_n$$$, where $$$b_i$$$ is the final value of the $$$i$$$-th element of the array after applying "Mishka's Adjacent Replacements Algorithm" to the array $$$a$$$. Note that you cannot change the order of elements in the array. | C | d00696cb27c679dda6e2e29314a8432b | f5787d963f56d0063f71909f0ca41b79 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1531751700 | ["5\n1 2 4 5 10", "10\n10000 10 50605065 1 5 89 5 999999999 60506056 1000000000"] | NoteThe first example is described in the problem statement. | PASSED | 800 | standard input | 1 second | The first line of the input contains one integer number $$$n$$$ ($$$1 \le n \le 1000$$$) — the number of elements in Mishka's birthday present (surprisingly, an array). The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the elements of the array. | ["1 1 3 5 9", "9999 9 50605065 1 5 89 5 999999999 60506055 999999999"] | #include<stdio.h>
int main()
{
int i,n,ara[1000];
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&ara[i]);
for(i=0;i<n;i++)
{
if(ara[i]&1)
printf("%d ",ara[i]);
else
printf("%d ",ara[i]-1);
}
return 0;
} | |
Mishka got an integer array $$$a$$$ of length $$$n$$$ as a birthday present (what a surprise!).Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjacent Replacements Algorithm". This algorithm can be represented as a sequence of steps: Replace each o... | Print $$$n$$$ integers — $$$b_1, b_2, \dots, b_n$$$, where $$$b_i$$$ is the final value of the $$$i$$$-th element of the array after applying "Mishka's Adjacent Replacements Algorithm" to the array $$$a$$$. Note that you cannot change the order of elements in the array. | C | d00696cb27c679dda6e2e29314a8432b | 1b9e015973145f1d6b9b47a09a40fb50 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1531751700 | ["5\n1 2 4 5 10", "10\n10000 10 50605065 1 5 89 5 999999999 60506056 1000000000"] | NoteThe first example is described in the problem statement. | PASSED | 800 | standard input | 1 second | The first line of the input contains one integer number $$$n$$$ ($$$1 \le n \le 1000$$$) — the number of elements in Mishka's birthday present (surprisingly, an array). The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the elements of the array. | ["1 1 3 5 9", "9999 9 50605065 1 5 89 5 999999999 60506055 999999999"] | #include<stdio.h>
int main()
{
int a,b,i,j;
long long int c,d;
scanf("%d",&a);
for(i=0;i<a;i++)
{
scanf("%lld",&c);
if(c%2==0)
{
d=c-1;
printf("%lld ",d);
}
else
{
printf("%lld ",c);
}
}
return 0;
} | |
Mishka got an integer array $$$a$$$ of length $$$n$$$ as a birthday present (what a surprise!).Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjacent Replacements Algorithm". This algorithm can be represented as a sequence of steps: Replace each o... | Print $$$n$$$ integers — $$$b_1, b_2, \dots, b_n$$$, where $$$b_i$$$ is the final value of the $$$i$$$-th element of the array after applying "Mishka's Adjacent Replacements Algorithm" to the array $$$a$$$. Note that you cannot change the order of elements in the array. | C | d00696cb27c679dda6e2e29314a8432b | 5a6abc25d61cf9700d1c622330b3fbb7 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1531751700 | ["5\n1 2 4 5 10", "10\n10000 10 50605065 1 5 89 5 999999999 60506056 1000000000"] | NoteThe first example is described in the problem statement. | PASSED | 800 | standard input | 1 second | The first line of the input contains one integer number $$$n$$$ ($$$1 \le n \le 1000$$$) — the number of elements in Mishka's birthday present (surprisingly, an array). The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the elements of the array. | ["1 1 3 5 9", "9999 9 50605065 1 5 89 5 999999999 60506055 999999999"] | #include<stdio.h>
int main()
{
int a,b,i,j;
long long int c,d;
scanf("%d",&a);
for(i=0;i<a;i++)
{
scanf("%lld",&c);
if(c%2==0)
{
d=c-1;
printf("%lld ",d);
}
else
{
printf("%lld ",c);
}
}
return 0;
} | |
Mishka got an integer array $$$a$$$ of length $$$n$$$ as a birthday present (what a surprise!).Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjacent Replacements Algorithm". This algorithm can be represented as a sequence of steps: Replace each o... | Print $$$n$$$ integers — $$$b_1, b_2, \dots, b_n$$$, where $$$b_i$$$ is the final value of the $$$i$$$-th element of the array after applying "Mishka's Adjacent Replacements Algorithm" to the array $$$a$$$. Note that you cannot change the order of elements in the array. | C | d00696cb27c679dda6e2e29314a8432b | 32a142275c9234a651d2acd9192fb28c | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1531751700 | ["5\n1 2 4 5 10", "10\n10000 10 50605065 1 5 89 5 999999999 60506056 1000000000"] | NoteThe first example is described in the problem statement. | PASSED | 800 | standard input | 1 second | The first line of the input contains one integer number $$$n$$$ ($$$1 \le n \le 1000$$$) — the number of elements in Mishka's birthday present (surprisingly, an array). The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the elements of the array. | ["1 1 3 5 9", "9999 9 50605065 1 5 89 5 999999999 60506055 999999999"] | #include<stdio.h>
int main(){
int n;
int a[1000];
scanf("%d",&n);
for(int i=0;i<n;i++)
scanf("%d",&a[i]);
for(int i=0;i<n;i++)
{
if(a[i]%2==0)
printf("%d ",a[i]-1);
else
printf("%d ",a[i]);
}
return 0 ;
} | |
Mishka got an integer array $$$a$$$ of length $$$n$$$ as a birthday present (what a surprise!).Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjacent Replacements Algorithm". This algorithm can be represented as a sequence of steps: Replace each o... | Print $$$n$$$ integers — $$$b_1, b_2, \dots, b_n$$$, where $$$b_i$$$ is the final value of the $$$i$$$-th element of the array after applying "Mishka's Adjacent Replacements Algorithm" to the array $$$a$$$. Note that you cannot change the order of elements in the array. | C | d00696cb27c679dda6e2e29314a8432b | e9e21b946e1c42959cb235654bcdc537 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1531751700 | ["5\n1 2 4 5 10", "10\n10000 10 50605065 1 5 89 5 999999999 60506056 1000000000"] | NoteThe first example is described in the problem statement. | PASSED | 800 | standard input | 1 second | The first line of the input contains one integer number $$$n$$$ ($$$1 \le n \le 1000$$$) — the number of elements in Mishka's birthday present (surprisingly, an array). The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the elements of the array. | ["1 1 3 5 9", "9999 9 50605065 1 5 89 5 999999999 60506055 999999999"] | #include<stdio.h>
int main ()
{
int n;
scanf("%d",&n);
int a[n];
int i;
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
if(a[i]%2==0)
{
printf("%d ",a[i]-1);
}
else
{
printf("%d ",a[i]);
}
... | |
Mishka got an integer array $$$a$$$ of length $$$n$$$ as a birthday present (what a surprise!).Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjacent Replacements Algorithm". This algorithm can be represented as a sequence of steps: Replace each o... | Print $$$n$$$ integers — $$$b_1, b_2, \dots, b_n$$$, where $$$b_i$$$ is the final value of the $$$i$$$-th element of the array after applying "Mishka's Adjacent Replacements Algorithm" to the array $$$a$$$. Note that you cannot change the order of elements in the array. | C | d00696cb27c679dda6e2e29314a8432b | 5dbfa71b9c3b0847e00abead4d28dea3 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1531751700 | ["5\n1 2 4 5 10", "10\n10000 10 50605065 1 5 89 5 999999999 60506056 1000000000"] | NoteThe first example is described in the problem statement. | PASSED | 800 | standard input | 1 second | The first line of the input contains one integer number $$$n$$$ ($$$1 \le n \le 1000$$$) — the number of elements in Mishka's birthday present (surprisingly, an array). The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the elements of the array. | ["1 1 3 5 9", "9999 9 50605065 1 5 89 5 999999999 60506055 999999999"] | #include <stdio.h>
#include <stdlib.h>
int main()
{
int N;
scanf("%d",&N);
int arr[N];
for(int i=0; i<N; i++){
scanf("%d",&arr[i]);
}
for(int i=0; i<N; i++){
if(arr[i]%2==0)arr[i]=arr[i]-1;
}
for(int i=0; i<N; i++){
printf("%d ",arr[i]);
}
return 0;
}
| |
Mishka got an integer array $$$a$$$ of length $$$n$$$ as a birthday present (what a surprise!).Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjacent Replacements Algorithm". This algorithm can be represented as a sequence of steps: Replace each o... | Print $$$n$$$ integers — $$$b_1, b_2, \dots, b_n$$$, where $$$b_i$$$ is the final value of the $$$i$$$-th element of the array after applying "Mishka's Adjacent Replacements Algorithm" to the array $$$a$$$. Note that you cannot change the order of elements in the array. | C | d00696cb27c679dda6e2e29314a8432b | ebbffd57a5ad43b474c243eaa8fe188e | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1531751700 | ["5\n1 2 4 5 10", "10\n10000 10 50605065 1 5 89 5 999999999 60506056 1000000000"] | NoteThe first example is described in the problem statement. | PASSED | 800 | standard input | 1 second | The first line of the input contains one integer number $$$n$$$ ($$$1 \le n \le 1000$$$) — the number of elements in Mishka's birthday present (surprisingly, an array). The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the elements of the array. | ["1 1 3 5 9", "9999 9 50605065 1 5 89 5 999999999 60506055 999999999"] | #include <stdio.h>
int main(){
int n;
//freopen("input.txt","r",stdin);
scanf("%d",&n);
int a[n];
int i;
for(i=0;i<n;i++){
scanf("%d",&a[i]);
if(a[i]%2==0) printf("%d ",a[i]-1);
else printf("%d ",a[i]);
}
return 0;
}
| |
Mishka got an integer array $$$a$$$ of length $$$n$$$ as a birthday present (what a surprise!).Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjacent Replacements Algorithm". This algorithm can be represented as a sequence of steps: Replace each o... | Print $$$n$$$ integers — $$$b_1, b_2, \dots, b_n$$$, where $$$b_i$$$ is the final value of the $$$i$$$-th element of the array after applying "Mishka's Adjacent Replacements Algorithm" to the array $$$a$$$. Note that you cannot change the order of elements in the array. | C | d00696cb27c679dda6e2e29314a8432b | b461196b8acd5e9684996a766257b7aa | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1531751700 | ["5\n1 2 4 5 10", "10\n10000 10 50605065 1 5 89 5 999999999 60506056 1000000000"] | NoteThe first example is described in the problem statement. | PASSED | 800 | standard input | 1 second | The first line of the input contains one integer number $$$n$$$ ($$$1 \le n \le 1000$$$) — the number of elements in Mishka's birthday present (surprisingly, an array). The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the elements of the array. | ["1 1 3 5 9", "9999 9 50605065 1 5 89 5 999999999 60506055 999999999"] | #include<stdio.h>
main()
{
int i,n;
scanf("%d",&n);
int a[n];
for(i=0;i<=(n-1);i++)
{
scanf("%d",&a[i]);
if(a[i]%2==0)
a[i]=a[i]-1;
}
for(i=0;i<=(n-1);i++)
printf("%d ",a[i]);
printf("\n");
} | |
Mishka got an integer array $$$a$$$ of length $$$n$$$ as a birthday present (what a surprise!).Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjacent Replacements Algorithm". This algorithm can be represented as a sequence of steps: Replace each o... | Print $$$n$$$ integers — $$$b_1, b_2, \dots, b_n$$$, where $$$b_i$$$ is the final value of the $$$i$$$-th element of the array after applying "Mishka's Adjacent Replacements Algorithm" to the array $$$a$$$. Note that you cannot change the order of elements in the array. | C | d00696cb27c679dda6e2e29314a8432b | c448f920d2f12a6edadc4f117c4ef030 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1531751700 | ["5\n1 2 4 5 10", "10\n10000 10 50605065 1 5 89 5 999999999 60506056 1000000000"] | NoteThe first example is described in the problem statement. | PASSED | 800 | standard input | 1 second | The first line of the input contains one integer number $$$n$$$ ($$$1 \le n \le 1000$$$) — the number of elements in Mishka's birthday present (surprisingly, an array). The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the elements of the array. | ["1 1 3 5 9", "9999 9 50605065 1 5 89 5 999999999 60506055 999999999"] | #include<stdio.h>
int main()
{
int n,i;
int a[1000];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
if(a[i]%2==0)
{
a[i]=a[i]-1;
}
}
for(i=0;i<n;i++)
{
printf("%d ",a[i]);
}
return 0;
} | |
Mishka got an integer array $$$a$$$ of length $$$n$$$ as a birthday present (what a surprise!).Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjacent Replacements Algorithm". This algorithm can be represented as a sequence of steps: Replace each o... | Print $$$n$$$ integers — $$$b_1, b_2, \dots, b_n$$$, where $$$b_i$$$ is the final value of the $$$i$$$-th element of the array after applying "Mishka's Adjacent Replacements Algorithm" to the array $$$a$$$. Note that you cannot change the order of elements in the array. | C | d00696cb27c679dda6e2e29314a8432b | e74392f1e22fdd09ecd3c5efd1244918 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1531751700 | ["5\n1 2 4 5 10", "10\n10000 10 50605065 1 5 89 5 999999999 60506056 1000000000"] | NoteThe first example is described in the problem statement. | PASSED | 800 | standard input | 1 second | The first line of the input contains one integer number $$$n$$$ ($$$1 \le n \le 1000$$$) — the number of elements in Mishka's birthday present (surprisingly, an array). The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the elements of the array. | ["1 1 3 5 9", "9999 9 50605065 1 5 89 5 999999999 60506055 999999999"] | #include <stdio.h>
#include <stdlib.h>
int main()
{
int a[1000];
int i,n;
scanf("%d",&n);
for(i=0; i<n; i++)
scanf("%d",&a[i]);
for(i=0; i<n-1; i++){
if(a[i]%2!=0)
a[i]++;
}
for(i=0; i<n; i++){
if(a[i]%2==0)
a[i]--;
}
for(i=0; i<n; i++)
prin... | |
Mishka got an integer array $$$a$$$ of length $$$n$$$ as a birthday present (what a surprise!).Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjacent Replacements Algorithm". This algorithm can be represented as a sequence of steps: Replace each o... | Print $$$n$$$ integers — $$$b_1, b_2, \dots, b_n$$$, where $$$b_i$$$ is the final value of the $$$i$$$-th element of the array after applying "Mishka's Adjacent Replacements Algorithm" to the array $$$a$$$. Note that you cannot change the order of elements in the array. | C | d00696cb27c679dda6e2e29314a8432b | 7d7ef9172523ea58a317c4b60b312146 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1531751700 | ["5\n1 2 4 5 10", "10\n10000 10 50605065 1 5 89 5 999999999 60506056 1000000000"] | NoteThe first example is described in the problem statement. | PASSED | 800 | standard input | 1 second | The first line of the input contains one integer number $$$n$$$ ($$$1 \le n \le 1000$$$) — the number of elements in Mishka's birthday present (surprisingly, an array). The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the elements of the array. | ["1 1 3 5 9", "9999 9 50605065 1 5 89 5 999999999 60506055 999999999"] | #include<stdio.h>
int main()
{
int n,i;
long a[1000];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
if(a[i]==a[i]/2*2)a[i]-=1;
}
for(i=0;i<n;i++)
printf("%d ",a[i]);
return 0;
}
| |
Mishka got an integer array $$$a$$$ of length $$$n$$$ as a birthday present (what a surprise!).Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjacent Replacements Algorithm". This algorithm can be represented as a sequence of steps: Replace each o... | Print $$$n$$$ integers — $$$b_1, b_2, \dots, b_n$$$, where $$$b_i$$$ is the final value of the $$$i$$$-th element of the array after applying "Mishka's Adjacent Replacements Algorithm" to the array $$$a$$$. Note that you cannot change the order of elements in the array. | C | d00696cb27c679dda6e2e29314a8432b | 8bcbafb4bc7a048fc8aae0343eac9bb5 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1531751700 | ["5\n1 2 4 5 10", "10\n10000 10 50605065 1 5 89 5 999999999 60506056 1000000000"] | NoteThe first example is described in the problem statement. | PASSED | 800 | standard input | 1 second | The first line of the input contains one integer number $$$n$$$ ($$$1 \le n \le 1000$$$) — the number of elements in Mishka's birthday present (surprisingly, an array). The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the elements of the array. | ["1 1 3 5 9", "9999 9 50605065 1 5 89 5 999999999 60506055 999999999"] | #include <stdio.h>
int main()
{
int a, i, n;
scanf ("%d", &n);
for (i = 0; i < n; i++) {
scanf ("%d", &a);
printf ("%d ", a - !(a & 1));
}
printf ("\n");
return 0;
}
| |
Mishka got an integer array $$$a$$$ of length $$$n$$$ as a birthday present (what a surprise!).Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjacent Replacements Algorithm". This algorithm can be represented as a sequence of steps: Replace each o... | Print $$$n$$$ integers — $$$b_1, b_2, \dots, b_n$$$, where $$$b_i$$$ is the final value of the $$$i$$$-th element of the array after applying "Mishka's Adjacent Replacements Algorithm" to the array $$$a$$$. Note that you cannot change the order of elements in the array. | C | d00696cb27c679dda6e2e29314a8432b | cae0cfd06d1612b428edc3eb3cc4bd1f | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1531751700 | ["5\n1 2 4 5 10", "10\n10000 10 50605065 1 5 89 5 999999999 60506056 1000000000"] | NoteThe first example is described in the problem statement. | PASSED | 800 | standard input | 1 second | The first line of the input contains one integer number $$$n$$$ ($$$1 \le n \le 1000$$$) — the number of elements in Mishka's birthday present (surprisingly, an array). The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the elements of the array. | ["1 1 3 5 9", "9999 9 50605065 1 5 89 5 999999999 60506055 999999999"] | #include <stdio.h>
#include <stdlib.h>
int main()
{
int i, n;
scanf ("%d", &n);
int *a = (int*) malloc (sizeof(int) * n);
for (i = 0; i < n; i++) {
scanf ("%d", a + i);
if (a[i] % 2 == 0)
a[i]--;
}
for (i = 0; i < n - 1; i++)
printf ("%d ", a[i]);
printf ... | |
Mishka got an integer array $$$a$$$ of length $$$n$$$ as a birthday present (what a surprise!).Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjacent Replacements Algorithm". This algorithm can be represented as a sequence of steps: Replace each o... | Print $$$n$$$ integers — $$$b_1, b_2, \dots, b_n$$$, where $$$b_i$$$ is the final value of the $$$i$$$-th element of the array after applying "Mishka's Adjacent Replacements Algorithm" to the array $$$a$$$. Note that you cannot change the order of elements in the array. | C | d00696cb27c679dda6e2e29314a8432b | e15ff13c1dbc064b9dc4e67dfe652255 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1531751700 | ["5\n1 2 4 5 10", "10\n10000 10 50605065 1 5 89 5 999999999 60506056 1000000000"] | NoteThe first example is described in the problem statement. | PASSED | 800 | standard input | 1 second | The first line of the input contains one integer number $$$n$$$ ($$$1 \le n \le 1000$$$) — the number of elements in Mishka's birthday present (surprisingly, an array). The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the elements of the array. | ["1 1 3 5 9", "9999 9 50605065 1 5 89 5 999999999 60506055 999999999"] | #include <stdio.h>
int main()
{
int n,i;
scanf("%d",&n);
long int a[n];
for(i=0;i<n;i++)
{
scanf("%ld",&a[i]);
if(a[i]%2==0)
a[i]=a[i]-1;
}
for(i=0;i<n;i++)
printf("%ld ",a[i]);
} | |
Mishka got an integer array $$$a$$$ of length $$$n$$$ as a birthday present (what a surprise!).Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjacent Replacements Algorithm". This algorithm can be represented as a sequence of steps: Replace each o... | Print $$$n$$$ integers — $$$b_1, b_2, \dots, b_n$$$, where $$$b_i$$$ is the final value of the $$$i$$$-th element of the array after applying "Mishka's Adjacent Replacements Algorithm" to the array $$$a$$$. Note that you cannot change the order of elements in the array. | C | d00696cb27c679dda6e2e29314a8432b | b09af2f3687a986ec89c6410f7358677 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1531751700 | ["5\n1 2 4 5 10", "10\n10000 10 50605065 1 5 89 5 999999999 60506056 1000000000"] | NoteThe first example is described in the problem statement. | PASSED | 800 | standard input | 1 second | The first line of the input contains one integer number $$$n$$$ ($$$1 \le n \le 1000$$$) — the number of elements in Mishka's birthday present (surprisingly, an array). The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the elements of the array. | ["1 1 3 5 9", "9999 9 50605065 1 5 89 5 999999999 60506055 999999999"] | #include<stdio.h>
int main()
{
int n,i;
scanf("%d",&n);
long int arr[n];
for(i=0;i<n;i++)
{
scanf("%ld",&arr[i]);
if(arr[i]%2==0)
arr[i]= arr[i]-1;
}
for(i=0;i<n;i++)
printf(" %ld",arr[i]);
return 0;
}
| |
Mishka got an integer array $$$a$$$ of length $$$n$$$ as a birthday present (what a surprise!).Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjacent Replacements Algorithm". This algorithm can be represented as a sequence of steps: Replace each o... | Print $$$n$$$ integers — $$$b_1, b_2, \dots, b_n$$$, where $$$b_i$$$ is the final value of the $$$i$$$-th element of the array after applying "Mishka's Adjacent Replacements Algorithm" to the array $$$a$$$. Note that you cannot change the order of elements in the array. | C | d00696cb27c679dda6e2e29314a8432b | cd2e473d5da5631b3a59930aad208feb | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1531751700 | ["5\n1 2 4 5 10", "10\n10000 10 50605065 1 5 89 5 999999999 60506056 1000000000"] | NoteThe first example is described in the problem statement. | PASSED | 800 | standard input | 1 second | The first line of the input contains one integer number $$$n$$$ ($$$1 \le n \le 1000$$$) — the number of elements in Mishka's birthday present (surprisingly, an array). The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the elements of the array. | ["1 1 3 5 9", "9999 9 50605065 1 5 89 5 999999999 60506055 999999999"] | #include<stdio.h>
int main()
{
int n;
int a[1005] = {0};
scanf("%d",&n);
for(int i = 0 ; i < n; i ++) scanf("%d",&a[i]);
for(int i = 0 ; i < n-1 ; i ++)
{
if(a[i]&1) printf("%d ",a[i]);
else printf("%d ",a[i]-1);
}
if(a[n-1]&1) printf("%d\n",a[n-1]);
else printf("%d\... | |
Mishka got an integer array $$$a$$$ of length $$$n$$$ as a birthday present (what a surprise!).Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjacent Replacements Algorithm". This algorithm can be represented as a sequence of steps: Replace each o... | Print $$$n$$$ integers — $$$b_1, b_2, \dots, b_n$$$, where $$$b_i$$$ is the final value of the $$$i$$$-th element of the array after applying "Mishka's Adjacent Replacements Algorithm" to the array $$$a$$$. Note that you cannot change the order of elements in the array. | C | d00696cb27c679dda6e2e29314a8432b | da0fa10aa1c9487afbbd7c30c315de7d | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1531751700 | ["5\n1 2 4 5 10", "10\n10000 10 50605065 1 5 89 5 999999999 60506056 1000000000"] | NoteThe first example is described in the problem statement. | PASSED | 800 | standard input | 1 second | The first line of the input contains one integer number $$$n$$$ ($$$1 \le n \le 1000$$$) — the number of elements in Mishka's birthday present (surprisingly, an array). The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the elements of the array. | ["1 1 3 5 9", "9999 9 50605065 1 5 89 5 999999999 60506055 999999999"] | #include<stdio.h>
#include<math.h>
int main()
{
int n;
scanf("%d",&n);
double x[n];
int y;
for(y=0;y<n;y++)
{
scanf("%lf",&x[y]);
}
int z,max;
for(y=0;y<n;y++)
{
if(fmod(x[y],2)==0)
{
x[y]--;
}
printf("%.0lf ",x[y]);
}
} | |
Mishka got an integer array $$$a$$$ of length $$$n$$$ as a birthday present (what a surprise!).Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjacent Replacements Algorithm". This algorithm can be represented as a sequence of steps: Replace each o... | Print $$$n$$$ integers — $$$b_1, b_2, \dots, b_n$$$, where $$$b_i$$$ is the final value of the $$$i$$$-th element of the array after applying "Mishka's Adjacent Replacements Algorithm" to the array $$$a$$$. Note that you cannot change the order of elements in the array. | C | d00696cb27c679dda6e2e29314a8432b | 6c9725a46e74ff6eda3bab0d62339066 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1531751700 | ["5\n1 2 4 5 10", "10\n10000 10 50605065 1 5 89 5 999999999 60506056 1000000000"] | NoteThe first example is described in the problem statement. | PASSED | 800 | standard input | 1 second | The first line of the input contains one integer number $$$n$$$ ($$$1 \le n \le 1000$$$) — the number of elements in Mishka's birthday present (surprisingly, an array). The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the elements of the array. | ["1 1 3 5 9", "9999 9 50605065 1 5 89 5 999999999 60506055 999999999"] | #include<stdio.h>
#include<math.h>
int main()
{
int n;
scanf("%d",&n);
double x[n];
int y;
for(y=0;y<n;y++)
{
scanf("%lf",&x[y]);
}
int z,max;
for(y=0;y<n;y++)
{
if(fmod(x[y],2)==0)
{
x[y]--;
}
printf("%.0lf ",x[y]);
}
} | |
Mishka got an integer array $$$a$$$ of length $$$n$$$ as a birthday present (what a surprise!).Mishka doesn't like this present and wants to change it somehow. He has invented an algorithm and called it "Mishka's Adjacent Replacements Algorithm". This algorithm can be represented as a sequence of steps: Replace each o... | Print $$$n$$$ integers — $$$b_1, b_2, \dots, b_n$$$, where $$$b_i$$$ is the final value of the $$$i$$$-th element of the array after applying "Mishka's Adjacent Replacements Algorithm" to the array $$$a$$$. Note that you cannot change the order of elements in the array. | C | d00696cb27c679dda6e2e29314a8432b | a78f27baad96a8f00da43f865520cd9f | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation"
] | 1531751700 | ["5\n1 2 4 5 10", "10\n10000 10 50605065 1 5 89 5 999999999 60506056 1000000000"] | NoteThe first example is described in the problem statement. | PASSED | 800 | standard input | 1 second | The first line of the input contains one integer number $$$n$$$ ($$$1 \le n \le 1000$$$) — the number of elements in Mishka's birthday present (surprisingly, an array). The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^9$$$) — the elements of the array. | ["1 1 3 5 9", "9999 9 50605065 1 5 89 5 999999999 60506055 999999999"] |
#include<stdio.h>
int main()
{
int n,a[1000],b[1000],t1=0,t2=0,i,j,t=0;
scanf("%d",&n);
for (i=0;i<n;i++) {
scanf("%d",&a[i]);
b[i]=a[i];
}
for(i=0;i<n-1;i++)
{
for (j=0;j<n-i-1;j++)
{
if(b[j]>b[j+1])
{
t=b[j];
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.