sample_inputs stringlengths 5 384 | input_specification stringlengths 48 911 | src_uid stringlengths 32 32 | source_code stringlengths 29 6.77k | sample_outputs stringlengths 5 393 | lang_cluster stringclasses 4
values | notes stringlengths 30 1.52k β | output_specification stringlengths 25 681 | description stringlengths 140 2.49k | human_testcases stringlengths 243 50.8k | human_pass_rate float64 100 100 | human_line_coverage float64 100 100 | human_branch_coverage float64 100 100 | human_sample_testcases_1 stringlengths 190 3.11k | human_sample_testcases_2 stringlengths 190 3.11k | human_sample_testcases_3 stringlengths 190 3.11k | human_sample_testcases_4 stringlengths 190 3.11k | human_sample_testcases_5 stringlengths 190 3.11k | human_sample_pass_rate_1 float64 100 100 | human_sample_pass_rate_2 float64 100 100 | human_sample_pass_rate_3 float64 100 100 | human_sample_pass_rate_4 float64 100 100 | human_sample_pass_rate_5 float64 100 100 | human_sample_line_coverage_1 float64 52.2 100 | human_sample_line_coverage_2 float64 60 100 | human_sample_line_coverage_3 float64 50 100 | human_sample_line_coverage_4 float64 43.5 100 | human_sample_line_coverage_5 float64 21.7 100 | human_sample_branch_coverage_1 float64 45.5 100 | human_sample_branch_coverage_2 float64 45.8 100 | human_sample_branch_coverage_3 float64 16.7 100 | human_sample_branch_coverage_4 float64 36.4 100 | human_sample_branch_coverage_5 float64 18.2 100 | id int64 1 400 | human_sample_pass_rate float64 100 100 | human_sample_line_coverage float64 47 100 | human_sample_branch_coverage float64 41.8 100 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
["6 3\n1 1 1 0 1 0", "5 2\n0 0 0 1 0"] | The first line of the input contains two integers n and a (1ββ€βaββ€βnββ€β100)Β β the number of cities and the index of city where Limak lives. The second line contains n integers t1,βt2,β...,βtn (0ββ€βtiββ€β1). There are ti criminals in the i-th city. | 4840d571d4ce6e1096bb678b6c100ae5 | #include<stdio.h>
int main()
{
int n,i,j,pos,counter;
int criminals[100];
counter=0;
scanf("%d%d",&n,&pos);
for(i=0;i<n;i++)
scanf("%d",&criminals[i]);
if(criminals[pos-1]==1)
counter+=1;
for(j=1;j<=i;j++)
{
if((pos-1-j>=0)&&(pos-1+j<n)&&((criminals[pos-1-j]&criminals[pos-1+j])==1))
counter+=2;
else if((pos-1-j>=0)&&(p... | ["3", "1"] | C | NoteIn the first sample, there are six cities and Limak lives in the third one (blue arrow below). Criminals are in cities marked red. Using the BCD gives Limak the following information: There is one criminal at distance 0 from the third cityΒ β Limak is sure that this criminal is exactly in the third city. There is... | Print the number of criminals Limak will catch. | There are n cities in Bearland, numbered 1 through n. Cities are arranged in one long row. The distance between cities i and j is equal to |iβ-βj|.Limak is a police officer. He lives in a city a. His job is to catch criminals. It's hard because he doesn't know in which cities criminals are. Though, he knows that there ... | [{"input": "6 3\r\n1 1 1 0 1 0\r\n", "output": ["3"]}, {"input": "5 2\r\n0 0 0 1 0\r\n", "output": ["1"]}, {"input": "1 1\r\n1\r\n", "output": ["1"]}, {"input": "1 1\r\n0\r\n", "output": ["0"]}, {"input": "9 3\r\n1 1 1 1 1 1 1 1 0\r\n", "output": ["8"]}, {"input": "9 5\r\n1 0 1 0 1 0 1 0 1\r\n", "output": ["5"]}, {"inp... | 100 | 100 | 100 | [{'input': '6 3\r\n1 1 1 0 1 0\r\n', 'output': ['3']}, {'input': '98 24\r\n0 0 0 1 1 0 1 1 0 0 0 0 1 0 0 1 0 0 1 1 1 0 0 1 0 0 1 0 1 0 0 1 1 0 1 1 1 0 1 0 0 1 0 0 0 1 1 1 1 0 1 1 1 0 1 1 1 1 0 0 1 0 0 0 1 0 1 1 0 1 0 1 1 1 0 0 1 0 0 0 1 1 0 0 1 1 1 1 1 1 0 1 0 1 0 0 1 1\r\n', 'output': ['39']}, {'input': '8 1\r\n1 0 1 ... | [{'input': '99 38\r\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\r\n', 'output': ['24']}, {'input': '99 70\r\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... | [{'input': '6 3\r\n1 1 1 0 1 0\r\n', 'output': ['3']}, {'input': '1 1\r\n0\r\n', 'output': ['0']}, {'input': '100 60\r\n1 1 1 1 1 1 0 1 0 0 1 1 0 1 1 1 1 1 0 0 1 1 0 0 0 0 0 1 0 1 1 0 1 0 1 0 1 0 1 1 0 0 0 0 0 1 1 1 0 1 1 0 0 0 1 0 0 0 1 1 1 0 1 0 0 1 1 1 0 1 1 1 0 0 1 1 0 1 0 0 0 1 0 0 0 0 0 0 1 1 1 0 0 1 1 1 0 1 0 0\... | [{'input': '100 38\r\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\r\n', 'output': ['1']}, {'input': '100 1\r\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... | [{'input': '19 10\r\n0 1 1 0 1 0 0 1 1 0 0 1 0 1 0 0 1 0 1\r\n', 'output': ['4']}, {'input': '99 38\r\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\r\n', 'output': ['2... | 100 | 100 | 100 | 100 | 100 | 93.75 | 100 | 93.75 | 93.75 | 100 | 83.33 | 100 | 95.83 | 83.33 | 95.83 | 1 | 100 | 96.25 | 91.664 |
["9 7 3 8", "2 7 3 7", "30 6 17 19"] | The only line contains four integer numbers $$$n$$$, $$$m$$$, $$$a$$$ and $$$b$$$ ($$$1 \le n, m \le 10^{12}$$$, $$$1 \le a, b \le 100$$$), where $$$n$$$ is the initial number of the commentary boxes, $$$m$$$ is the number of delegations to come, $$$a$$$ is the fee to build a box and $$$b$$$ is the fee to demolish a bo... | c05d753b35545176ad468b99ff13aa39 | #include<stdio.h>
int main()
{
long long int c,a,n,m,b,d,e,f;
scanf("%lld%lld%lld%lld",&n,&m,&a,&b);
c=n%m;
d=m-n%m;
b=b*c;
a=a*d;
if(a>b)
printf("%lld\n",b);
else
printf("%lld\n",a);
return 0;
}
| ["15", "14", "0"] | C | NoteIn the first example organizers can build $$$5$$$ boxes to make the total of $$$14$$$ paying $$$3$$$ burles for the each of them.In the second example organizers can demolish $$$2$$$ boxes to make the total of $$$0$$$ paying $$$7$$$ burles for the each of them.In the third example organizers are already able to dis... | Output the minimal amount of burles organizers should pay to satisfy all the delegations (i.e. to make the number of the boxes be divisible by $$$m$$$). It is allowed that the final number of the boxes is equal to $$$0$$$. | Berland Football Cup starts really soon! Commentators from all over the world come to the event.Organizers have already built $$$n$$$ commentary boxes. $$$m$$$ regional delegations will come to the Cup. Every delegation should get the same number of the commentary boxes. If any box is left unoccupied then the delegatio... | [{"input": "9 7 3 8\r\n", "output": ["15"]}, {"input": "2 7 3 7\r\n", "output": ["14"]}, {"input": "30 6 17 19\r\n", "output": ["0"]}, {"input": "500000000001 1000000000000 100 100\r\n", "output": ["49999999999900"]}, {"input": "1000000000000 750000000001 10 100\r\n", "output": ["5000000000020"]}, {"input": "1000000000... | 100 | 100 | 100 | [{'input': '7 3 100 1\r\n', 'output': ['1']}, {'input': '7 2 1 2\r\n', 'output': ['1']}, {'input': '100000000000 3 1 1\r\n', 'output': ['1']}, {'input': '957747787 424238336 87 93\r\n', 'output': ['10162213695']}, {'input': '10 12 2 1\r\n', 'output': ['4']}] | [{'input': '1 1 1 1\r\n', 'output': ['0']}, {'input': '100 3 2 5\r\n', 'output': ['4']}, {'input': '10000000001 2 1 1\r\n', 'output': ['1']}, {'input': '5 5 2 3\r\n', 'output': ['0']}, {'input': '30 6 17 19\r\n', 'output': ['0']}] | [{'input': '100 7 1 1\r\n', 'output': ['2']}, {'input': '29 5 4 9\r\n', 'output': ['4']}, {'input': '25 7 100 1\r\n', 'output': ['4']}, {'input': '100 3 5 2\r\n', 'output': ['2']}, {'input': '70 4 1 1\r\n', 'output': ['2']}] | [{'input': '7 2 100 5\r\n', 'output': ['5']}, {'input': '7 3 100 1\r\n', 'output': ['1']}, {'input': '70 4 1 1\r\n', 'output': ['2']}, {'input': '100 7 1 1\r\n', 'output': ['2']}, {'input': '999999999999 10000000007 100 100\r\n', 'output': ['70100']}] | [{'input': '1000000000000 3 99 99\r\n', 'output': ['99']}, {'input': '15 4 4 10\r\n', 'output': ['4']}, {'input': '1000000000000 2 1 1\r\n', 'output': ['0']}, {'input': '3205261341 718648876 58 11\r\n', 'output': ['3637324207']}, {'input': '10000000001 2 1 1\r\n', 'output': ['1']}] | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 2 | 100 | 100 | 100 |
["3000"] | The only line of the input contains one integer n (1ββ€βnββ€β1018) β the prediction on the number of people who will buy the game. | 8551308e5ff435e0fc507b89a912408a | #include<stdio.h>
int main()
{
long long int i,j,n,l,a,k;
scanf("%lld",&n);
k=2520;
a=n/k;
printf("%lld\n",a);
return 0;
} | ["1"] | C | null | Output one integer showing how many numbers from 1 to n are divisible by all numbers from 2 to 10. | IT City company developing computer games invented a new way to reward its employees. After a new game release users start buying it actively, and the company tracks the number of sales with precision to each transaction. Every time when the next number of sales is divisible by all numbers from 2 to 10 every developer ... | [{"input": "3000\r\n", "output": ["1"]}, {"input": "2520\r\n", "output": ["1"]}, {"input": "2519\r\n", "output": ["0"]}, {"input": "2521\r\n", "output": ["1"]}, {"input": "1\r\n", "output": ["0"]}, {"input": "314159265\r\n", "output": ["124666"]}, {"input": "718281828459045235\r\n", "output": ["285032471610732"]}, {"in... | 100 | 100 | 100 | [{'input': '2521\r\n', 'output': ['1']}, {'input': '2520\r\n', 'output': ['1']}, {'input': '3628800\r\n', 'output': ['1440']}, {'input': '2519\r\n', 'output': ['0']}, {'input': '718281828459045235\r\n', 'output': ['285032471610732']}] | [{'input': '3000\r\n', 'output': ['1']}, {'input': '2519\r\n', 'output': ['0']}, {'input': '987654321234567890\r\n', 'output': ['391926317950225']}, {'input': '1\r\n', 'output': ['0']}, {'input': '1000000000000000000\r\n', 'output': ['396825396825396']}] | [{'input': '504000000000000000\r\n', 'output': ['200000000000000']}, {'input': '2521\r\n', 'output': ['1']}, {'input': '3000\r\n', 'output': ['1']}, {'input': '1\r\n', 'output': ['0']}, {'input': '718281828459045235\r\n', 'output': ['285032471610732']}] | [{'input': '1000000000000000000\r\n', 'output': ['396825396825396']}, {'input': '987654321234567890\r\n', 'output': ['391926317950225']}, {'input': '3628800\r\n', 'output': ['1440']}, {'input': '718281828459045235\r\n', 'output': ['285032471610732']}, {'input': '314159265\r\n', 'output': ['124666']}] | [{'input': '2520\r\n', 'output': ['1']}, {'input': '1000000000000000000\r\n', 'output': ['396825396825396']}, {'input': '1\r\n', 'output': ['0']}, {'input': '3000\r\n', 'output': ['1']}, {'input': '3628800\r\n', 'output': ['1440']}] | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 3 | 100 | 100 | 100 |
["2 6 2 2", "1 9 1 2"] | The first line of the input contains four integers d, L, v1, v2 (1ββ€βd,βL,βv1,βv2ββ€β10β000,βdβ<βL)Β β Luke's width, the initial position of the second press and the speed of the first and second presses, respectively. | f34f3f974a21144b9f6e8615c41830f5 | #include<stdio.h>
main(){
double d,l,v1,v2;
scanf("%lf %lf %lf %lf",&d,&l,&v1,&v2);
printf("%0.10lf",(l-d)/(v1+v2));
}
| ["1.00000000000000000000", "2.66666666666666650000"] | C | NoteIn the first sample Luke should stay exactly in the middle of the segment, that is at coordinates [2;4], as the presses move with the same speed.In the second sample he needs to occupy the position . In this case both presses move to his edges at the same time. | Print a single real valueΒ β the maximum period of time Luke can stay alive for. Your answer will be considered correct if its absolute or relative error does not exceed 10β-β6. Namely: let's assume that your answer is a, and the answer of the jury is b. The checker program will consider your answer correct, if . | Luke Skywalker got locked up in a rubbish shredder between two presses. R2D2 is already working on his rescue, but Luke needs to stay alive as long as possible. For simplicity we will assume that everything happens on a straight line, the presses are initially at coordinates 0 and L, and they move towards each other wi... | [{"input": "2 6 2 2\r\n", "output": ["1.0000000", "1.000000", "1.0", "1.00000000000000000000", "1.0000000000"]}, {"input": "1 9 1 2\r\n", "output": ["2.66666666666666666674", "2.66666666667", "2.6666666666666665", "2.6666667", "2.66666666666666650000", "2.666667", "2.6666666667", "2.66666666666666651864"]}, {"input": "... | 100 | 100 | 100 | [{'input': '6612 9565 3380 2288\r\n', 'output': ['0.52099505998588567399', '0.52099505998588568900', '0.520995', '0.5209950599858857', '0.520995059986', '0.5209951', '0.5209950600', '0.52099505998588569000']}, {'input': '2255 7902 8891 429\r\n', 'output': ['0.605901', '0.6059012876', '0.605901287553648', '0.6059013']},... | [{'input': '1854 3280 1481 2140\r\n', 'output': ['0.393814', '0.3938139', '0.39381386357359843000', '0.393813863574', '0.39381386357359843', '0.39381386357359845346', '0.3938138636', '0.39381386357359843275']}, {'input': '4600 9696 5634 8248\r\n', 'output': ['0.36709407866301685000', '0.3670941', '0.367094', '0.3670940... | [{'input': '6745 9881 2149 9907\r\n', 'output': ['0.2601194426011944', '0.2601194426', '0.2601194', '0.260119']}, {'input': '5526 6455 197 4191\r\n', 'output': ['0.2117137648131267', '0.21171376481312670359', '0.2117137648', '0.211713764813', '0.2117138', '0.21171376481312670000', '0.211714', '0.21171376481312670920']}... | [{'input': '4400 8021 6895 2089\r\n', 'output': ['0.403049866429', '0.40304986642920748000', '0.40304986642920748174', '0.4030498664292075', '0.40304986642920747995', '0.403050', '0.4030498664', '0.4030499']}, {'input': '8957 9525 8634 107\r\n', 'output': ['0.064981', '0.0649811', '0.06498112344125385', '0.064981123441... | [{'input': '1 10000 1 1\r\n', 'output': ['4999.50000000000000000000', '4999.500000', '4999.5', '4999.5000000', '4999.5000000000']}, {'input': '1 9 1 2\r\n', 'output': ['2.66666666666666666674', '2.66666666667', '2.6666666666666665', '2.6666667', '2.66666666666666650000', '2.666667', '2.6666666667', '2.66666666666666651... | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 4 | 100 | 100 | 100 |
["2"] | The only line of the input contains a single integer n (2ββ€βnββ€β2Β·1018) β the power in which you need to raise number 5. | dcaff75492eafaf61d598779d6202c9d | #include <stdio.h>
#include <math.h>
int main(){
int i;
scanf("%d",&i);
printf("25");
return 0;
}
| ["25"] | C | null | Output the last two digits of 5n without spaces between them. | The HR manager was disappointed again. The last applicant failed the interview the same way as 24 previous ones. "Do I give such a hard task?" β the HR manager thought. "Just raise number 5 to the power of n and get last two digits of the number. Yes, of course, n can be rather big, and one cannot find the power using ... | [{"input": "2\r\n", "output": ["25"]}, {"input": "7\r\n", "output": ["25"]}, {"input": "1000000000000000000\r\n", "output": ["25"]}, {"input": "2000000000000000000\r\n", "output": ["25"]}, {"input": "987654321012345678\r\n", "output": ["25"]}] | 100 | 100 | 100 | [{'input': '7\r\n', 'output': ['25']}, {'input': '2000000000000000000\r\n', 'output': ['25']}, {'input': '987654321012345678\r\n', 'output': ['25']}, {'input': '2\r\n', 'output': ['25']}, {'input': '1000000000000000000\r\n', 'output': ['25']}] | [{'input': '1000000000000000000\r\n', 'output': ['25']}, {'input': '7\r\n', 'output': ['25']}, {'input': '987654321012345678\r\n', 'output': ['25']}, {'input': '2000000000000000000\r\n', 'output': ['25']}, {'input': '2\r\n', 'output': ['25']}] | [{'input': '1000000000000000000\r\n', 'output': ['25']}, {'input': '2000000000000000000\r\n', 'output': ['25']}, {'input': '2\r\n', 'output': ['25']}, {'input': '987654321012345678\r\n', 'output': ['25']}, {'input': '7\r\n', 'output': ['25']}] | [{'input': '7\r\n', 'output': ['25']}, {'input': '1000000000000000000\r\n', 'output': ['25']}, {'input': '2000000000000000000\r\n', 'output': ['25']}, {'input': '987654321012345678\r\n', 'output': ['25']}, {'input': '2\r\n', 'output': ['25']}] | [{'input': '987654321012345678\r\n', 'output': ['25']}, {'input': '7\r\n', 'output': ['25']}, {'input': '2\r\n', 'output': ['25']}, {'input': '2000000000000000000\r\n', 'output': ['25']}, {'input': '1000000000000000000\r\n', 'output': ['25']}] | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 5 | 100 | 100 | 100 |
["5\n()))()", "3\n(()", "2\n((("] | The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 100$$$) β the half-length of the resulting regular bracket sequences (the resulting sequences must have length equal to $$$2n$$$). The second line of the input contains one string $$$s$$$ ($$$1 \le |s| \le 200$$$) β the string $$$s$$$ that should ... | 590a49a7af0eb83376ed911ed488d7e5 | #include <stdio.h>
#include <string.h>
enum { BIG = 1000000007 };
int n;
char s[240];
int slen;
int dp[201][101];
int next[201][2];
int fail[201];
void nextstep(int eo) {
int i, j;
for (i = 0; i <= slen; i++) {
int lp = next[i][0];
int rp = next[i][1];
for (j = eo; j <= n; j+=2) {
... | ["5", "4", "0"] | C | NoteAll regular bracket sequences satisfying the conditions above for the first example: "(((()))())"; "((()()))()"; "((()))()()"; "(()(()))()"; "()((()))()". All regular bracket sequences satisfying the conditions above for the second example: "((()))"; "(()())"; "(())()"; "()(())". And there is no regular ... | Print only one integer β the number of regular bracket sequences containing the given bracket sequence $$$s$$$ as a substring. Since this number can be huge, print it modulo $$$10^9+7$$$ ($$$1000000007$$$). | You are given a bracket sequence $$$s$$$ (not necessarily a regular one). A bracket sequence is a string containing only characters '(' and ')'.A regular bracket sequence is a bracket sequence that can be transformed into a correct arithmetic expression by inserting characters '1' and '+' between the original character... | [{"input": "5\r\n()))()\r\n", "output": ["5"]}, {"input": "3\r\n(()\r\n", "output": ["4"]}, {"input": "2\r\n(((\r\n", "output": ["0"]}, {"input": "100\r\n()(()))))(()((((()())()))(()))()()))(((()))))))))(\r\n", "output": ["979898526"]}, {"input": "100\r\n()(()(()((()(()(()()()(()((()))())())))()))())()()\r\n", "output"... | 100 | 100 | 100 | [{'input': '20\r\n()(()()())\r\n', 'output': ['296672330']}, {'input': '100\r\n()()()(((((()(()((((()((((((()()()((()()(()()()(((()()((()()((()()()))()()()))()))))())()())()()()())()()()())())())))())()())())))())()))))()()()()()\r\n', 'output': ['264738339']}, {'input': '100\r\n()(()())()(())))()())()(())((()(()()((()... | [{'input': '100\r\n(()))(()())()()((())(()((()()))(())()(((((()(((()()))())))))(())((((()()()()()))(()))(())(())(()))((\r\n', 'output': ['599470552']}, {'input': '20\r\n()(()()())\r\n', 'output': ['296672330']}, {'input': '1\r\n(((\r\n', 'output': ['0']}, {'input': '8\r\n(\r\n', 'output': ['1430']}, {'input': '100\r\n(... | [{'input': '18\r\n)\r\n', 'output': ['477638700']}, {'input': '2\r\n)\r\n', 'output': ['2']}, {'input': '20\r\n()(()()())\r\n', 'output': ['296672330']}, {'input': '14\r\n)\r\n', 'output': ['2674440']}, {'input': '15\r\n(\r\n', 'output': ['9694845']}] | [{'input': '100\r\n))\r\n', 'output': ['558488486']}, {'input': '100\r\n()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()()\r\n', 'output': ['1']}, {'input': '100\r\n()(()... | [{'input': '100\r\n()(()(()((()(()(()()()(()((()))())())))()))())()()\r\n', 'output': ['711757760']}, {'input': '32\r\n()((()()()())())\r\n', 'output': ['468509380']}, {'input': '100\r\n((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((... | 100 | 100 | 100 | 100 | 100 | 94.87 | 94.87 | 100 | 100 | 100 | 95.45 | 95.45 | 100 | 100 | 100 | 6 | 100 | 97.948 | 98.18 |
["8 1 1", "8 1 10"] | The only line contains three integers n, x and y (1ββ€βnββ€β107, 1ββ€βx,βyββ€β109) β the number of letters 'a' in the input file and the parameters from the problem statement. | 0f270af00be2a523515d5e7bd66800f6 | #include<stdio.h>
#include<stdlib.h>
int main()
{
unsigned long long n, x, y;
unsigned long nl, xl, yl;
fscanf(stdin, "%ld %ld %ld", &nl, &xl, &yl);
n = (unsigned long long)nl;
x = (unsigned long long)xl;
y = (unsigned long long)yl;
unsigned long long* f = malloc(10000001*sizeof(unsigned... | ["4", "8"] | C | null | Print the only integer t β the minimum amount of time needed to generate the input file. | zscoder wants to generate an input file for some programming competition problem.His input is a string consisting of n letters 'a'. He is too lazy to write a generator so he will manually generate the input in a text editor.Initially, the text editor is empty. It takes him x seconds to insert or delete a letter 'a' fro... | [{"input": "8 1 1\r\n", "output": ["4"]}, {"input": "8 1 10\r\n", "output": ["8"]}, {"input": "10 62 99\r\n", "output": ["384"]}, {"input": "88 417 591\r\n", "output": ["4623"]}, {"input": "57 5289 8444\r\n", "output": ["60221"]}, {"input": "382 81437847 324871127\r\n", "output": ["2519291691"]}, {"input": "244 5751543... | 100 | 100 | 100 | [{'input': '11478 29358 26962\r\n', 'output': ['556012']}, {'input': '57 5289 8444\r\n', 'output': ['60221']}, {'input': '382 81437847 324871127\r\n', 'output': ['2519291691']}, {'input': '10000000 1 100\r\n', 'output': ['1757']}, {'input': '10000000 998 998\r\n', 'output': ['30938']}] | [{'input': '9917781 1 1\r\n', 'output': ['35']}, {'input': '382 81437847 324871127\r\n', 'output': ['2519291691']}, {'input': '85 902510038 553915152\r\n', 'output': ['6933531064']}, {'input': '8 1 10\r\n', 'output': ['8']}, {'input': '10000000 1 1000000000\r\n', 'output': ['10000000']}] | [{'input': '7186329 608148870 290497442\r\n', 'output': ['12762929866']}, {'input': '4528217 187553422 956731625\r\n', 'output': ['21178755627']}, {'input': '9999999 1 2\r\n', 'output': ['54']}, {'input': '88 417 591\r\n', 'output': ['4623']}, {'input': '1926 84641582 820814219\r\n', 'output': ['7184606427']}] | [{'input': '483867 138842067 556741142\r\n', 'output': ['10712805143']}, {'input': '8 1 10\r\n', 'output': ['8']}, {'input': '10000000 1 1000\r\n', 'output': ['14224']}, {'input': '4314870 1000000000 1\r\n', 'output': ['7000000022']}, {'input': '9917781 1 1\r\n', 'output': ['35']}] | [{'input': '483867 138842067 556741142\r\n', 'output': ['10712805143']}, {'input': '10000000 1 10\r\n', 'output': ['214']}, {'input': '85 902510038 553915152\r\n', 'output': ['6933531064']}, {'input': '3768 561740421 232937477\r\n', 'output': ['5042211408']}, {'input': '10000000 1 1\r\n', 'output': ['31']}] | 100 | 100 | 100 | 100 | 100 | 86.67 | 86.67 | 86.67 | 100 | 100 | 75 | 81.25 | 75 | 100 | 93.75 | 7 | 100 | 92.002 | 85 |
["047", "16", "472747"] | The single line contains a non-empty string s whose length can range from 1 to 50, inclusive. The string only contains digits. The string can contain leading zeroes. | 639b8b8d0dc42df46b139f0aeb3a7a0a | #include <stdio.h>
# include <string.h>
int main()
{
char ch[100];
scanf("%s",&ch);
int i,c1=0,c2=0;
for(i=0;i<strlen(ch);i++)
{
if(ch[i]==4+48)
c1++;
else if(ch[i]==7+48)
c2++;
}
if(c1==0 && c2==0)
printf("-1\n");
else if(c1>... | ["4", "-1", "7"] | C | NoteThe lexicographical comparison of strings is performed by the < operator in the modern programming languages. String x is lexicographically less than string y either if x is a prefix of y, or exists such i (1ββ€βiββ€βmin(|x|,β|y|)), that xiβ<βyi and for any j (1ββ€βjβ<βi) xjβ=βyj. Here |a| denotes the length ... | In the only line print the answer to Petya's problem. If the sought string does not exist, print "-1" (without quotes). | Petya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.One day Petya was delivered a string s, containing only digits. He needs to find a string that represe... | [{"input": "047\r\n", "output": ["4"]}, {"input": "16\r\n", "output": ["-1"]}, {"input": "472747\r\n", "output": ["7"]}, {"input": "1925\r\n", "output": ["-1"]}, {"input": "5486846414848445484\r\n", "output": ["4"]}, {"input": "516160414\r\n", "output": ["4"]}, {"input": "9458569865994896\r\n", "output": ["4"]}, {"inpu... | 100 | 100 | 100 | [{'input': '74747474747474747474747474747474747474747474747474\r\n', 'output': ['4']}, {'input': '290732082244359495795943967215788554387079\r\n', 'output': ['7']}, {'input': '0000000000000000000000000000000000000047\r\n', 'output': ['4']}, {'input': '00000000000000000000000000000000000000000000000000\r\n', 'output': [... | [{'input': '40\r\n', 'output': ['4']}, {'input': '047\r\n', 'output': ['4']}, {'input': '637789221789855555993957058\r\n', 'output': ['7']}, {'input': '44\r\n', 'output': ['4']}, {'input': '0445460407410702955646485\r\n', 'output': ['4']}] | [{'input': '9589\r\n', 'output': ['-1']}, {'input': '74747474747474747474747474747474747474747474747474\r\n', 'output': ['4']}, {'input': '44101164480392494025995467\r\n', 'output': ['4']}, {'input': '0445460407410702955646485\r\n', 'output': ['4']}, {'input': '5486846414848445484\r\n', 'output': ['4']}] | [{'input': '0445460407410702955646485\r\n', 'output': ['4']}, {'input': '538772857\r\n', 'output': ['7']}, {'input': '472747\r\n', 'output': ['7']}, {'input': '11536708648794535307468278326553811\r\n', 'output': ['7']}, {'input': '637789221789855555993957058\r\n', 'output': ['7']}] | [{'input': '07\r\n', 'output': ['7']}, {'input': '538772857\r\n', 'output': ['7']}, {'input': '74\r\n', 'output': ['4']}, {'input': '637789221789855555993957058\r\n', 'output': ['7']}, {'input': '23607019991994\r\n', 'output': ['4']}] | 100 | 100 | 100 | 100 | 100 | 100 | 92.86 | 92.86 | 92.86 | 92.86 | 91.67 | 91.67 | 83.33 | 91.67 | 91.67 | 8 | 100 | 94.288 | 90.002 |
["2 2\nRU", "1 2\nRU", "-1 1000000000\nLRRLU", "0 0\nD"] | The first line contains two integers a and b, (β-β109ββ€βa,βbββ€β109). The second line contains a string s (1ββ€β|s|ββ€β100, s only contains characters 'U', 'D', 'L', 'R') β the command. | 5d6212e28c7942e9ff4d096938b782bf | #include <stdio.h>
#include <string.h>
int a,b,l;
int x,y,xl,yl;
char s[105];
int w[105][2];
int al,bl;
int p(int a1,int b1,int x1,int y1)
{
if ((a1<0&&x1>0)||(a1>0&&x1<0))return 0;
if ((b1<0&&y1>0)||(b1>0&&y1<0))return 0;
return 1;
}
int main()
{
int i,j;
scanf ("%d%d",&a,&b);
scanf ... | ["Yes", "No", "Yes", "Yes"] | C | NoteIn the first and second test case, command string is "RU", so the robot will go right, then go up, then right, and then up and so on.The locations of its moves are (0, 0) βββ (1, 0) βββ (1, 1) βββ (2, 1) βββ (2, 2) βββ ...So it can reach (2, 2) but not (1, 2). | Print "Yes" if the robot will be located at (a,βb), and "No" otherwise. | Fox Ciel has a robot on a 2D plane. Initially it is located in (0, 0). Fox Ciel code a command to it. The command was represented by string s. Each character of s is one move operation. There are four move operations at all: 'U': go up, (x, y) βββ (x, y+1); 'D': go down, (x, y) βββ (x, y-1); 'L': go left, (x, y) βββ... | [{"input": "2 2\r\nRU\r\n", "output": ["Yes"]}, {"input": "1 2\r\nRU\r\n", "output": ["No"]}, {"input": "-1 1000000000\r\nLRRLU\r\n", "output": ["Yes"]}, {"input": "0 0\r\nD\r\n", "output": ["Yes"]}, {"input": "0 0\r\nUURRDL\r\n", "output": ["Yes"]}, {"input": "987654321 987654321\r\nUURRDL\r\n", "output": ["Yes"]}, {"... | 100 | 100 | 100 | [{'input': '485940814 728911221\r\nURURU\r\n', 'output': ['Yes']}, {'input': '1000000000 1000000000\r\nUURRDL\r\n', 'output': ['Yes']}, {'input': '-261597957 418556728\r\nLLLDLUDUULLRDDULLRRUDRDLULRLRLLRRUUDRRLRUDLRRLUDRDLLUUDUULRURLDLULUUULDDUURLRUDURRL\r\n', 'output': ['Yes']}, {'input': '-1000000000 -1000000000\r\nD... | [{'input': '4 7\r\nUURRDL\r\n', 'output': ['No']}, {'input': '999999999 -999999999\r\nRRRRRRRRRRRRRRRRRRRRRRRRRDDDDDDDDDDDDDDDDDDDDDDDDDLLLLLLLLLLLLLLLLLLLLLLLUUUUUUUUUUUUUUUUUUUUUUU\r\n', 'output': ['Yes']}, {'input': '4 4\r\nUURRDL\r\n', 'output': ['Yes']}, {'input': '1 1\r\nURDLDL\r\n', 'output': ['Yes']}, {'input':... | [{'input': '0 1\r\nUDLR\r\n', 'output': ['Yes']}, {'input': '-261597957 418556728\r\nLLLDLUDUULLRDDULLRRUDRDLULRLRLLRRUUDRRLRUDLRRLUDRDLLUUDUULRURLDLULUUULDDUURLRUDURRL\r\n', 'output': ['Yes']}, {'input': '-2 -2\r\nUURR\r\n', 'output': ['No']}, {'input': '987654321 987654321\r\nUURRDL\r\n', 'output': ['Yes']}, {'input'... | [{'input': '-843450986 632588242\r\nLURLULULRUDUDULRDDLUL\r\n', 'output': ['Yes']}, {'input': '-100 -100\r\nRU\r\n', 'output': ['No']}, {'input': '4 6\r\nUURRDL\r\n', 'output': ['Yes']}, {'input': '3 3\r\nUURR\r\n', 'output': ['No']}, {'input': '-2 -2\r\nUURR\r\n', 'output': ['No']}] | [{'input': '999999999 0\r\nRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\r\n', 'output': ['Yes']}, {'input': '-1 0\r\nR\r\n', 'output': ['No']}, {'input': '100 100\r\nRUL\r\n', 'output': ['No']}, {'input': '-1 1000000000\r\nLRRLU\r\n', 'output': ['Yes']}, {'input':... | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 59.09 | 62.12 | 71.21 | 57.58 | 80.3 | 9 | 100 | 100 | 66.06 |
["5 3\n0 4 5 6 7", "1 0\n0", "5 0\n1 2 3 4 5"] | The first line contains two integers n and x (1ββ€βnββ€β100, 0ββ€βxββ€β100)Β β the size of the set Dr. Evil owns, and the desired MEX. The second line contains n distinct non-negative integers not exceeding 100 that represent the set. | 21f579ba807face432a7664091581cd8 | #include <stdio.h>
int main(){
int n,x,i,t;
scanf("%d %d", &n,&x);
int ans = x;
for(i = 0; i < n; i++){
scanf("%d", &t);
if(t < x) ans--;
else if(t==x)ans++;
}
printf("%d\n", ans);
return 0;
} | ["2", "1", "0"] | C | NoteFor the first test case Dr. Evil should add 1 and 2 to the set performing 2 operations.For the second test case Dr. Evil should erase 0 from the set. After that, the set becomes empty, so the MEX of it is 0.In the third test case the set is already evil. | The only line should contain one integerΒ β the minimal number of operations Dr. Evil should perform. | Dr. Evil kidnapped Mahmoud and Ehab in the evil land because of their performance in the Evil Olympiad in Informatics (EOI). He decided to give them some problems to let them go.Dr. Evil is interested in sets, He has a set of n integers. Dr. Evil calls a set of integers evil if the MEX of it is exactly x. the MEX of a ... | [{"input": "5 3\r\n0 4 5 6 7\r\n", "output": ["2"]}, {"input": "1 0\r\n0\r\n", "output": ["1"]}, {"input": "5 0\r\n1 2 3 4 5\r\n", "output": ["0"]}, {"input": "10 5\r\n57 1 47 9 93 37 76 70 78 15\r\n", "output": ["4"]}, {"input": "10 5\r\n99 98 93 97 95 100 92 94 91 96\r\n", "output": ["5"]}, {"input": "10 5\r\n1 2 3 4... | 100 | 100 | 100 | [{'input': '5 5\r\n1 2 3 4 5\r\n', 'output': ['2']}, {'input': '77 0\r\n38 76 24 74 42 88 29 75 96 46 90 32 59 97 98 60 41 57 80 37 100 49 25 63 95 31 61 68 53 78 27 66 84 48 94 83 30 26 36 99 71 62 45 47 70 28 35 54 34 85 79 43 91 72 86 33 67 92 77 65 69 52 82 55 87 64 56 40 50 44 51 73 89 81 58 93 39\r\n', 'output': ... | [{'input': '100 100\r\n79 13 21 11 3 87 28 40 29 4 96 34 8 78 61 46 33 45 99 30 92 67 22 97 39 86 73 31 74 44 62 55 57 2 54 63 80 69 25 48 77 98 17 93 15 16 89 12 43 23 37 95 14 38 83 90 49 56 72 10 20 0 50 71 70 88 19 1 76 81 52 41 82 68 85 47 6 7 35 60 18 64 75 84 27 9 65 91 94 42 53 24 66 26 59 36 51 32 5 58\r\n', '... | [{'input': '5 2\r\n1 2 3 4 5\r\n', 'output': ['2']}, {'input': '77 0\r\n51 5 81 62 30 22 11 0 83 16 79 85 52 70 69 10 8 47 58 3 24 34 44 14 82 66 99 17 28 31 64 67 23 49 94 45 4 12 27 15 21 6 43 72 87 2 63 92 35 39 59 9 90 78 93 20 65 36 60 89 50 41 61 84 77 86 76 100 38 68 53 97 96 95 7 19 88\r\n', 'output': ['1']}, {... | [{'input': '100 100\r\n58 88 12 71 22 1 40 19 73 20 67 48 57 17 69 36 100 35 33 37 72 55 52 8 89 85 47 42 78 70 81 86 11 9 68 99 6 16 21 61 53 98 23 62 32 59 51 0 87 24 50 30 65 10 80 95 7 92 25 74 60 79 91 5 13 31 75 38 90 94 46 66 93 34 14 41 28 2 76 84 43 96 3 56 49 82 27 77 64 63 4 45 18 29 54 39 15 26 83 44\r\n', ... | [{'input': '77 0\r\n12 75 31 71 44 8 3 82 21 77 50 29 57 74 40 10 15 42 84 2 100 9 28 72 92 0 49 11 90 55 17 36 19 54 68 52 4 69 97 91 5 39 59 45 89 62 53 83 16 94 76 60 95 47 30 51 7 48 20 70 67 32 58 78 63 34 56 93 99 88 24 1 66 22 25 14 13\r\n', 'output': ['1']}, {'input': '100 70\r\n91 82 8 85 26 25 95 97 40 87 81 ... | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 10 | 100 | 100 | 100 |
["1\n2\n1\n1\n10", "1\n2\n1\n1\n8"] | The input data contains integers vp,βvd,βt,βf and c, one per line (1ββ€βvp,βvdββ€β100, 1ββ€βt,βfββ€β10, 1ββ€βcββ€β1000). | c9c03666278acec35f0e273691fe0fff | #include<stdio.h>
int main(){
float vp,vd,t,f,c;
float phm,d=0,time=0;
int bijous=0;
scanf("%f%f%f%f%f",&vp,&vd,&t,&f,&c);
for(phm=t*vp;;){
//printf("%f\n",phm);
if(vd<=vp)
break;
phm+=phm*vp/(vd-vp);
if(phm>=c)
break;
else{
phm+=f*vp+(phm/vd)*vp;
bijous++;
}
... | ["2", "1"] | C | NoteIn the first case one hour after the escape the dragon will discover it, and the princess will be 1 mile away from the cave. In two hours the dragon will overtake the princess 2 miles away from the cave, and she will need to drop the first bijou. Return to the cave and fixing the treasury will take the dragon two m... | Output the minimal number of bijous required for the escape to succeed. | The princess is going to escape the dragon's cave, and she needs to plan it carefully.The princess runs at vp miles per hour, and the dragon flies at vd miles per hour. The dragon will discover the escape after t hours and will chase the princess immediately. Looks like there's no chance to success, but the princess no... | [{"input": "1\r\n2\r\n1\r\n1\r\n10\r\n", "output": ["2"]}, {"input": "1\r\n2\r\n1\r\n1\r\n8\r\n", "output": ["1"]}, {"input": "5\r\n8\r\n1\r\n2\r\n100\r\n", "output": ["2"]}, {"input": "2\r\n100\r\n10\r\n10\r\n739\r\n", "output": ["22"]}, {"input": "17\r\n99\r\n2\r\n3\r\n293\r\n", "output": ["3"]}, {"input": "5\r\n5\r\... | 100 | 100 | 100 | [{'input': '30\r\n28\r\n4\r\n6\r\n9\r\n', 'output': ['0']}, {'input': '5\r\n8\r\n1\r\n2\r\n100\r\n', 'output': ['2']}, {'input': '49\r\n7\r\n2\r\n5\r\n326\r\n', 'output': ['0']}, {'input': '2\r\n100\r\n10\r\n10\r\n739\r\n', 'output': ['22']}, {'input': '87\r\n32\r\n3\r\n8\r\n754\r\n', 'output': ['0']}] | [{'input': '50\r\n15\r\n1\r\n3\r\n216\r\n', 'output': ['0']}, {'input': '13\r\n14\r\n3\r\n3\r\n79\r\n', 'output': ['0']}, {'input': '85\r\n45\r\n2\r\n1\r\n682\r\n', 'output': ['0']}, {'input': '35\r\n37\r\n9\r\n5\r\n792\r\n', 'output': ['0']}, {'input': '2\r\n1\r\n1\r\n1\r\n1000\r\n', 'output': ['0']}] | [{'input': '2\r\n1\r\n1\r\n1\r\n1000\r\n', 'output': ['0']}, {'input': '2\r\n1\r\n1\r\n1\r\n100\r\n', 'output': ['0']}, {'input': '13\r\n14\r\n3\r\n3\r\n79\r\n', 'output': ['0']}, {'input': '63\r\n4\r\n7\r\n1\r\n48\r\n', 'output': ['0']}, {'input': '2\r\n12\r\n6\r\n4\r\n907\r\n', 'output': ['10']}] | [{'input': '93\r\n19\r\n3\r\n3\r\n82\r\n', 'output': ['0']}, {'input': '1\r\n2\r\n1\r\n1\r\n8\r\n', 'output': ['1']}, {'input': '31\r\n40\r\n6\r\n1\r\n397\r\n', 'output': ['0']}, {'input': '51\r\n42\r\n10\r\n4\r\n901\r\n', 'output': ['0']}, {'input': '50\r\n15\r\n1\r\n3\r\n216\r\n', 'output': ['0']}] | [{'input': '38\r\n50\r\n1\r\n8\r\n761\r\n', 'output': ['1']}, {'input': '67\r\n34\r\n7\r\n4\r\n954\r\n', 'output': ['0']}, {'input': '79\r\n11\r\n2\r\n1\r\n144\r\n', 'output': ['0']}, {'input': '1\r\n100\r\n1\r\n1\r\n1000\r\n', 'output': ['152']}, {'input': '79\r\n10\r\n4\r\n6\r\n3\r\n', 'output': ['0']}] | 100 | 100 | 100 | 100 | 100 | 100 | 85.71 | 100 | 100 | 100 | 100 | 75 | 100 | 100 | 100 | 11 | 100 | 97.142 | 95 |
["3 2 8", "1 2 -18", "2 2 -1"] | The first line contains three space-separated integers: a,βb,βc (1ββ€βaββ€β5;Β 1ββ€βbββ€β10000;Β β-β10000ββ€βcββ€β10000). | e477185b94f93006d7ae84c8f0817009 | #include <stdio.h>
#include <math.h>
int chk(long long x)
{
int ret = 0;
while(x)
{
ret += (x%10);
x/=10;
}
return ret;
}
long long po(long long int a,long long x)
{
if(x == 0)
return 1;
long long temp;
temp = po(a,x/2);
temp *= temp;
if(x%2)
temp *= a;
return temp;
}
int main()
{
long long int a... | ["3\n10 2008 13726", "0", "4\n1 31 337 967"] | C | null | Print integer n β the number of the solutions that you've found. Next print n integers in the increasing order β the solutions of the given equation. Print only integer solutions that are larger than zero and strictly less than 109. | Little Dima misbehaved during a math lesson a lot and the nasty teacher Mr. Pickles gave him the following problem as a punishment. Find all integer solutions x (0β<βxβ<β109) of the equation:xβ=βbΒ·s(x)aβ+βc,β where a, b, c are some predetermined constant values and function s(x) determines the sum of all digits i... | [{"input": "3 2 8\r\n", "output": ["3\r\n10 2008 13726"]}, {"input": "1 2 -18\r\n", "output": ["0"]}, {"input": "2 2 -1\r\n", "output": ["4\r\n1 31 337 967"]}, {"input": "1 1 0\r\n", "output": ["9\r\n1 2 3 4 5 6 7 8 9"]}, {"input": "1 37 963\r\n", "output": ["16\r\n1000 1111 1222 1333 1370 1407 1444 1481 1518 1555 1592... | 100 | 100 | 100 | [{'input': '1 1 -6708\r\n', 'output': ['0']}, {'input': '5 7698 5337\r\n', 'output': ['0']}, {'input': '2 28 12\r\n', 'output': ['2\r\n4044 7180']}, {'input': '1 1 0\r\n', 'output': ['9\r\n1 2 3 4 5 6 7 8 9']}, {'input': '3 1727 4771\r\n', 'output': ['1\r\n42124574']}] | [{'input': '4 1870 9912\r\n', 'output': ['0']}, {'input': '2 6828 -39\r\n', 'output': ['2\r\n7435653 17759589']}, {'input': '5 65 352\r\n', 'output': ['1\r\n208000352']}, {'input': '2 28 12\r\n', 'output': ['2\r\n4044 7180']}, {'input': '5 7698 5337\r\n', 'output': ['0']}] | [{'input': '3 1727 4771\r\n', 'output': ['1\r\n42124574']}, {'input': '5 3903 -9847\r\n', 'output': ['0']}, {'input': '1 37 963\r\n', 'output': ['16\r\n1000 1111 1222 1333 1370 1407 1444 1481 1518 1555 1592 1629 1666 1777 1888 1999']}, {'input': '5 5 -865\r\n', 'output': ['0']}, {'input': '2 8468 -3666\r\n', 'output': ... | [{'input': '5 36 -46\r\n', 'output': ['0']}, {'input': '4 1870 9912\r\n', 'output': ['0']}, {'input': '5 10000 10000\r\n', 'output': ['0']}, {'input': '4 9359 -3039\r\n', 'output': ['0']}, {'input': '5 5 13\r\n', 'output': ['1\r\n579281018']}] | [{'input': '3 1139 6335\r\n', 'output': ['2\r\n12134407 499999999']}, {'input': '2 6828 -39\r\n', 'output': ['2\r\n7435653 17759589']}, {'input': '5 5 -865\r\n', 'output': ['0']}, {'input': '1 2 -18\r\n', 'output': ['0']}, {'input': '3 1727 4771\r\n', 'output': ['1\r\n42124574']}] | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 93.75 | 100 | 100 | 100 | 12 | 100 | 100 | 98.75 |
["1 6 1 2 1 6", "6 5 4 3 2 1", "10 10 1 1 10 10"] | The first line contains six integers n, m, x1, y1, x2, y2 β the board sizes and the coordinates of the first and second chips, correspondingly (1ββ€βn,βmββ€β100; 2ββ€βnβΓβm; 1ββ€βx1,βx2ββ€βn; 1ββ€βy1,βy2ββ€βm). The numbers in the line are separated by single spaces. It is guaranteed that the chips are located in different squ... | 41f6f90b7307d2383495441114fa8ea2 | #include <stdio.h>
#include <stdlib.h>
int main()
{
int i, j, n, m, x1, y1, x2, y2;
scanf("%d %d %d %d %d %d", &n, &m, &x1, &y1, &x2, &y2);
i = abs(x1 - x2);
j = abs(y1 - y2);
if (i > j) {
int aux = i;
i = j;
j = aux;
}
if ((i <= 2 && j <= 4) || (i == 3 && j == 3... | ["First", "First", "Second"] | C | null | If the first player wins, print "First" without the quotes. Otherwise, print "Second" without the quotes. | Two players play a game. The game is played on a rectangular board with nβΓβm squares. At the beginning of the game two different squares of the board have two chips. The first player's goal is to shift the chips to the same square. The second player aims to stop the first one with a tube of superglue.We'll describe th... | [{"input": "1 6 1 2 1 6\r\n", "output": ["First"]}, {"input": "6 5 4 3 2 1\r\n", "output": ["First"]}, {"input": "10 10 1 1 10 10\r\n", "output": ["Second"]}, {"input": "1 2 1 1 1 2\r\n", "output": ["First"]}, {"input": "4 4 1 4 4 1\r\n", "output": ["First"]}, {"input": "25 32 17 18 20 19\r\n", "output": ["First"]}, {"... | 100 | 100 | 100 | [{'input': '10 10 1 1 10 10\r\n', 'output': ['Second']}, {'input': '13 62 10 13 5 15\r\n', 'output': ['Second']}, {'input': '48 53 24 37 21 42\r\n', 'output': ['Second']}, {'input': '64 91 52 64 49 67\r\n', 'output': ['First']}, {'input': '25 68 3 39 20 41\r\n', 'output': ['Second']}] | [{'input': '1 2 1 1 1 2\r\n', 'output': ['First']}, {'input': '60 100 28 80 26 85\r\n', 'output': ['Second']}, {'input': '89 100 54 1 55 100\r\n', 'output': ['Second']}, {'input': '73 27 40 8 45 13\r\n', 'output': ['Second']}, {'input': '3 5 1 1 3 5\r\n', 'output': ['First']}] | [{'input': '50 50 1 1 5 4\r\n', 'output': ['Second']}, {'input': '16 97 7 4 15 94\r\n', 'output': ['Second']}, {'input': '10 10 1 1 1 6\r\n', 'output': ['Second']}, {'input': '63 22 54 16 58 19\r\n', 'output': ['Second']}, {'input': '48 53 24 37 21 42\r\n', 'output': ['Second']}] | [{'input': '5 5 1 1 4 5\r\n', 'output': ['Second']}, {'input': '47 91 36 61 32 63\r\n', 'output': ['First']}, {'input': '95 28 50 12 50 13\r\n', 'output': ['First']}, {'input': '10 10 1 1 6 2\r\n', 'output': ['Second']}, {'input': '100 100 1 1 3 5\r\n', 'output': ['First']}] | [{'input': '7 41 3 5 3 6\r\n', 'output': ['First']}, {'input': '61 39 14 30 14 37\r\n', 'output': ['Second']}, {'input': '47 95 27 70 23 70\r\n', 'output': ['First']}, {'input': '4 4 1 4 4 1\r\n', 'output': ['First']}, {'input': '100 100 1 1 3 5\r\n', 'output': ['First']}] | 100 | 100 | 100 | 100 | 100 | 100 | 75 | 91.67 | 100 | 100 | 90 | 60 | 80 | 90 | 90 | 13 | 100 | 93.334 | 82 |
["2 3", "8 2"] | The first line of the input contains two integers, given in the decimal notation, n and m (1ββ€βn,βmββ€β109)Β β the number of hours in one day and the number of minutes in one hour, respectively. | 0930c75f57dd88a858ba7bb0f11f1b1c | #include <stdlib.h>
#include <stdio.h>
int main() {
int n, m, d;
scanf("%d%d", &n, &m);
int dn = 1, dm = 1;
for(int k = 7 ; k < n ; k *= 7) dn++;
for(int k = 7 ; k < m ; k *= 7) dm++;
d = dn + dm;
if(d > 7) {
printf("0\n");
return 0;
}
int r = 0;
for(int i=0 ; i<n ; i++) {
for(int j=0 ; j<m ; j++) {
... | ["4", "5"] | C | NoteIn the first sample, possible pairs are: (0:β1), (0:β2), (1:β0), (1:β2).In the second sample, possible pairs are: (02:β1), (03:β1), (04:β1), (05:β1), (06:β1). | Print one integer in decimal notationΒ β the number of different pairs of hour and minute, such that all digits displayed on the watches are distinct. | Robbers, who attacked the Gerda's cab, are very successful in covering from the kingdom police. To make the goal of catching them even harder, they use their own watches.First, as they know that kingdom police is bad at math, robbers use the positional numeral system with base 7. Second, they divide one day in n hours,... | [{"input": "2 3\r\n", "output": ["4"]}, {"input": "8 2\r\n", "output": ["5"]}, {"input": "1 1\r\n", "output": ["0"]}, {"input": "1 2\r\n", "output": ["1"]}, {"input": "8 8\r\n", "output": ["0"]}, {"input": "50 50\r\n", "output": ["0"]}, {"input": "344 344\r\n", "output": ["0"]}, {"input": "282475250 282475250\r\n", "ou... | 100 | 100 | 100 | [{'input': '2402 50\r\n', 'output': ['0']}, {'input': '3 16808\r\n', 'output': ['240']}, {'input': '50 7\r\n', 'output': ['120']}, {'input': '16808 41\r\n', 'output': ['0']}, {'input': '8 282475250\r\n', 'output': ['0']}] | [{'input': '8 8\r\n', 'output': ['0']}, {'input': '50 7\r\n', 'output': ['120']}, {'input': '2402 49\r\n', 'output': ['720']}, {'input': '1 1\r\n', 'output': ['0']}, {'input': '2 3\r\n', 'output': ['4']}] | [{'input': '3 823544\r\n', 'output': ['0']}, {'input': '282475250 282475250\r\n', 'output': ['0']}, {'input': '8 8\r\n', 'output': ['0']}, {'input': '2402 343\r\n', 'output': ['0']}, {'input': '1 2\r\n', 'output': ['1']}] | [{'input': '8 2\r\n', 'output': ['5']}, {'input': '8 8\r\n', 'output': ['0']}, {'input': '2402 49\r\n', 'output': ['720']}, {'input': '117650 5\r\n', 'output': ['0']}, {'input': '343 2401\r\n', 'output': ['5040']}] | [{'input': '7 117649\r\n', 'output': ['5040']}, {'input': '282475250 8\r\n', 'output': ['0']}, {'input': '343 2401\r\n', 'output': ['5040']}, {'input': '50 7\r\n', 'output': ['120']}, {'input': '344 344\r\n', 'output': ['0']}] | 100 | 100 | 100 | 100 | 100 | 100 | 92.59 | 100 | 100 | 100 | 100 | 94.44 | 100 | 100 | 100 | 14 | 100 | 98.518 | 98.888 |
["500 1000 20 30", "1000 1000 1 1", "1500 1000 176 177"] | The first line contains four integers a, b, c, d (250ββ€βa,βbββ€β3500, 0ββ€βc,βdββ€β180). It is guaranteed that numbers a and b are divisible by 250 (just like on any real Codeforces round). | 95b19d7569d6b70bd97d46a8541060d0 | #include <stdio.h>
int max(int a, int b){
int maxim;
return maxim=(a>=b)?a:b;
}
int main(void)
{
int a,b,c,d, misha, vasya;
scanf("%d %d %d %d", &a,&b,&c,&d);
misha = max((3*a)/10 ,a- ((a*c)/250));
vasya = max((3*b)/10 ,b-((b*d)/250));
if(misha>vasya) printf("Misha");
else if(misha<vasy... | ["Vasya", "Tie", "Misha"] | C | null | Output on a single line: "Misha" (without the quotes), if Misha got more points than Vasya. "Vasya" (without the quotes), if Vasya got more points than Misha. "Tie" (without the quotes), if both of them got the same number of points. | Misha and Vasya participated in a Codeforces contest. Unfortunately, each of them solved only one problem, though successfully submitted it at the first attempt. Misha solved the problem that costs a points and Vasya solved the problem that costs b points. Besides, Misha submitted the problem c minutes after the contes... | [{"input": "500 1000 20 30\r\n", "output": ["Vasya"]}, {"input": "1000 1000 1 1\r\n", "output": ["Tie"]}, {"input": "1500 1000 176 177\r\n", "output": ["Misha"]}, {"input": "1500 1000 74 177\r\n", "output": ["Misha"]}, {"input": "750 2500 175 178\r\n", "output": ["Vasya"]}, {"input": "750 1000 54 103\r\n", "output": ["... | 100 | 100 | 100 | [{'input': '500 500 170 176\r\n', 'output': ['Misha']}, {'input': '1250 2000 101 180\r\n', 'output': ['Misha']}, {'input': '750 2500 175 178\r\n', 'output': ['Vasya']}, {'input': '1000 1000 1 1\r\n', 'output': ['Tie']}, {'input': '750 1000 54 103\r\n', 'output': ['Tie']}] | [{'input': '1750 500 166 177\r\n', 'output': ['Misha']}, {'input': '1000 500 7 162\r\n', 'output': ['Misha']}, {'input': '2750 1750 134 147\r\n', 'output': ['Misha']}, {'input': '1500 1250 180 160\r\n', 'output': ['Tie']}, {'input': '2000 1250 176 130\r\n', 'output': ['Tie']}] | [{'input': '250 3500 0 0\r\n', 'output': ['Vasya']}, {'input': '2750 1750 134 147\r\n', 'output': ['Misha']}, {'input': '500 1500 179 71\r\n', 'output': ['Vasya']}, {'input': '1250 2000 101 180\r\n', 'output': ['Misha']}, {'input': '1750 1250 179 180\r\n', 'output': ['Misha']}] | [{'input': '1000 1000 1 1\r\n', 'output': ['Tie']}, {'input': '750 1000 54 103\r\n', 'output': ['Tie']}, {'input': '3000 3000 176 78\r\n', 'output': ['Vasya']}, {'input': '500 1500 179 71\r\n', 'output': ['Vasya']}, {'input': '2000 2000 176 179\r\n', 'output': ['Tie']}] | [{'input': '500 1000 20 30\r\n', 'output': ['Vasya']}, {'input': '250 3500 0 180\r\n', 'output': ['Vasya']}, {'input': '250 250 0 0\r\n', 'output': ['Tie']}, {'input': '1000 3500 178 175\r\n', 'output': ['Vasya']}, {'input': '2750 1750 134 147\r\n', 'output': ['Misha']}] | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 90 | 100 | 100 | 100 | 75 | 75 | 75 | 100 | 15 | 100 | 98 | 85 |
["4 2 4\n3 4\n1 1", "5 4 0\n1 2\n3 1"] | The first line contains three integers s, x1 and x2 (2ββ€βsββ€β1000, 0ββ€βx1,βx2ββ€βs, x1ββ βx2)Β β the maximum coordinate of the point to which the tram goes, the point Igor is at, and the point he should come to. The second line contains two integers t1 and t2 (1ββ€βt1,βt2ββ€β1000)Β β the time in seconds in which the tram pas... | fb3aca6eba3a952e9d5736c5d8566821 | #include<stdio.h>
int t,T1,T2,s,f,x1,x2,p,d,t1,t2,i;///T2 οΏ½οΏ½ T1 οΏ½οΏ½
int main()
{
scanf("%d %d %d %d %d %d %d",&s,&x1,&x2,&t1,&t2,&p,&d);
if(x2-x1>0) f=1;
else f=-1;
T2=(x2-x1)*t2*f;
if(t1<t2){
if((x1<x2&&x2<=p&&d<0)||(x1<=p&&p<=x2&&d<0)||(p<=x1&&x1<x2)||(x1<=p&&x1>x2&&d<0)){
... | ["8", "7"] | C | NoteIn the first example it is profitable for Igor to go by foot and not to wait the tram. Thus, he has to pass 2 meters and it takes 8 seconds in total, because he passes 1 meter per 4 seconds. In the second example Igor can, for example, go towards the point x2 and get to the point 1 in 6 seconds (because he has to p... | Print the minimum time in seconds which Igor needs to get from the point x1 to the point x2. | The tram in Berland goes along a straight line from the point 0 to the point s and back, passing 1 meter per t1 seconds in both directions. It means that the tram is always in the state of uniform rectilinear motion, instantly turning around at points xβ=β0 and xβ=βs.Igor is at the point x1. He should reach the point x... | [{"input": "4 2 4\r\n3 4\r\n1 1\r\n", "output": ["8"]}, {"input": "5 4 0\r\n1 2\r\n3 1\r\n", "output": ["7"]}, {"input": "5 4 0\r\n5 14\r\n1 -1\r\n", "output": ["55"]}, {"input": "10 7 2\r\n7 9\r\n9 -1\r\n", "output": ["45"]}, {"input": "20 5 19\r\n163 174\r\n4 1\r\n", "output": ["2436"]}, {"input": "1000 610 733\r\n22... | 100 | 100 | 100 | [{'input': '10 3 6\r\n1 2\r\n3 1\r\n', 'output': ['3']}, {'input': '100 9 6\r\n3 100\r\n5 1\r\n', 'output': ['300']}, {'input': '1000 876 884\r\n299 1000\r\n825 1\r\n', 'output': ['8000']}, {'input': '10 7 2\r\n7 9\r\n9 -1\r\n', 'output': ['45']}, {'input': '1000 812 761\r\n230 1000\r\n696 -1\r\n', 'output': ['51000']}... | [{'input': '10 0 5\r\n1 100\r\n7 1\r\n', 'output': ['18']}, {'input': '5 3 0\r\n1 2\r\n4 -1\r\n', 'output': ['4']}, {'input': '200 10 100\r\n1 100\r\n20 1\r\n', 'output': ['480']}, {'input': '20 15 10\r\n5 2\r\n3 1\r\n', 'output': ['10']}, {'input': '500 397 440\r\n202 1000\r\n75 1\r\n', 'output': ['43000']}] | [{'input': '5 4 0\r\n5 14\r\n1 -1\r\n', 'output': ['55']}, {'input': '2 2 0\r\n7 3\r\n1 1\r\n', 'output': ['6']}, {'input': '3 1 3\r\n1 2\r\n1 1\r\n', 'output': ['2']}, {'input': '500 397 440\r\n202 1000\r\n75 1\r\n', 'output': ['43000']}, {'input': '999 951 297\r\n62 106\r\n574 1\r\n', 'output': ['69324']}] | [{'input': '999 951 297\r\n62 106\r\n574 1\r\n', 'output': ['69324']}, {'input': '40 31 14\r\n628 1000\r\n36 1\r\n', 'output': ['17000']}, {'input': '600 443 587\r\n260 1000\r\n548 -1\r\n', 'output': ['144000']}, {'input': '100 20 83\r\n186 434\r\n64 -1\r\n', 'output': ['27342']}, {'input': '200 10 100\r\n1 100\r\n20 1... | [{'input': '5 4 0\r\n5 14\r\n1 -1\r\n', 'output': ['55']}, {'input': '10 1 9\r\n1 10\r\n1 1\r\n', 'output': ['8']}, {'input': '1000 711 437\r\n42 126\r\n745 1\r\n', 'output': ['34356']}, {'input': '5 3 0\r\n1 2\r\n4 -1\r\n', 'output': ['4']}, {'input': '100 9 6\r\n3 100\r\n5 1\r\n', 'output': ['300']}] | 100 | 100 | 100 | 100 | 100 | 83.33 | 100 | 100 | 83.33 | 88.89 | 56 | 74 | 56 | 60 | 78 | 16 | 100 | 91.11 | 64.8 |
["4\n1 3\n2 3\n1 4\n5 3", "5\n1 2\n2 3\n3 4\n4 5\n5 1"] | The first line contains an integer m (0ββ€βmββ€β10), which is the number of relations of acquaintances among the five friends of Igor's. Each of the following m lines contains two integers ai and bi (1ββ€βai,βbiββ€β5;aiββ βbi), where (ai,βbi) is a pair of acquainted people. It is guaranteed that each pair of the acquaintanc... | 2bc18799c85ecaba87564a86a94e0322 | #include<stdio.h>
int main()
{
int i,j,k,a[100][100],n,x,y,flag=0;
scanf("%d",&n);
for(i=0;i<=5;i++)
for(j=0;j<=5;j++)
a[i][j]=0;
for(i=0;i<n;i++)
{
scanf("%d%d",&x,&y);
a[x][y]=1;
a[y][x]=1;
}
for(i=1;i<=5;i++)
for(j=i+1;j<=5;j++)
for(k=j+1;k<=5;k++)
{
if(a[i][j]==1 && a[i][k]=... | ["WIN", "FAIL"] | C | null | Print "FAIL", if among those five people there are no either three pairwise acquainted or three pairwise unacquainted people. Otherwise print "WIN". | One day Igor K. stopped programming and took up math. One late autumn evening he was sitting at a table reading a book and thinking about something. The following statement caught his attention: "Among any six people there are either three pairwise acquainted people or three pairwise unacquainted people"Igor just could... | [{"input": "4\r\n1 3\r\n2 3\r\n1 4\r\n5 3\r\n", "output": ["WIN"]}, {"input": "5\r\n1 2\r\n2 3\r\n3 4\r\n4 5\r\n5 1\r\n", "output": ["FAIL"]}, {"input": "1\r\n4 3\r\n", "output": ["WIN"]}, {"input": "6\r\n1 3\r\n2 3\r\n1 2\r\n5 3\r\n4 2\r\n4 5\r\n", "output": ["WIN"]}, {"input": "2\r\n1 3\r\n2 5\r\n", "output": ["WIN"]... | 100 | 100 | 100 | [{'input': '7\r\n2 3\r\n2 1\r\n4 5\r\n5 2\r\n3 4\r\n3 1\r\n4 1\r\n', 'output': ['WIN']}, {'input': '4\r\n1 2\r\n5 2\r\n3 5\r\n1 5\r\n', 'output': ['WIN']}, {'input': '9\r\n3 2\r\n5 1\r\n5 2\r\n2 1\r\n1 4\r\n1 3\r\n2 4\r\n5 3\r\n5 4\r\n', 'output': ['WIN']}, {'input': '4\r\n4 2\r\n2 5\r\n1 4\r\n4 5\r\n', 'output': ['WIN... | [{'input': '5\r\n1 2\r\n2 5\r\n5 4\r\n4 3\r\n3 1\r\n', 'output': ['FAIL']}, {'input': '1\r\n4 3\r\n', 'output': ['WIN']}, {'input': '5\r\n1 2\r\n2 5\r\n4 2\r\n4 3\r\n3 1\r\n', 'output': ['WIN']}, {'input': '3\r\n5 1\r\n5 3\r\n2 5\r\n', 'output': ['WIN']}, {'input': '6\r\n4 3\r\n5 3\r\n4 1\r\n1 3\r\n1 2\r\n2 4\r\n', 'ou... | [{'input': '9\r\n2 4\r\n3 2\r\n2 5\r\n4 5\r\n3 5\r\n1 3\r\n5 1\r\n1 2\r\n4 3\r\n', 'output': ['WIN']}, {'input': '7\r\n3 1\r\n4 5\r\n3 5\r\n5 1\r\n2 4\r\n1 2\r\n1 4\r\n', 'output': ['WIN']}, {'input': '8\r\n1 5\r\n3 1\r\n2 5\r\n4 2\r\n2 1\r\n4 5\r\n4 3\r\n4 1\r\n', 'output': ['WIN']}, {'input': '5\r\n3 5\r\n4 2\r\n1 3\... | [{'input': '5\r\n3 5\r\n4 2\r\n1 4\r\n3 4\r\n5 2\r\n', 'output': ['WIN']}, {'input': '6\r\n5 1\r\n5 4\r\n3 4\r\n1 3\r\n1 4\r\n4 2\r\n', 'output': ['WIN']}, {'input': '3\r\n5 1\r\n3 1\r\n1 2\r\n', 'output': ['WIN']}, {'input': '4\r\n5 4\r\n2 3\r\n1 5\r\n5 2\r\n', 'output': ['WIN']}, {'input': '4\r\n5 2\r\n2 4\r\n5 3\r\n... | [{'input': '5\r\n1 4\r\n4 2\r\n2 5\r\n3 1\r\n5 3\r\n', 'output': ['FAIL']}, {'input': '6\r\n3 1\r\n1 4\r\n5 4\r\n2 1\r\n4 2\r\n1 5\r\n', 'output': ['WIN']}, {'input': '5\r\n3 5\r\n1 4\r\n5 1\r\n2 3\r\n4 2\r\n', 'output': ['FAIL']}, {'input': '5\r\n2 3\r\n1 4\r\n3 5\r\n1 5\r\n5 4\r\n', 'output': ['WIN']}, {'input': '5\r... | 100 | 100 | 100 | 100 | 100 | 94.44 | 100 | 100 | 94.44 | 100 | 96.15 | 100 | 100 | 96.15 | 100 | 17 | 100 | 97.776 | 98.46 |
["100\n15 20 20 15 10 30 45", "2\n1 0 0 0 0 0 0"] | The first input line contains the single integer n (1ββ€βnββ€β1000) β the number of pages in the book. The second line contains seven non-negative space-separated integers that do not exceed 1000 β those integers represent how many pages Petr can read on Monday, Tuesday, Wednesday, Thursday, Friday, Saturday and Sunday c... | 007a779d966e2e9219789d6d9da7002c | #include<stdio.h>
int main()
{
int i,j,t,a,b,page, sum =0;
int day[8];
scanf ("%d",&page);
for(i=1; i<8; i++){
scanf("%d", &day[i]);
}
j = 0;
while(1){
j++;
sum = sum + day[j];
if(sum >= page){
printf("%d\n", j);
break;
}
... | ["6", "1"] | C | NoteNote to the first sample:By the end of Monday and therefore, by the beginning of Tuesday Petr has 85 pages left. He has 65 pages left by Wednesday, 45 by Thursday, 30 by Friday, 20 by Saturday and on Saturday Petr finishes reading the book (and he also has time to read 10 pages of something else).Note to the second... | Print a single number β the number of the day of the week, when Petr will finish reading the book. The days of the week are numbered starting with one in the natural order: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday. | One Sunday Petr went to a bookshop and bought a new book on sports programming. The book had exactly n pages.Petr decided to start reading it starting from the next day, that is, from Monday. Petr's got a very tight schedule and for each day of the week he knows how many pages he will be able to read on that day. Some ... | [{"input": "100\r\n15 20 20 15 10 30 45\r\n", "output": ["6"]}, {"input": "2\r\n1 0 0 0 0 0 0\r\n", "output": ["1"]}, {"input": "100\r\n100 200 100 200 300 400 500\r\n", "output": ["1"]}, {"input": "3\r\n1 1 1 1 1 1 1\r\n", "output": ["3"]}, {"input": "1\r\n1 1 1 1 1 1 1\r\n", "output": ["1"]}, {"input": "20\r\n5 3 7 2... | 100 | 100 | 100 | [{'input': '3\r\n0 1 0 0 0 0 0\r\n', 'output': ['2']}, {'input': '997\r\n1 1 0 0 1 0 1\r\n', 'output': ['1']}, {'input': '3\r\n1 1 1 1 1 1 1\r\n', 'output': ['3']}, {'input': '4\r\n0 1 1 0 0 0 0\r\n', 'output': ['3']}, {'input': '5\r\n1 0 1 0 1 0 1\r\n', 'output': ['1']}] | [{'input': '5\r\n0 0 0 0 0 0 10\r\n', 'output': ['7']}, {'input': '28\r\n1 2 3 4 5 6 7\r\n', 'output': ['7']}, {'input': '5\r\n1 1 1 0 0 1 1\r\n', 'output': ['7']}, {'input': '1\r\n1000 1000 1000 1000 1000 1000 1000\r\n', 'output': ['1']}, {'input': '10\r\n0 0 0 0 0 0 10\r\n', 'output': ['7']}] | [{'input': '5\r\n0 0 0 1 0 0 0\r\n', 'output': ['4']}, {'input': '6\r\n1 1 1 1 1 1 0\r\n', 'output': ['6']}, {'input': '2\r\n0 0 0 0 0 0 1\r\n', 'output': ['7']}, {'input': '70\r\n10 10 10 10 10 10 10\r\n', 'output': ['7']}, {'input': '1000\r\n1 1 1 1 1 1 1\r\n', 'output': ['6']}] | [{'input': '4\r\n1 0 0 0 0 0 1\r\n', 'output': ['7']}, {'input': '2\r\n0 0 1 1 0 0 0\r\n', 'output': ['4']}, {'input': '433\r\n109 58 77 10 39 125 15\r\n', 'output': ['7']}, {'input': '7\r\n1 1 1 1 1 1 1\r\n', 'output': ['7']}, {'input': '2\r\n1 0 0 0 0 0 0\r\n', 'output': ['1']}] | [{'input': '999\r\n10 20 10 20 30 20 10\r\n', 'output': ['3']}, {'input': '10\r\n0 0 0 0 0 0 1\r\n', 'output': ['7']}, {'input': '3\r\n0 1 0 0 0 0 0\r\n', 'output': ['2']}, {'input': '433\r\n109 58 77 10 39 125 15\r\n', 'output': ['7']}, {'input': '1000\r\n0 0 0 0 0 0 1\r\n', 'output': ['7']}] | 100 | 100 | 100 | 100 | 100 | 100 | 92.31 | 100 | 100 | 100 | 100 | 83.33 | 100 | 100 | 100 | 18 | 100 | 98.462 | 96.666 |
["2 2", "9 3"] | The single line contains two integers n and m (1ββ€βnββ€β100;Β 2ββ€βmββ€β100), separated by a space. | 42b25b7335ec01794fbb1d4086aa9dd0 | #include<stdio.h>
int main()
{
int n,m,sum,d;
scanf("%d %d",&n,&m);
sum=n;
rich:
d=n/m;
if(d>0)
{
sum=sum+d;
if(((n%m)+d)>=m)
{
n=(n%m)+d;
goto rich;
}
}
printf("%d",sum);
return 0;
}
| ["3", "13"] | C | NoteIn the first sample Vasya spends the first two days wearing the socks that he had initially. Then on day three he puts on the socks that were bought on day two.In the second sample Vasya spends the first nine days wearing the socks that he had initially. Then he spends three days wearing the socks that were bought ... | Print a single integer β the answer to the problem. | Vasya has n pairs of socks. In the morning of each day Vasya has to put on a pair of socks before he goes to school. When he comes home in the evening, Vasya takes off the used socks and throws them away. Every m-th day (at days with numbers m,β2m,β3m,β...) mom buys a pair of socks to Vasya. She does it late in the eve... | [{"input": "2 2\r\n", "output": ["3"]}, {"input": "9 3\r\n", "output": ["13"]}, {"input": "1 2\r\n", "output": ["1"]}, {"input": "2 3\r\n", "output": ["2"]}, {"input": "1 99\r\n", "output": ["1"]}, {"input": "4 4\r\n", "output": ["5"]}, {"input": "10 2\r\n", "output": ["19"]}, {"input": "10 9\r\n", "output": ["11"]}, {... | 100 | 100 | 100 | [{'input': '98 3\r\n', 'output': ['146']}, {'input': '62 4\r\n', 'output': ['82']}, {'input': '1 99\r\n', 'output': ['1']}, {'input': '99 100\r\n', 'output': ['99']}, {'input': '2 3\r\n', 'output': ['2']}] | [{'input': '99 2\r\n', 'output': ['197']}, {'input': '99 74\r\n', 'output': ['100']}, {'input': '2 2\r\n', 'output': ['3']}, {'input': '2 3\r\n', 'output': ['2']}, {'input': '100 2\r\n', 'output': ['199']}] | [{'input': '20 21\r\n', 'output': ['20']}, {'input': '99 10\r\n', 'output': ['109']}, {'input': '99 74\r\n', 'output': ['100']}, {'input': '10 2\r\n', 'output': ['19']}, {'input': '100 3\r\n', 'output': ['149']}] | [{'input': '62 4\r\n', 'output': ['82']}, {'input': '98 3\r\n', 'output': ['146']}, {'input': '1 2\r\n', 'output': ['1']}, {'input': '99 74\r\n', 'output': ['100']}, {'input': '100 100\r\n', 'output': ['101']}] | [{'input': '2 3\r\n', 'output': ['2']}, {'input': '100 2\r\n', 'output': ['199']}, {'input': '2 27\r\n', 'output': ['2']}, {'input': '75 16\r\n', 'output': ['79']}, {'input': '100 100\r\n', 'output': ['101']}] | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 19 | 100 | 100 | 100 |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 39