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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
There is a robot staying at $$$X=0$$$ on the $$$Ox$$$ axis. He has to walk to $$$X=n$$$. You are controlling this robot and controlling how he goes. The robot has a battery and an accumulator with a solar panel.The $$$i$$$-th segment of the path (from $$$X=i-1$$$ to $$$X=i$$$) can be exposed to sunlight or not. The arr... | Print one integer — the maximum number of segments the robot can pass if you control him optimally. | C | 75ef1f52ef3a86992159eef566dddc89 | 31511185df6623b5de84821c747f82a8 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"greedy"
] | 1555425300 | ["5 2 1\n0 1 0 1 0", "6 2 1\n1 0 0 1 0 1"] | NoteIn the first example the robot can go through the first segment using the accumulator, and charge levels become $$$b=2$$$ and $$$a=0$$$. The second segment can be passed using the battery, and charge levels become $$$b=1$$$ and $$$a=1$$$. The third segment can be passed using the accumulator, and charge levels beco... | PASSED | 1,500 | standard input | 2 seconds | The first line of the input contains three integers $$$n, b, a$$$ ($$$1 \le n, b, a \le 2 \cdot 10^5$$$) — the robot's destination point, the battery capacity and the accumulator capacity, respectively. The second line of the input contains $$$n$$$ integers $$$s_1, s_2, \dots, s_n$$$ ($$$0 \le s_i \le 1$$$), where $$$s... | ["5", "3"] | #include <stdio.h>
int main()
{
int n,b,a,s,i,y;
scanf("%d %d %d",&n,&b,&a);
y=a;
for (i = 0;i<n&&(a||b);i++)
{
scanf("%d", &s);
if (!s)
{
if (a)a--;
else b--;
}
else
{
if(b&&a<y) b--,a++;
else a--;
}
}
printf("%d",i);
return 0;
}
| |
There is a robot staying at $$$X=0$$$ on the $$$Ox$$$ axis. He has to walk to $$$X=n$$$. You are controlling this robot and controlling how he goes. The robot has a battery and an accumulator with a solar panel.The $$$i$$$-th segment of the path (from $$$X=i-1$$$ to $$$X=i$$$) can be exposed to sunlight or not. The arr... | Print one integer — the maximum number of segments the robot can pass if you control him optimally. | C | 75ef1f52ef3a86992159eef566dddc89 | 99dbb0d18ef4511c3eaa39d67b510309 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"greedy"
] | 1555425300 | ["5 2 1\n0 1 0 1 0", "6 2 1\n1 0 0 1 0 1"] | NoteIn the first example the robot can go through the first segment using the accumulator, and charge levels become $$$b=2$$$ and $$$a=0$$$. The second segment can be passed using the battery, and charge levels become $$$b=1$$$ and $$$a=1$$$. The third segment can be passed using the accumulator, and charge levels beco... | PASSED | 1,500 | standard input | 2 seconds | The first line of the input contains three integers $$$n, b, a$$$ ($$$1 \le n, b, a \le 2 \cdot 10^5$$$) — the robot's destination point, the battery capacity and the accumulator capacity, respectively. The second line of the input contains $$$n$$$ integers $$$s_1, s_2, \dots, s_n$$$ ($$$0 \le s_i \le 1$$$), where $$$s... | ["5", "3"] | #include<stdio.h>
int main()
{
int n, b, a, i;
scanf("%d %d %d", &n, &b, &a);
int x = a;
int s[n];
for(i=0; i<n; i++)
{
scanf("%d", &s[i]);
}
for(i=0; i<n; i++)
{
if(s[i]==1)
{
if(b>0)
{
b--;
if(a<x)
... | |
There is a robot staying at $$$X=0$$$ on the $$$Ox$$$ axis. He has to walk to $$$X=n$$$. You are controlling this robot and controlling how he goes. The robot has a battery and an accumulator with a solar panel.The $$$i$$$-th segment of the path (from $$$X=i-1$$$ to $$$X=i$$$) can be exposed to sunlight or not. The arr... | Print one integer — the maximum number of segments the robot can pass if you control him optimally. | C | 75ef1f52ef3a86992159eef566dddc89 | 1f649c0e5a86e42f00eb6355bfeb8b7f | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"greedy"
] | 1555425300 | ["5 2 1\n0 1 0 1 0", "6 2 1\n1 0 0 1 0 1"] | NoteIn the first example the robot can go through the first segment using the accumulator, and charge levels become $$$b=2$$$ and $$$a=0$$$. The second segment can be passed using the battery, and charge levels become $$$b=1$$$ and $$$a=1$$$. The third segment can be passed using the accumulator, and charge levels beco... | PASSED | 1,500 | standard input | 2 seconds | The first line of the input contains three integers $$$n, b, a$$$ ($$$1 \le n, b, a \le 2 \cdot 10^5$$$) — the robot's destination point, the battery capacity and the accumulator capacity, respectively. The second line of the input contains $$$n$$$ integers $$$s_1, s_2, \dots, s_n$$$ ($$$0 \le s_i \le 1$$$), where $$$s... | ["5", "3"] | #include<stdio.h>
int main()
{
int i,n,b,a,B,A,light,len=0;
scanf("%d%d%d",&n,&B,&A);
a=A;b=B;
for(i=0;i<n;i++)
{
scanf("%d",&light);
if(light==1)
{
if(a==A)
{
a--;
len++;
}
else if(b>0)
{
b--;
a++;
if(a>A)a=A;
len++;
}
else if(a>0)
{
a--;
len++;
}
... | |
There is a robot staying at $$$X=0$$$ on the $$$Ox$$$ axis. He has to walk to $$$X=n$$$. You are controlling this robot and controlling how he goes. The robot has a battery and an accumulator with a solar panel.The $$$i$$$-th segment of the path (from $$$X=i-1$$$ to $$$X=i$$$) can be exposed to sunlight or not. The arr... | Print one integer — the maximum number of segments the robot can pass if you control him optimally. | C | 75ef1f52ef3a86992159eef566dddc89 | 0857d2ceaa1fcc818146c845a28f8fad | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"greedy"
] | 1555425300 | ["5 2 1\n0 1 0 1 0", "6 2 1\n1 0 0 1 0 1"] | NoteIn the first example the robot can go through the first segment using the accumulator, and charge levels become $$$b=2$$$ and $$$a=0$$$. The second segment can be passed using the battery, and charge levels become $$$b=1$$$ and $$$a=1$$$. The third segment can be passed using the accumulator, and charge levels beco... | PASSED | 1,500 | standard input | 2 seconds | The first line of the input contains three integers $$$n, b, a$$$ ($$$1 \le n, b, a \le 2 \cdot 10^5$$$) — the robot's destination point, the battery capacity and the accumulator capacity, respectively. The second line of the input contains $$$n$$$ integers $$$s_1, s_2, \dots, s_n$$$ ($$$0 \le s_i \le 1$$$), where $$$s... | ["5", "3"] | #include <stdio.h>
#include <stdlib.h>
int n,a,b,nr,i,x[200000],c;
int main()
{
scanf("%d %d %d",&n,&b,&a);
c=a;
for(i=0;i<n;i++)
{
scanf("%d",&x[i]);
if(x[i]==0)
{
if(a>0)
{
a--;
nr++;
}
else
if(b>0)
{
b--;
... | |
Yaroslav likes algorithms. We'll describe one of his favorite algorithms. The algorithm receives a string as the input. We denote this input string as a. The algorithm consists of some number of command. Сommand number i looks either as si >> wi, or as si <> wi, where si and wi are some possibly empty str... | Print the algorithm which can individually increase each number of the set. In the i-th line print the command number i without spaces. Your algorithm will be launched for each of these numbers. The answer will be considered correct if: Each line will a correct algorithm command (see the description in the problem... | C | 90929863d289a475b766d5f2b0cd7c61 | cef02d98fc435d0e41200026a4055d7e | GNU C | standard output | 256 megabytes | train_003.jsonl | [] | 1367769900 | ["2\n10\n79"] | null | PASSED | 2,500 | standard input | 2 seconds | The first line contains integer n (1 ≤ n ≤ 100) — the number of elements in the set. The next n lines contains one positive integer each. All the given numbers are less than 1025. | ["10<>11\n79<>80"] | #include <stdio.h>
int main(){
int i;
for(i = 0; i < 10; i++) {
printf("??%d>>%d??\n", i, i);
}
printf("??>>?\n");
for(i = 0; i < 9; i++) {
printf("%d?<>%d\n", i, i + 1);
}
printf("9?>>?0\n?<>1\n>>??\n");
} | |
Yaroslav likes algorithms. We'll describe one of his favorite algorithms. The algorithm receives a string as the input. We denote this input string as a. The algorithm consists of some number of command. Сommand number i looks either as si >> wi, or as si <> wi, where si and wi are some possibly empty str... | Print the algorithm which can individually increase each number of the set. In the i-th line print the command number i without spaces. Your algorithm will be launched for each of these numbers. The answer will be considered correct if: Each line will a correct algorithm command (see the description in the problem... | C | 90929863d289a475b766d5f2b0cd7c61 | 031bc033b721fb24f673b10711d6ac57 | GNU C | standard output | 256 megabytes | train_003.jsonl | [] | 1367769900 | ["2\n10\n79"] | null | PASSED | 2,500 | standard input | 2 seconds | The first line contains integer n (1 ≤ n ≤ 100) — the number of elements in the set. The next n lines contains one positive integer each. All the given numbers are less than 1025. | ["10<>11\n79<>80"] | #include<stdio.h>
int main()
{
int i;
for(i=0;i<=8;i++)
printf ("%d??<>%d\n",i,i+1);
printf ("9??>>??0\n");
printf ("??<>1\n");
for(i=0;i<=9;i++)
printf ("?%d>>%d?\n",i,i);
for(i=0;i<=8;i++)
printf ("%d?<>%d\n",i,i+1);
printf ("9?>>??0\n");
printf(">>... | |
You are given a string $$$s$$$ of length $$$n$$$, which consists only of the first $$$k$$$ letters of the Latin alphabet. All letters in string $$$s$$$ are uppercase.A subsequence of string $$$s$$$ is a string that can be derived from $$$s$$$ by deleting some of its symbols without changing the order of the remaining s... | Print the only integer — the length of the longest good subsequence of string $$$s$$$. | C | d9d5db63b1e48214d02abe9977709384 | 8d9e79d8ad65d02c9ac2d4ab213a3a13 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"strings"
] | 1536248100 | ["9 3\nACAABCCAB", "9 4\nABCABCABC"] | NoteIn the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.In the second example, none of the subsequences can have 'D', hence the answer is $$$0... | PASSED | 800 | standard input | 2 seconds | The first line of the input contains integers $$$n$$$ ($$$1\le n \le 10^5$$$) and $$$k$$$ ($$$1 \le k \le 26$$$). The second line of the input contains the string $$$s$$$ of length $$$n$$$. String $$$s$$$ only contains uppercase letters from 'A' to the $$$k$$$-th letter of Latin alphabet. | ["6", "0"] | #include<stdio.h>
void mergesort(char arr[], int l, int r)
{
if (l < r)
{
int m = l+(r-l)/2;
mergesort(arr, l, m);
mergesort(arr, m+1,r);
merge(arr, l, m, r);
}
}
void merge(char arr[], int l, int m, int r)
{
int i, j, k;
int n1 = m - l + 1;
int n2 = r - m;
char L[1+n1], R[1+n2];
for (i = 0; i < n1; i++)
L[i] = arr[l +... | |
You are given a string $$$s$$$ of length $$$n$$$, which consists only of the first $$$k$$$ letters of the Latin alphabet. All letters in string $$$s$$$ are uppercase.A subsequence of string $$$s$$$ is a string that can be derived from $$$s$$$ by deleting some of its symbols without changing the order of the remaining s... | Print the only integer — the length of the longest good subsequence of string $$$s$$$. | C | d9d5db63b1e48214d02abe9977709384 | 1c7f3ca5d2a71ce7160861d74b139059 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"strings"
] | 1536248100 | ["9 3\nACAABCCAB", "9 4\nABCABCABC"] | NoteIn the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.In the second example, none of the subsequences can have 'D', hence the answer is $$$0... | PASSED | 800 | standard input | 2 seconds | The first line of the input contains integers $$$n$$$ ($$$1\le n \le 10^5$$$) and $$$k$$$ ($$$1 \le k \le 26$$$). The second line of the input contains the string $$$s$$$ of length $$$n$$$. String $$$s$$$ only contains uppercase letters from 'A' to the $$$k$$$-th letter of Latin alphabet. | ["6", "0"] | #include<stdio.h>
int main()
{
int n,x,y,z,k,min=100000;
char s[100001],a;
scanf("%d%d",&n,&k);
scanf("%c",&a);
gets(s);
for(x=0;x<k;x++)
{
a='A'+x;
z=0;
for(y=0;y<n;y++)
{
if(a==s[y])
z++;
}
if(min>z)
min=z;
}
printf("%d",min*k);
} | |
You are given a string $$$s$$$ of length $$$n$$$, which consists only of the first $$$k$$$ letters of the Latin alphabet. All letters in string $$$s$$$ are uppercase.A subsequence of string $$$s$$$ is a string that can be derived from $$$s$$$ by deleting some of its symbols without changing the order of the remaining s... | Print the only integer — the length of the longest good subsequence of string $$$s$$$. | C | d9d5db63b1e48214d02abe9977709384 | 8f9ef1d6171ec3da9982bf8309a475f9 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"strings"
] | 1536248100 | ["9 3\nACAABCCAB", "9 4\nABCABCABC"] | NoteIn the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.In the second example, none of the subsequences can have 'D', hence the answer is $$$0... | PASSED | 800 | standard input | 2 seconds | The first line of the input contains integers $$$n$$$ ($$$1\le n \le 10^5$$$) and $$$k$$$ ($$$1 \le k \le 26$$$). The second line of the input contains the string $$$s$$$ of length $$$n$$$. String $$$s$$$ only contains uppercase letters from 'A' to the $$$k$$$-th letter of Latin alphabet. | ["6", "0"] | #include<stdio.h>
#include<string.h>
int main() {
int n, a[26] = { 0 }, k, min = 1000000, i;
char s[100000];
scanf("%d %d", &n, &k);
scanf("%c", &s[0]);
gets(s);
int m = strlen(s);
for (i = 0; i< m; i++)
a[(int)s[i] - 65]++;
for (i = 0; i < k; i++)
{
if (a[i]<min)
min = a[i];
}
printf("%d\n", min... | |
You are given a string $$$s$$$ of length $$$n$$$, which consists only of the first $$$k$$$ letters of the Latin alphabet. All letters in string $$$s$$$ are uppercase.A subsequence of string $$$s$$$ is a string that can be derived from $$$s$$$ by deleting some of its symbols without changing the order of the remaining s... | Print the only integer — the length of the longest good subsequence of string $$$s$$$. | C | d9d5db63b1e48214d02abe9977709384 | af5d8cec9f7abfc9ab78f1d7ae576e4d | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"strings"
] | 1536248100 | ["9 3\nACAABCCAB", "9 4\nABCABCABC"] | NoteIn the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.In the second example, none of the subsequences can have 'D', hence the answer is $$$0... | PASSED | 800 | standard input | 2 seconds | The first line of the input contains integers $$$n$$$ ($$$1\le n \le 10^5$$$) and $$$k$$$ ($$$1 \le k \le 26$$$). The second line of the input contains the string $$$s$$$ of length $$$n$$$. String $$$s$$$ only contains uppercase letters from 'A' to the $$$k$$$-th letter of Latin alphabet. | ["6", "0"] | #include<stdio.h>
int main()
{
int i,n,k,aryan[26]={0},m=0;
char c;
scanf("%d %d",&n,&k);
for(i=0;i<n;i++)
{
scanf(" %c",&c);
aryan[c-65]++;
}
for(i=1;i<k;i++)
{
if(aryan[i]<aryan[m])
m=i;
}
printf("%d",aryan[m]*k);
return 0;
}
| |
You are given a string $$$s$$$ of length $$$n$$$, which consists only of the first $$$k$$$ letters of the Latin alphabet. All letters in string $$$s$$$ are uppercase.A subsequence of string $$$s$$$ is a string that can be derived from $$$s$$$ by deleting some of its symbols without changing the order of the remaining s... | Print the only integer — the length of the longest good subsequence of string $$$s$$$. | C | d9d5db63b1e48214d02abe9977709384 | fc1125db57d35161570ec506d0ba37a3 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"strings"
] | 1536248100 | ["9 3\nACAABCCAB", "9 4\nABCABCABC"] | NoteIn the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.In the second example, none of the subsequences can have 'D', hence the answer is $$$0... | PASSED | 800 | standard input | 2 seconds | The first line of the input contains integers $$$n$$$ ($$$1\le n \le 10^5$$$) and $$$k$$$ ($$$1 \le k \le 26$$$). The second line of the input contains the string $$$s$$$ of length $$$n$$$. String $$$s$$$ only contains uppercase letters from 'A' to the $$$k$$$-th letter of Latin alphabet. | ["6", "0"] | #include<stdio.h>
int main()
{
int i,n,k,aryan[26]={0},m=0;
char c;
scanf("%d %d",&n,&k);
for(i=0;i<n;i++)
{
scanf(" %c",&c);
aryan[c-65]++;
}
for(i=1;i<k;i++)
{
if(aryan[i]<aryan[m])
m=i;
}
printf("%d",aryan[m]*k);
return 0;
}
| |
You are given a string $$$s$$$ of length $$$n$$$, which consists only of the first $$$k$$$ letters of the Latin alphabet. All letters in string $$$s$$$ are uppercase.A subsequence of string $$$s$$$ is a string that can be derived from $$$s$$$ by deleting some of its symbols without changing the order of the remaining s... | Print the only integer — the length of the longest good subsequence of string $$$s$$$. | C | d9d5db63b1e48214d02abe9977709384 | c3207d137dbf8cddcab47be9d804726f | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"strings"
] | 1536248100 | ["9 3\nACAABCCAB", "9 4\nABCABCABC"] | NoteIn the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.In the second example, none of the subsequences can have 'D', hence the answer is $$$0... | PASSED | 800 | standard input | 2 seconds | The first line of the input contains integers $$$n$$$ ($$$1\le n \le 10^5$$$) and $$$k$$$ ($$$1 \le k \le 26$$$). The second line of the input contains the string $$$s$$$ of length $$$n$$$. String $$$s$$$ only contains uppercase letters from 'A' to the $$$k$$$-th letter of Latin alphabet. | ["6", "0"] | #include<stdio.h>
int main()
{
int a,b,k,gnani[26]={0},n=0;
char c;
scanf("%d %d",&b,&k);
for(a=0;a<b;a++)
{
scanf(" %c",&c);
gnani[c-65]++;
}
for(a=1;a<k;a++)
{
if(gnani[a]<gnani[n])
n=a;
}
printf("%d",gnani[n]*k);
return 0;
}
| |
You are given a string $$$s$$$ of length $$$n$$$, which consists only of the first $$$k$$$ letters of the Latin alphabet. All letters in string $$$s$$$ are uppercase.A subsequence of string $$$s$$$ is a string that can be derived from $$$s$$$ by deleting some of its symbols without changing the order of the remaining s... | Print the only integer — the length of the longest good subsequence of string $$$s$$$. | C | d9d5db63b1e48214d02abe9977709384 | 0213206e035341c0e447f29f9351ff41 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"strings"
] | 1536248100 | ["9 3\nACAABCCAB", "9 4\nABCABCABC"] | NoteIn the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.In the second example, none of the subsequences can have 'D', hence the answer is $$$0... | PASSED | 800 | standard input | 2 seconds | The first line of the input contains integers $$$n$$$ ($$$1\le n \le 10^5$$$) and $$$k$$$ ($$$1 \le k \le 26$$$). The second line of the input contains the string $$$s$$$ of length $$$n$$$. String $$$s$$$ only contains uppercase letters from 'A' to the $$$k$$$-th letter of Latin alphabet. | ["6", "0"] | #include<stdio.h>
int main()
{
int i,n,k,aryan[26]={0},m=0;
char c;
scanf("%d %d",&n,&k);
for(i=0;i<n;i++)
{
scanf(" %c",&c);
aryan[c-65]++;
}
for(i=1;i<k;i++)
{
if(aryan[i]<aryan[m])
m=i;
}
printf("%d",aryan[m]*k);
return 0;
}
| |
You are given a string $$$s$$$ of length $$$n$$$, which consists only of the first $$$k$$$ letters of the Latin alphabet. All letters in string $$$s$$$ are uppercase.A subsequence of string $$$s$$$ is a string that can be derived from $$$s$$$ by deleting some of its symbols without changing the order of the remaining s... | Print the only integer — the length of the longest good subsequence of string $$$s$$$. | C | d9d5db63b1e48214d02abe9977709384 | 2ec788e23b0d74f61bb4902238325ada | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"strings"
] | 1536248100 | ["9 3\nACAABCCAB", "9 4\nABCABCABC"] | NoteIn the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.In the second example, none of the subsequences can have 'D', hence the answer is $$$0... | PASSED | 800 | standard input | 2 seconds | The first line of the input contains integers $$$n$$$ ($$$1\le n \le 10^5$$$) and $$$k$$$ ($$$1 \le k \le 26$$$). The second line of the input contains the string $$$s$$$ of length $$$n$$$. String $$$s$$$ only contains uppercase letters from 'A' to the $$$k$$$-th letter of Latin alphabet. | ["6", "0"] | #include<stdio.h>
int main()
{
int i,n,k,str[26]={0},m=0;
char c;
scanf("%d %d",&n,&k);
for(i=0;i<n;i++)
{
scanf(" %c",&c);
str[c-65]++;
}
for(i=1;i<k;i++)
{
if(str[i]<str[m])
m=i;
}
printf("%d\n",str[m]*k);
return 0;
}
| |
You are given a string $$$s$$$ of length $$$n$$$, which consists only of the first $$$k$$$ letters of the Latin alphabet. All letters in string $$$s$$$ are uppercase.A subsequence of string $$$s$$$ is a string that can be derived from $$$s$$$ by deleting some of its symbols without changing the order of the remaining s... | Print the only integer — the length of the longest good subsequence of string $$$s$$$. | C | d9d5db63b1e48214d02abe9977709384 | e77b189da4bb991b533e08d94f1f661f | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"strings"
] | 1536248100 | ["9 3\nACAABCCAB", "9 4\nABCABCABC"] | NoteIn the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.In the second example, none of the subsequences can have 'D', hence the answer is $$$0... | PASSED | 800 | standard input | 2 seconds | The first line of the input contains integers $$$n$$$ ($$$1\le n \le 10^5$$$) and $$$k$$$ ($$$1 \le k \le 26$$$). The second line of the input contains the string $$$s$$$ of length $$$n$$$. String $$$s$$$ only contains uppercase letters from 'A' to the $$$k$$$-th letter of Latin alphabet. | ["6", "0"] | #include<stdio.h>
int main()
{
int n,m,i,j;
scanf("%d%d",&n,&m);
char s[n];
scanf("%s",s);
int a[m],cnt=0;
for(i=0;i<m;i++){
for(j=0;j<n;j++){
if(s[j]==65+i){
cnt++;
}
}
a[i]=cnt;
cnt=0;
}
int min=a[0];
for(int i=0;i<m;i++){
if(min>a[i]){
min=a[i];
}
}
printf("%d",min*m);
... | |
You are given a string $$$s$$$ of length $$$n$$$, which consists only of the first $$$k$$$ letters of the Latin alphabet. All letters in string $$$s$$$ are uppercase.A subsequence of string $$$s$$$ is a string that can be derived from $$$s$$$ by deleting some of its symbols without changing the order of the remaining s... | Print the only integer — the length of the longest good subsequence of string $$$s$$$. | C | d9d5db63b1e48214d02abe9977709384 | 40029c73a90f08c6b366eba1798b7363 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"strings"
] | 1536248100 | ["9 3\nACAABCCAB", "9 4\nABCABCABC"] | NoteIn the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.In the second example, none of the subsequences can have 'D', hence the answer is $$$0... | PASSED | 800 | standard input | 2 seconds | The first line of the input contains integers $$$n$$$ ($$$1\le n \le 10^5$$$) and $$$k$$$ ($$$1 \le k \le 26$$$). The second line of the input contains the string $$$s$$$ of length $$$n$$$. String $$$s$$$ only contains uppercase letters from 'A' to the $$$k$$$-th letter of Latin alphabet. | ["6", "0"] | #include <stdio.h>
#include <string.h>
int main(void) {
char s[100000];
int n,k,i,j,f,p;
scanf("%d%d",&n,&k);
scanf("%s",s);
for(i=0;i<k;i++)
{
f=0;
for (j=0;j<n;j++)
{
if (s[j]==65+i)
f=f+1;
}
if (!i || f<p) p=f;
}
printf("%d",p*k);
return 0;
}
| |
You are given a string $$$s$$$ of length $$$n$$$, which consists only of the first $$$k$$$ letters of the Latin alphabet. All letters in string $$$s$$$ are uppercase.A subsequence of string $$$s$$$ is a string that can be derived from $$$s$$$ by deleting some of its symbols without changing the order of the remaining s... | Print the only integer — the length of the longest good subsequence of string $$$s$$$. | C | d9d5db63b1e48214d02abe9977709384 | b903bc3ce83ca4689597c35905e1913a | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"strings"
] | 1536248100 | ["9 3\nACAABCCAB", "9 4\nABCABCABC"] | NoteIn the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.In the second example, none of the subsequences can have 'D', hence the answer is $$$0... | PASSED | 800 | standard input | 2 seconds | The first line of the input contains integers $$$n$$$ ($$$1\le n \le 10^5$$$) and $$$k$$$ ($$$1 \le k \le 26$$$). The second line of the input contains the string $$$s$$$ of length $$$n$$$. String $$$s$$$ only contains uppercase letters from 'A' to the $$$k$$$-th letter of Latin alphabet. | ["6", "0"] | #include <stdio.h>
#include <string.h>
int main(void) {
char s[100000];
int n,k,i,j,f,p;
scanf("%d%d",&n,&k);
scanf("%s",s);
for(i=0;i<k;i++)
{
f=0;
for (j=0;j<n;j++)
{
if (s[j]==65+i)
f=f+1;
}
if (i==0)p=f;
else if (f<p)p=f;
}
printf("%d",p*k);... | |
You are given a string $$$s$$$ of length $$$n$$$, which consists only of the first $$$k$$$ letters of the Latin alphabet. All letters in string $$$s$$$ are uppercase.A subsequence of string $$$s$$$ is a string that can be derived from $$$s$$$ by deleting some of its symbols without changing the order of the remaining s... | Print the only integer — the length of the longest good subsequence of string $$$s$$$. | C | d9d5db63b1e48214d02abe9977709384 | fc0ba474fd8f8e045464a0e843a7a62e | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"strings"
] | 1536248100 | ["9 3\nACAABCCAB", "9 4\nABCABCABC"] | NoteIn the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.In the second example, none of the subsequences can have 'D', hence the answer is $$$0... | PASSED | 800 | standard input | 2 seconds | The first line of the input contains integers $$$n$$$ ($$$1\le n \le 10^5$$$) and $$$k$$$ ($$$1 \le k \le 26$$$). The second line of the input contains the string $$$s$$$ of length $$$n$$$. String $$$s$$$ only contains uppercase letters from 'A' to the $$$k$$$-th letter of Latin alphabet. | ["6", "0"] | #include<stdio.h>
int map[26], cnt=0;
int main()
{
int n,k;
scanf("%d%d",&n,&k);
char a[n];
scanf("%s",a);
for(int i=0; i<n; i++)
{
map[a[i]-65]++ ;
cnt++;
}
if(cnt < (k-1) )
{
printf("0");
return 0;
}
for(int i=1; i<k; i++)
{
... | |
You are given a string $$$s$$$ of length $$$n$$$, which consists only of the first $$$k$$$ letters of the Latin alphabet. All letters in string $$$s$$$ are uppercase.A subsequence of string $$$s$$$ is a string that can be derived from $$$s$$$ by deleting some of its symbols without changing the order of the remaining s... | Print the only integer — the length of the longest good subsequence of string $$$s$$$. | C | d9d5db63b1e48214d02abe9977709384 | 31c32eec72f649921901379c2828753a | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"strings"
] | 1536248100 | ["9 3\nACAABCCAB", "9 4\nABCABCABC"] | NoteIn the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.In the second example, none of the subsequences can have 'D', hence the answer is $$$0... | PASSED | 800 | standard input | 2 seconds | The first line of the input contains integers $$$n$$$ ($$$1\le n \le 10^5$$$) and $$$k$$$ ($$$1 \le k \le 26$$$). The second line of the input contains the string $$$s$$$ of length $$$n$$$. String $$$s$$$ only contains uppercase letters from 'A' to the $$$k$$$-th letter of Latin alphabet. | ["6", "0"] |
#include<stdio.h>
int main()
{
int n,k;
int i,j,l,m=0;
scanf("%d%d",&n,&k);
char s[n];
int a[k];
scanf("%s",s);
for(j='A',l=0;j<'A'+k;j++,l++)
{
m=0;a[l]=0;
for(i=0;s[i]!=0;i++)
{
if(s[i]==j)
{
... | |
You are given a string $$$s$$$ of length $$$n$$$, which consists only of the first $$$k$$$ letters of the Latin alphabet. All letters in string $$$s$$$ are uppercase.A subsequence of string $$$s$$$ is a string that can be derived from $$$s$$$ by deleting some of its symbols without changing the order of the remaining s... | Print the only integer — the length of the longest good subsequence of string $$$s$$$. | C | d9d5db63b1e48214d02abe9977709384 | 41a847b4c9370091d0dedcd0a9e23732 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"strings"
] | 1536248100 | ["9 3\nACAABCCAB", "9 4\nABCABCABC"] | NoteIn the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.In the second example, none of the subsequences can have 'D', hence the answer is $$$0... | PASSED | 800 | standard input | 2 seconds | The first line of the input contains integers $$$n$$$ ($$$1\le n \le 10^5$$$) and $$$k$$$ ($$$1 \le k \le 26$$$). The second line of the input contains the string $$$s$$$ of length $$$n$$$. String $$$s$$$ only contains uppercase letters from 'A' to the $$$k$$$-th letter of Latin alphabet. | ["6", "0"] | #include <stdio.h>
#include <string.h>
int main()
{
char ch, S_1[26] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int n, k, R[26] = {0}, i, x = -1, min;
scanf("%d%d ", &n, &k);
do{
scanf("%c", &ch);
if(ch != '\n')
{
for(i = 0;i < 26;i++)
{
if(ch == S... | |
You are given a string $$$s$$$ of length $$$n$$$, which consists only of the first $$$k$$$ letters of the Latin alphabet. All letters in string $$$s$$$ are uppercase.A subsequence of string $$$s$$$ is a string that can be derived from $$$s$$$ by deleting some of its symbols without changing the order of the remaining s... | Print the only integer — the length of the longest good subsequence of string $$$s$$$. | C | d9d5db63b1e48214d02abe9977709384 | ee54cab8e92a8cf04f4fd10750cba0f9 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"strings"
] | 1536248100 | ["9 3\nACAABCCAB", "9 4\nABCABCABC"] | NoteIn the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.In the second example, none of the subsequences can have 'D', hence the answer is $$$0... | PASSED | 800 | standard input | 2 seconds | The first line of the input contains integers $$$n$$$ ($$$1\le n \le 10^5$$$) and $$$k$$$ ($$$1 \le k \le 26$$$). The second line of the input contains the string $$$s$$$ of length $$$n$$$. String $$$s$$$ only contains uppercase letters from 'A' to the $$$k$$$-th letter of Latin alphabet. | ["6", "0"] | #include <stdio.h>
#include <string.h>
int a[30];
int main()
{
int i, j, k, n, c1=0, cnt=0, min=100005;
char s[100005], st[30] ,ch[30];
scanf("%d%d",&n,&k);
scanf("%s",s);
for (i=0;i<k;i++){
st[i]='A'+i;
}
st[i]='\0';
// puts(st);
// strcpy(ch,st);
// c1=k;
for (i=0;s[i];i++){
for (j=0;j<k;j++... | |
You are given a string $$$s$$$ of length $$$n$$$, which consists only of the first $$$k$$$ letters of the Latin alphabet. All letters in string $$$s$$$ are uppercase.A subsequence of string $$$s$$$ is a string that can be derived from $$$s$$$ by deleting some of its symbols without changing the order of the remaining s... | Print the only integer — the length of the longest good subsequence of string $$$s$$$. | C | d9d5db63b1e48214d02abe9977709384 | b0123cc12c7bd256ee6583e9d1ac0473 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"strings"
] | 1536248100 | ["9 3\nACAABCCAB", "9 4\nABCABCABC"] | NoteIn the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.In the second example, none of the subsequences can have 'D', hence the answer is $$$0... | PASSED | 800 | standard input | 2 seconds | The first line of the input contains integers $$$n$$$ ($$$1\le n \le 10^5$$$) and $$$k$$$ ($$$1 \le k \le 26$$$). The second line of the input contains the string $$$s$$$ of length $$$n$$$. String $$$s$$$ only contains uppercase letters from 'A' to the $$$k$$$-th letter of Latin alphabet. | ["6", "0"] | #include<stdio.h>
#include<string.h>
int main()
{
int n,k,i,j,c,m;
scanf("%d %d",&n,&k);
char s[n];
int b[k];
scanf("%s",s);
for(i=0;i<n;i++)
{
if(65<=s[i]&&s[i]<=65+k)
continue;
else
{
printf("0");
return 0;
}
}
for... | |
You are given a string $$$s$$$ of length $$$n$$$, which consists only of the first $$$k$$$ letters of the Latin alphabet. All letters in string $$$s$$$ are uppercase.A subsequence of string $$$s$$$ is a string that can be derived from $$$s$$$ by deleting some of its symbols without changing the order of the remaining s... | Print the only integer — the length of the longest good subsequence of string $$$s$$$. | C | d9d5db63b1e48214d02abe9977709384 | 2f5a43eddfb6e18c52a8531e68062aaf | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"strings"
] | 1536248100 | ["9 3\nACAABCCAB", "9 4\nABCABCABC"] | NoteIn the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.In the second example, none of the subsequences can have 'D', hence the answer is $$$0... | PASSED | 800 | standard input | 2 seconds | The first line of the input contains integers $$$n$$$ ($$$1\le n \le 10^5$$$) and $$$k$$$ ($$$1 \le k \le 26$$$). The second line of the input contains the string $$$s$$$ of length $$$n$$$. String $$$s$$$ only contains uppercase letters from 'A' to the $$$k$$$-th letter of Latin alphabet. | ["6", "0"] | #include<stdio.h>
#include<string.h>
int main()
{
int n,k,i,z;
scanf("%d %d",&n,&k);
z=n;
int A[k];
for(i=0;i<k;i++)
{
A[i]=0;
}
char S[n];
scanf("%s",S);
for(i=0;i<n;i++)
{
A[S[i]-65]++;
}
for(i=0;i<k;i++)
{
if(A[i]<z)
{
... | |
You are given a string $$$s$$$ of length $$$n$$$, which consists only of the first $$$k$$$ letters of the Latin alphabet. All letters in string $$$s$$$ are uppercase.A subsequence of string $$$s$$$ is a string that can be derived from $$$s$$$ by deleting some of its symbols without changing the order of the remaining s... | Print the only integer — the length of the longest good subsequence of string $$$s$$$. | C | d9d5db63b1e48214d02abe9977709384 | 0440f71b79822cbbe43c60b4226e8209 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"strings"
] | 1536248100 | ["9 3\nACAABCCAB", "9 4\nABCABCABC"] | NoteIn the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.In the second example, none of the subsequences can have 'D', hence the answer is $$$0... | PASSED | 800 | standard input | 2 seconds | The first line of the input contains integers $$$n$$$ ($$$1\le n \le 10^5$$$) and $$$k$$$ ($$$1 \le k \le 26$$$). The second line of the input contains the string $$$s$$$ of length $$$n$$$. String $$$s$$$ only contains uppercase letters from 'A' to the $$$k$$$-th letter of Latin alphabet. | ["6", "0"] |
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<ctype.h>
int tongji(char x[],char a[],int c[]){
int i=0,j=0;
char *p=x;
for(i=0;i<26;i++){
c[i]=0;
}
while(*p!='\0'){
if(isalpha(*p)){
if(islower(*p)){
a[*p-'a']=*p-32;
c[*p-'a']++;
}
else{
a[*p-'A']=*p;
c[*p-'A']++;
... | |
You are given a string $$$s$$$ of length $$$n$$$, which consists only of the first $$$k$$$ letters of the Latin alphabet. All letters in string $$$s$$$ are uppercase.A subsequence of string $$$s$$$ is a string that can be derived from $$$s$$$ by deleting some of its symbols without changing the order of the remaining s... | Print the only integer — the length of the longest good subsequence of string $$$s$$$. | C | d9d5db63b1e48214d02abe9977709384 | 1ceca7a2fcb203387ce1b8b29663b980 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"strings"
] | 1536248100 | ["9 3\nACAABCCAB", "9 4\nABCABCABC"] | NoteIn the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.In the second example, none of the subsequences can have 'D', hence the answer is $$$0... | PASSED | 800 | standard input | 2 seconds | The first line of the input contains integers $$$n$$$ ($$$1\le n \le 10^5$$$) and $$$k$$$ ($$$1 \le k \le 26$$$). The second line of the input contains the string $$$s$$$ of length $$$n$$$. String $$$s$$$ only contains uppercase letters from 'A' to the $$$k$$$-th letter of Latin alphabet. | ["6", "0"] | #include<stdio.h>
int main()
{
int n,m;
scanf("%d %d",&n,&m);
char s[n];
scanf("%s",&s);
int a[m],cnt=0;
for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)
{
if(s[j]==65+i)
cnt++;
}
a[i]=cnt;
cnt=0;
}
in... | |
You are given a string $$$s$$$ of length $$$n$$$, which consists only of the first $$$k$$$ letters of the Latin alphabet. All letters in string $$$s$$$ are uppercase.A subsequence of string $$$s$$$ is a string that can be derived from $$$s$$$ by deleting some of its symbols without changing the order of the remaining s... | Print the only integer — the length of the longest good subsequence of string $$$s$$$. | C | d9d5db63b1e48214d02abe9977709384 | 635c9d0e2292ae33698acd59671e2b61 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"strings"
] | 1536248100 | ["9 3\nACAABCCAB", "9 4\nABCABCABC"] | NoteIn the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.In the second example, none of the subsequences can have 'D', hence the answer is $$$0... | PASSED | 800 | standard input | 2 seconds | The first line of the input contains integers $$$n$$$ ($$$1\le n \le 10^5$$$) and $$$k$$$ ($$$1 \le k \le 26$$$). The second line of the input contains the string $$$s$$$ of length $$$n$$$. String $$$s$$$ only contains uppercase letters from 'A' to the $$$k$$$-th letter of Latin alphabet. | ["6", "0"] | #include<stdio.h>
int main()
{
int n,x,j,i,min=5000000;
scanf("%d%d",&n,&x);
char s[n+1];
int a[x];
for(i=0;i<x;i++)
a[i]=0;
scanf("%s",s);
for(i=0;i<x;i++)
{
for(j=0;j<n;j++)
{
if(s[j]=='A'+i)
a[i]++;
}
}
for(i=0;i... | |
You are given a string $$$s$$$ of length $$$n$$$, which consists only of the first $$$k$$$ letters of the Latin alphabet. All letters in string $$$s$$$ are uppercase.A subsequence of string $$$s$$$ is a string that can be derived from $$$s$$$ by deleting some of its symbols without changing the order of the remaining s... | Print the only integer — the length of the longest good subsequence of string $$$s$$$. | C | d9d5db63b1e48214d02abe9977709384 | 07fd0a7cd587cbcb6d4a03783cf8a35b | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"strings"
] | 1536248100 | ["9 3\nACAABCCAB", "9 4\nABCABCABC"] | NoteIn the first example, "ACBCAB" ("ACAABCCAB") is one of the subsequences that has the same frequency of 'A', 'B' and 'C'. Subsequence "CAB" also has the same frequency of these letters, but doesn't have the maximum possible length.In the second example, none of the subsequences can have 'D', hence the answer is $$$0... | PASSED | 800 | standard input | 2 seconds | The first line of the input contains integers $$$n$$$ ($$$1\le n \le 10^5$$$) and $$$k$$$ ($$$1 \le k \le 26$$$). The second line of the input contains the string $$$s$$$ of length $$$n$$$. String $$$s$$$ only contains uppercase letters from 'A' to the $$$k$$$-th letter of Latin alphabet. | ["6", "0"] | #include<stdio.h>
int main(void)
{
int i,n,k,min=100000,freq[26]={0};
scanf("%d %d",&n,&k);
char string[n+1];
scanf("%s",string);
for(i=0;string[i]!='\0';i++)
{
freq[string[i]-65]++;
}
for(i=0;i<k;i++)
{
min=min<freq[i]?min:freq[i];
}
printf("%d\n",min*k);
... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 1887d70f943681847617fbddedfb40c6 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
int closestCharacter(int* characters, int* startingIndex);
int main() {
int n, k;
int characters[26];
int randomNumber,lastTakenNumber = 0;
for (int i = 0; i < 26; i++) {
characters[i] = 0;
}
scanf("%d%d", &n, &k);
... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 05c235611f31e024b19dcc27261e1f76 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | /*
* Guillermo A. Vazquez A0172958
* Christian Estrada Quiroz A01700043
* 20/02/20
* Problema: CodeForces NewPassword
* Profesor: Pedro Perez
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(){
//Longitud de la palabra
int n;
scanf("%i",&n);
//Numero de symbolos
int k;
scanf("%i",&k);
//String... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 2a123f24594696c8b25db55b2b043416 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include <stdio.h>
int main(void)
{
int n, k;
scanf("%d %d", &n, &k);
char pass[n+1];
pass[n] = '\0';
for(int i = 0; i < k; i++)
{
pass[i] = i + 97;
}
int flag = 0;
int cnt = n-k;
for(int i = 0; i < cnt; i++)
{
if(!flag)
{
pass[k] = pa... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | dc3461d12396a2331832e76bdadfcabd | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include <stdio.h>
int main()
{
int n, k;
scanf("%i %i",&n,&k);
char password[n+1];
for(int i=0;i<k;i++)
{
password[i] = 97 + i;
}
int counter = n-k;
int last_round = 0;
while(counter--)
{
password[k] = password[last_round];
k++;
if(last_roun... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | b08caa190ec0d8e7271074350c81ddc0 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include <stdio.h>
#include <stdlib.h>
int main()
{
int number,distict,i,m=97,k=0;
char array[101];
scanf("%d %d",&number,&distict);
for(i=0;i<number;++i){
array[i]=(char)m;
m++;
k++;
if(k==distict){
m=97;
k=0;
}
if(m==123){
m=97;
}
}
for(i=0;i<number;++i){
print... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 5be20af1afad54c91e878fa6bf1bb98f | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include <stdio.h>
#include <stdlib.h>
int main()
{
int num,distinct,j=0,i,character=97;
scanf("%d %d",&num,&distinct);
for(i=0;i<num;++i){
printf("%c",character);
character++;
j++;
if(j==distinct){
character=97;
j=0;
}
}
return 0;
}
| |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | e712e64647bbabc1dccf0bcb4da46ad2 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
int main()
{
int n,k,i,a,b=0;
scanf("%d%d",&n,&k);
for(i=0; i<n; i++)
{
if(b>=k)
b=0;
a=97+b;
b++;
printf("%c",a);
}
}
| |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 3d1c25ff883a90347d8bb06322284e2d | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
#include<string.h>
int main()
{
int n,k,i,j,g,h;
char s[101],c;
scanf("%d %d",&n,&k);
for(i=0;i<k;i++)
{
s[i]='a'+i;
}
for(j=i,g=0;j<n;j++,g++)
{
s[j]=s[g];
}
s[j]='\0';
printf("%s\n",s);
return 0;
}
| |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 963ab12d1b83360f24aeee0697118ee9 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
#include<string.h>
int main()
{
int n,k;
scanf("%d %d",&n,&k);
int i,j,a=97;
for(i=0; i<n; i++){
printf("%c",a++);
if(a==97+k){
a=97;
}
}
return 0;
}
| |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | a8ef1dc88398a8898003d09dda34d8ca | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include <stdio.h>
#include <stdlib.h>
int main()
{
int n , k, t, z = 0;
scanf("%d %d", &n, &k);
t = n / k;
if (n % k != 0)
{
t++;
}
for (int i = 0; i < t; i++)
{
char c = 'a';
for (int j = 0; j < k; j++)
{
if (z == n)
{
... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 1c6f4681075394c7bb57978ff9cbb9db | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include <stdio.h>
int main(void)
{
char alphabet[26] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
int pass_len;
int syb_int_pass;
int i;
int k;
k = 0;
i = 0;
scanf("%d %d", &pass_len, &syb_int_pass);
char new_pass[pass_len];
new_pass[pas... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | a4ff281721bccde9c7fdf9958bb4cb4a | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
int main()
{
int n,k,i=0,j;
char ch[27]={"abcdefghijklmnopqrstuvwxyz"};
scanf("%d %d",&n,&k);
while(n--)
{
while(i<k){
printf("%c",ch[i]);
if(i==k-1)
{
i=0;
}
else
{
i++;
}
break;
}
}
}
| |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 8cfa88d85a597b7f04dec5477aeebb7e | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include <stdio.h>
#include <string.h>
int main()
{
int n, k;
char pass[101];
char letter[27];
int i;
int j = 0;
scanf("%i %i ", &n, &k);
for (i = 0; i < k; i++)
{
letter[i] = 'a' + i;
pass[i] = 'a' + i;
}
... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | cca2f2300150f3b636f60a4b17da23d3 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include <stdio.h>
#include <stdlib.h>
int main()
{
int x,y;
scanf("%d%d",&x,&y);
for (int i=0;i<y;i++)
printf("%c",97+i);
for (int i=y,j=2;i<x;i++,j++)
if (j%2==0)
printf("%c",97);
else
printf("%c",98);
return 0;
}
| |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | b0c901134994d8a6987f6edb328d8353 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
int main()
{
int a,b,i,r,j;
scanf("%d %d",&a,&b);
int store=a/b;
if(a==b)
{ int temp=97+b;
for(i=97;i<temp;i++)
printf("%c",i);
}
else if(a/b==1)
{
r=a%b;
int temp;
... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | f2f35ae70e28f5202d3785a1e9e90a55 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include <stdio.h>
int main()
{
int n , k ;
scanf("%d %d",&n,&k) ;
char ara[k] ;
for( int a = 0 ; a < k ; a++ ) {
ara[a] = 'a' + a ;
// printf("%c\n",ara[a]) ;
}
int b ;
for( b = 0 ; n > 0 ; b++ , n-- ) {
... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | dea87772a26022b3ceb424baa282f4e7 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
int main(){
int n, k;
scanf("%d %d", &n, &k);
char pass[n + 1];
pass[n] = '\0';
for(int i = 0, j = 0; i < n; i++, j++){
pass[i] = 97 + j;
if(j == (k - 1))
j = -1;
}
printf("%s", pass);
} | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | a42d46c9627780574e86951c58317f53 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include <stdio.h>
int main()
{
unsigned short n, k, i;
char c;
scanf("%hu%hu", &n, &k);
while(n){
c = 'a';
for(i = 1; i <= k && n; i++){ putchar(c); c++; n--; }
}
return 0;
}
| |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 42a6d49e753db803f31f10dcc49fc35c | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include <stdio.h>
int main()
{
unsigned short n, k, i, Comp;
scanf("%hu%hu", &n, &k);
k = n < k ? n : k;
char Char[k];
for( i = 0; i < k; i++ ){
Char[i] = 'a' + i;
printf("%c", Char[i]);
}
Comp = n - k;
i = 0;
while( Comp > 0 ){
printf("%c", Char[i]);
... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 13a38aecf491a293b63ce8cd05bc9802 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
int main()
{
int n,j,i,m,k;
char s[100];
scanf("%d %d",&n,&m);
s[0] = 'a';
for(i=0; i<m; i++)
{
printf("%c",s[0]+i);
}
k = n-m;
for(i=0; i<k; i++)
{
if(i%2==0)
{
printf("%c",s[0]);
}
else
{
prin... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | c436795b9c72c2dbb4291eb500d72453 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | int main(){
char ch = 'a';
int n,k,i,d=0,chMax =25;
scanf("%d %d",&n,&k);
char password[n+1];
password[n] = '\0';
for(i=0;i<n;i++){
if(i > 'z' | (ch - 'a') > chMax){
ch = 'a';
}
password[i] = ch;
ch = ch + 1;
d = d + 1;
if(d == k){
... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 12a19f23e962811ba0843c9883f7fbe1 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | int main(){
char ch = 'a';
int n,k,i,d=0;
scanf("%d %d",&n,&k);
char password[n+1];
password[n] = '\0';
for(i=0;i<n;i++){
if(i > 'z'){
ch = 'a';
}
password[i] = ch;
ch = ch + 1;
d = d + 1;
if(d == k){
ch = 'a';
... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 0a7ef261b9b69c6f82ff5d915c128c40 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
int main()
{
int n, k, i=0, j;
scanf("%d%d", &n, &k);
for(j=1;j<=n;j++)
{
printf("%c", 97+i);
i++;
if(i==k)
i=0;
}
return 0;
} | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 3f55f1d6b38c3f8b89b0bd543ca12507 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
#include<stdlib.h>
void fun(int ,int );
void fun(int n,int k)
{
int i=0;
int tmp=k;
while(i<n)
{
if(k==0)
{
k=tmp;
}
printf("%c",'a'+k-1);
k--;
i++;
}
}
int main()
{
int n,k;
scanf("%d%d",&n,&k);
fun(n,k);
... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | f43f3531826b655f902186950dfed126 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
int main()
{
int n,k,i,a=97;
scanf("%d%d",&n,&k);
for(i=1; i<=n; i++)
{
printf("%c",a++);
if(a==97+k)
{
a=97;
}
}
printf("\n");
}
| |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 236f926a94c646a9a9cce5b3d095caaf | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | /*
* Project.c
*
* Created on: Oct 5, 2020
* Author: lone_wolf
*/
#include <stdio.h>
#include <string.h>
int main(){
int x,y;
scanf("%d%d",&x,&y);
for(int i=0;i<x;i++){
printf("%c",(i%y)+ 97);
}
return(0);
}
| |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 5b822377e0ebb7adee8147a3674ad504 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
int main()
{
int n,k,f=0,g=0;
scanf("%d%d",&n,&k);
char ch='a',a,b;
for(int i=0;i<n;i++)
{
if(i<k)
{
printf("%c",ch);
ch++;
}
else
{
if(f==0)
{
a=ch-1;
b=ch-2;
f=1;
}
if(g==0)
{
printf("%c",b);
g=1;
}
else... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 236d1d74c622989acdf7faed9402bea4 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
int main()
{
int n,k,i,A;
scanf("%d",&n);
scanf("%d",&k);
for(i=0;i<n;i++)
{
printf("%c",(97+(i%k)));
}
return 0;
} | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 37f584f447a00f8c412d3801d6a44141 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
int main()
{
int n,s,b,c;
scanf("%d%d",&n,&s);
b=n-s;
char w='a';
for(int i=0;i<s;i++)
{
printf("%c",w++);
}
w='a';
for(int i=0;i<b;i++)
{
printf("%c",w++);
c=w-'a';
if(c==s)
w='a';
}
}
| |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 2580fa4a3551fedff171f5160c115155 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include <stdio.h>
#include <stdlib.h>
int main(void)
{
int n,k;
scanf("%d", &n);
scanf("%d", &k);
char s[n];
int a[k];
int j = 97;
for(int i=0; i<k; i++)
{
a[i] = j;
j++;
}
j = 0;
for(int i=0; i<n; i++)
{
s[i] = a[j];
j++;
if(j==k... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | aa7c50ae2f88cd53b67ddbbbb9f97321 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
int main()
{
char p[101],ch='a';
int n,k,i;
scanf("%d%d",&n,&k);
for(i=0;i<n;++i)
{
p[i]=ch;
if(ch=='a'+ k - 1)
ch='a';
else
++ch;
}
p[n]='\0';
//for(i=0;i<=n;i++)
// printf("%c",p[i]);
printf("%s",p);
return 0;
}
| |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 85365aac04d4b71613157018210e16e4 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include <stdio.h>
void solve(int n, int k, char* res) {
for(int i = 0; i * k < n; i++)
for(int j = 0; j < k; j++)
res[i * k + j] = 'a' + j;
}
int main(void) {
char str[110];
int n, k;
scanf("%d%d", &n, &k);
solve(n, k, str);
str[n] = '\0';
puts(str);
return 0;
} | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 980d0f4bb1d8ef596bfeb3e95e688645 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include <stdio.h>
void solve(int n, int k, char* res) {
for(int i = 0; i * k < n; i++)
for(int j = 0; j < k; j++)
res[i * k + j] = 'a' + j;
}
int main(void) {
char str[200];
int n, k;
scanf("%d%d", &n, &k);
solve(n, k, str);
str[n] = '\0';
puts(str);
return 0;
} | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | cc834f070ce08e744632774f35164176 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | //░░░
// ░ anzim bin nasir
// ░
#include<stdio.h>
int main()
{
char a[10000],i;
int n,k,j,check,x=0;
scanf("%d%d",&n,&k);
if(n%k)
check=n/k+1;
else
check=n/k;
for(i=1;i<=check;i++)
{
for(j=0;j<k&&x<n;j++)
{
a[x++]='a'+j;
}
}
a[x]='\0';
... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 8c1ed6e7461cee10287a224a808c2533 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
//#include<stdlib.h>
#include<string.h>
/*int comparator(const void *p1,const void *p2)
{
return (*(int*)p2-*(int*)p1);
}*/
int main()
{
//long long int s1,s2,s3,s4;
//scanf("%lld%lld%lld%lld",&s1,&s2,&s3,&s4);
//int x;
//scanf("%d",&x);
int n,k,count=0;
scanf("%d%d",&n,&k)... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 113d4e0a11d340b835466fb4bedd8cef | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
int main()
{
int n,k,i,j;
scanf("%d %d",&n,&k);
for(i=0;i<k;i++)
{
printf("%c",97+i);
}
for(i=k;i<n;i++)
{
if(i%2==0)
{
printf("%c",97);
}
else
{
printf("%c",98);
}
}
printf("\n");
re... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 6efae0efd5c6033ce11ee7d8f7510b31 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
#include<string.h>
int main() {
int i,j,n,k,l,p,m;
scanf("%d %d",&n,&k);
j=n/k;
l=n%k;
for(i=0;i<j;i++){
for(p=97;p<(97+k);p++){
printf("%c",p);
}
}
for(m=97;m<(97+l);m++){
printf("%c",m);
}
return 0;
} | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | d557079715f1f48a8ce6df15c52c00ef | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
int main()
{
int n,k;
int i;
scanf("%d%d", &n,&k);
for (i = 0; i < n; i++)
{
if (i > k-1)//如果条件成立,说明已经达到了k个不同的数字
{
/*i%k的意思是又从a开始取,i是不断地增加,k是不变的,i%k就可以依此变化 = 0,1,2....*/
printf("%c",(char)(i%k+'a'));
}
else
{
printf("%... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | ee7c8b1590ec01efbc6b012bd7588d26 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
int main(){
int n,k;
int i;
scanf("%d%d",&n,&k);
for(i = 0; i < n;i++){
if(i<k){
printf("%c",(char)(i+'a'));
}
else{
printf("%c",(char)(i%k+'a'));
}
}
} | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 9efaa561832a89a4baca3926cfaa0282 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
int main(){
int n,k;
int i;
scanf("%d%d",&n,&k);
for(i = 0; i < n;i++){
if(i<=k-1){
printf("%c",(char)(i+'a'));
}
else{
printf("%c",(char)(i%k+'a'));
}
}
} | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 5bc63a8683ab02ce0d82b74d4c4889e5 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include <stdio.h>
int main()
{
int n,k,i,j;
char str[101]={0};
scanf("%d %d", &n, &k);
for(i=0,j=0;i<n;i++,j++) {
if (j>k-1) j=0;
str[i]=j+'a';
}
printf("%s\n",str);
}
| |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 02b6cef4ac60ab1cab47df63e5976ff5 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
int main()
{
int n,m;
scanf("%d%d",&n,&m);
int i;
for(i=0;i<m;i++) printf("%c",97+i);
n=n-m;
//if(n<m)
//{
// for(i=0;i<n;i++) printf("%c",97);
// }
//else
//{
for(int a=1,i=0;a<=n;a++)
{
pr... | |
Innokentiy decides to change the password in the social net "Contact!", but he is too lazy to invent a new password by himself. That is why he needs your help. Innokentiy decides that new password should satisfy the following conditions: the length of the password must be equal to n, the password should consist only ... | Print any password which satisfies all conditions given by Innokentiy. | C | 39f5e934bf293053246bd3faa8061c3b | 124857299a91cc62594a116715e046c6 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"implementation",
"*special"
] | 1489233600 | ["4 3", "6 6", "5 2"] | NoteIn the first test there is one of the appropriate new passwords — java, because its length is equal to 4 and 3 distinct lowercase letters a, j and v are used in it.In the second test there is one of the appropriate new passwords — python, because its length is equal to 6 and it consists of 6 distinct lowercase lett... | PASSED | 800 | standard input | 1 second | The first line contains two positive integers n and k (2 ≤ n ≤ 100, 2 ≤ k ≤ min(n, 26)) — the length of the password and the number of distinct symbols in it. Pay attention that a desired new password always exists. | ["java", "python", "phphp"] | #include<stdio.h>
int main(void)
{
int i,j,n,k;
scanf("%d %d",&n,&k);
char string[n+1];
for(i=0,j=97;i<n;i++,j++)
{
if(i%k==0)
j=97;
string[i]=j;
}
string[i]='\0';
printf("%s",string);
return 0;
}
| |
In this task you need to process a set of stock exchange orders and use them to create order book.An order is an instruction of some participant to buy or sell stocks on stock exchange. The order number i has price pi, direction di — buy or sell, and integer qi. This means that the participant is ready to buy or sell q... | Print no more than 2s lines with aggregated orders from order book of depth s. The output format for orders should be the same as in input. | C | 267c04c77f97bbdf7697dc88c7bfa4af | 4c44db49fde1b8721fe429d716d64fe6 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"data structures",
"implementation",
"sortings",
"greedy"
] | 1440261000 | ["6 2\nB 10 3\nS 50 2\nS 40 1\nS 50 6\nB 20 4\nB 25 10"] | NoteDenote (x, y) an order with price x and volume y. There are 3 aggregated buy orders (10, 3), (20, 4), (25, 10) and two sell orders (50, 8), (40, 1) in the sample.You need to print no more than two best orders for each direction, so you shouldn't print the order (10 3) having the worst price among buy orders. | PASSED | 1,300 | standard input | 2 seconds | The input starts with two positive integers n and s (1 ≤ n ≤ 1000, 1 ≤ s ≤ 50), the number of orders and the book depth. Next n lines contains a letter di (either 'B' or 'S'), an integer pi (0 ≤ pi ≤ 105) and an integer qi (1 ≤ qi ≤ 104) — direction, price and volume respectively. The letter 'B' means buy, 'S' means se... | ["S 50 8\nS 40 1\nB 25 10\nB 20 4"] | #include <stdio.h>
int main ()
{
int vs[100010]={0};
int vb[100010]={0};
int n, s, i, p, q;
scanf("%d%d", &n, &s);
do
{
char d[5];
scanf("%s%d%d", &d, &p, &q);
if (d[0] == 'B')
vb[p]= vb[p] + q;
else
vs[p]= vs[p] + q;
n--;
} while ((n-1)>=0); // Lee mientras n sea distinto a 0, n-1 porque o sino... | |
In this task you need to process a set of stock exchange orders and use them to create order book.An order is an instruction of some participant to buy or sell stocks on stock exchange. The order number i has price pi, direction di — buy or sell, and integer qi. This means that the participant is ready to buy or sell q... | Print no more than 2s lines with aggregated orders from order book of depth s. The output format for orders should be the same as in input. | C | 267c04c77f97bbdf7697dc88c7bfa4af | 36b766c2111514b8b1dd29e9e166164a | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"data structures",
"implementation",
"sortings",
"greedy"
] | 1440261000 | ["6 2\nB 10 3\nS 50 2\nS 40 1\nS 50 6\nB 20 4\nB 25 10"] | NoteDenote (x, y) an order with price x and volume y. There are 3 aggregated buy orders (10, 3), (20, 4), (25, 10) and two sell orders (50, 8), (40, 1) in the sample.You need to print no more than two best orders for each direction, so you shouldn't print the order (10 3) having the worst price among buy orders. | PASSED | 1,300 | standard input | 2 seconds | The input starts with two positive integers n and s (1 ≤ n ≤ 1000, 1 ≤ s ≤ 50), the number of orders and the book depth. Next n lines contains a letter di (either 'B' or 'S'), an integer pi (0 ≤ pi ≤ 105) and an integer qi (1 ≤ qi ≤ 104) — direction, price and volume respectively. The letter 'B' means buy, 'S' means se... | ["S 50 8\nS 40 1\nB 25 10\nB 20 4"] | #include <stdio.h>
#include <stdlib.h>
struct orden
{
char direccion;
int precio;
int volumen;
};
void Quicksort(struct orden *unarray, int izq, int der);
int pivot(struct orden *unarray, int izq, int der);
int main()
{
int i,n,s,k,a=0,b=0,contador,contS=0,contB=0;
scanf("%d",&n);
scanf("%d",&s)... | |
In this task you need to process a set of stock exchange orders and use them to create order book.An order is an instruction of some participant to buy or sell stocks on stock exchange. The order number i has price pi, direction di — buy or sell, and integer qi. This means that the participant is ready to buy or sell q... | Print no more than 2s lines with aggregated orders from order book of depth s. The output format for orders should be the same as in input. | C | 267c04c77f97bbdf7697dc88c7bfa4af | dde1a5be1f64273934fbd2771d3e49a0 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"data structures",
"implementation",
"sortings",
"greedy"
] | 1440261000 | ["6 2\nB 10 3\nS 50 2\nS 40 1\nS 50 6\nB 20 4\nB 25 10"] | NoteDenote (x, y) an order with price x and volume y. There are 3 aggregated buy orders (10, 3), (20, 4), (25, 10) and two sell orders (50, 8), (40, 1) in the sample.You need to print no more than two best orders for each direction, so you shouldn't print the order (10 3) having the worst price among buy orders. | PASSED | 1,300 | standard input | 2 seconds | The input starts with two positive integers n and s (1 ≤ n ≤ 1000, 1 ≤ s ≤ 50), the number of orders and the book depth. Next n lines contains a letter di (either 'B' or 'S'), an integer pi (0 ≤ pi ≤ 105) and an integer qi (1 ≤ qi ≤ 104) — direction, price and volume respectively. The letter 'B' means buy, 'S' means se... | ["S 50 8\nS 40 1\nB 25 10\nB 20 4"] | #include<stdio.h>
typedef struct{
char direccion;
int precio;
int volumen;
}book;
int max=0;
void unificar(book *lib, int dim);
int main(){
int i,n,profundidad,contB=0,contS=0;
scanf("%d %d",&n,&profundidad);
book libro[n]; // el vector libro contiene todas las compras y ventas que ing... | |
In this task you need to process a set of stock exchange orders and use them to create order book.An order is an instruction of some participant to buy or sell stocks on stock exchange. The order number i has price pi, direction di — buy or sell, and integer qi. This means that the participant is ready to buy or sell q... | Print no more than 2s lines with aggregated orders from order book of depth s. The output format for orders should be the same as in input. | C | 267c04c77f97bbdf7697dc88c7bfa4af | 7ab3fa221f1f812cc5595a077a889e8b | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"data structures",
"implementation",
"sortings",
"greedy"
] | 1440261000 | ["6 2\nB 10 3\nS 50 2\nS 40 1\nS 50 6\nB 20 4\nB 25 10"] | NoteDenote (x, y) an order with price x and volume y. There are 3 aggregated buy orders (10, 3), (20, 4), (25, 10) and two sell orders (50, 8), (40, 1) in the sample.You need to print no more than two best orders for each direction, so you shouldn't print the order (10 3) having the worst price among buy orders. | PASSED | 1,300 | standard input | 2 seconds | The input starts with two positive integers n and s (1 ≤ n ≤ 1000, 1 ≤ s ≤ 50), the number of orders and the book depth. Next n lines contains a letter di (either 'B' or 'S'), an integer pi (0 ≤ pi ≤ 105) and an integer qi (1 ≤ qi ≤ 104) — direction, price and volume respectively. The letter 'B' means buy, 'S' means se... | ["S 50 8\nS 40 1\nB 25 10\nB 20 4"] | #include<stdio.h>
typedef struct{
char direccion;
int precio;
int volumen;
}book;
int max=0;
void bolsa2(book *lib, int profundidad, int dim);
void bolsa(book *lib, int profundidad, int dim);
void cerar(book *lib, int dim);
int contar(book *lib, int dim);
void Quicksort(book *unarray, int izq, int der);
... | |
In this task you need to process a set of stock exchange orders and use them to create order book.An order is an instruction of some participant to buy or sell stocks on stock exchange. The order number i has price pi, direction di — buy or sell, and integer qi. This means that the participant is ready to buy or sell q... | Print no more than 2s lines with aggregated orders from order book of depth s. The output format for orders should be the same as in input. | C | 267c04c77f97bbdf7697dc88c7bfa4af | 32ee30ec7bc62b0d18c82f47156af878 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"data structures",
"implementation",
"sortings",
"greedy"
] | 1440261000 | ["6 2\nB 10 3\nS 50 2\nS 40 1\nS 50 6\nB 20 4\nB 25 10"] | NoteDenote (x, y) an order with price x and volume y. There are 3 aggregated buy orders (10, 3), (20, 4), (25, 10) and two sell orders (50, 8), (40, 1) in the sample.You need to print no more than two best orders for each direction, so you shouldn't print the order (10 3) having the worst price among buy orders. | PASSED | 1,300 | standard input | 2 seconds | The input starts with two positive integers n and s (1 ≤ n ≤ 1000, 1 ≤ s ≤ 50), the number of orders and the book depth. Next n lines contains a letter di (either 'B' or 'S'), an integer pi (0 ≤ pi ≤ 105) and an integer qi (1 ≤ qi ≤ 104) — direction, price and volume respectively. The letter 'B' means buy, 'S' means se... | ["S 50 8\nS 40 1\nB 25 10\nB 20 4"] | #include <stdio.h>
#include <stdlib.h>
struct orden
{
char direccion;
int precio;
int volumen;
};
void Quicksort(struct orden *unarray, int izq, int der);
int pivot(struct orden *unarray, int izq, int der);
int main()
{
int i,n,s,k,a=0,b=0,contador,contS=0,contB=0;
scanf("%d",&n);
scanf("%d",&s)... | |
In this task you need to process a set of stock exchange orders and use them to create order book.An order is an instruction of some participant to buy or sell stocks on stock exchange. The order number i has price pi, direction di — buy or sell, and integer qi. This means that the participant is ready to buy or sell q... | Print no more than 2s lines with aggregated orders from order book of depth s. The output format for orders should be the same as in input. | C | 267c04c77f97bbdf7697dc88c7bfa4af | 1626e6abc545599cce13f806595c671c | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"data structures",
"implementation",
"sortings",
"greedy"
] | 1440261000 | ["6 2\nB 10 3\nS 50 2\nS 40 1\nS 50 6\nB 20 4\nB 25 10"] | NoteDenote (x, y) an order with price x and volume y. There are 3 aggregated buy orders (10, 3), (20, 4), (25, 10) and two sell orders (50, 8), (40, 1) in the sample.You need to print no more than two best orders for each direction, so you shouldn't print the order (10 3) having the worst price among buy orders. | PASSED | 1,300 | standard input | 2 seconds | The input starts with two positive integers n and s (1 ≤ n ≤ 1000, 1 ≤ s ≤ 50), the number of orders and the book depth. Next n lines contains a letter di (either 'B' or 'S'), an integer pi (0 ≤ pi ≤ 105) and an integer qi (1 ≤ qi ≤ 104) — direction, price and volume respectively. The letter 'B' means buy, 'S' means se... | ["S 50 8\nS 40 1\nB 25 10\nB 20 4"] | #include<stdio.h>
typedef struct{
char direccion;
int precio;
int volumen;
}book;
int max=0;
void unificar(book *lib, int dim);
int main(){
int i,n,profundidad,contB=0,contS=0;
scanf("%d %d",&n,&profundidad);
book libro[n];
int b=0,s=0;
int contador=0;
int b1=0,s1=0;
cerar(li... | |
In this task you need to process a set of stock exchange orders and use them to create order book.An order is an instruction of some participant to buy or sell stocks on stock exchange. The order number i has price pi, direction di — buy or sell, and integer qi. This means that the participant is ready to buy or sell q... | Print no more than 2s lines with aggregated orders from order book of depth s. The output format for orders should be the same as in input. | C | 267c04c77f97bbdf7697dc88c7bfa4af | 79fac3068ceec958fcac7e15807b5222 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"data structures",
"implementation",
"sortings",
"greedy"
] | 1440261000 | ["6 2\nB 10 3\nS 50 2\nS 40 1\nS 50 6\nB 20 4\nB 25 10"] | NoteDenote (x, y) an order with price x and volume y. There are 3 aggregated buy orders (10, 3), (20, 4), (25, 10) and two sell orders (50, 8), (40, 1) in the sample.You need to print no more than two best orders for each direction, so you shouldn't print the order (10 3) having the worst price among buy orders. | PASSED | 1,300 | standard input | 2 seconds | The input starts with two positive integers n and s (1 ≤ n ≤ 1000, 1 ≤ s ≤ 50), the number of orders and the book depth. Next n lines contains a letter di (either 'B' or 'S'), an integer pi (0 ≤ pi ≤ 105) and an integer qi (1 ≤ qi ≤ 104) — direction, price and volume respectively. The letter 'B' means buy, 'S' means se... | ["S 50 8\nS 40 1\nB 25 10\nB 20 4"] | #include<stdio.h>
typedef struct{
char direccion;
int precio;
int volumen;
}book;
int max=0;
void unificar(book *lib, int dim);
int main(){
int i,n,profundidad,contB=0,contS=0;
scanf("%d %d",&n,&profundidad);
book libro[n]; // el vector libro contiene todas las compras y ventas que ing... | |
In this task you need to process a set of stock exchange orders and use them to create order book.An order is an instruction of some participant to buy or sell stocks on stock exchange. The order number i has price pi, direction di — buy or sell, and integer qi. This means that the participant is ready to buy or sell q... | Print no more than 2s lines with aggregated orders from order book of depth s. The output format for orders should be the same as in input. | C | 267c04c77f97bbdf7697dc88c7bfa4af | f6d087ff5322970486958ac31317ed40 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"data structures",
"implementation",
"sortings",
"greedy"
] | 1440261000 | ["6 2\nB 10 3\nS 50 2\nS 40 1\nS 50 6\nB 20 4\nB 25 10"] | NoteDenote (x, y) an order with price x and volume y. There are 3 aggregated buy orders (10, 3), (20, 4), (25, 10) and two sell orders (50, 8), (40, 1) in the sample.You need to print no more than two best orders for each direction, so you shouldn't print the order (10 3) having the worst price among buy orders. | PASSED | 1,300 | standard input | 2 seconds | The input starts with two positive integers n and s (1 ≤ n ≤ 1000, 1 ≤ s ≤ 50), the number of orders and the book depth. Next n lines contains a letter di (either 'B' or 'S'), an integer pi (0 ≤ pi ≤ 105) and an integer qi (1 ≤ qi ≤ 104) — direction, price and volume respectively. The letter 'B' means buy, 'S' means se... | ["S 50 8\nS 40 1\nB 25 10\nB 20 4"] | #include <stdio.h>
// eje6 tp
typedef struct {
char d;
int p;
int q;
}negocio;
void ordenacionshell (negocio v[], int n);
void comparar (negocio v[], int n);
void imprimir (negocio compra[], negocio venta[], int n, int s);
int main () {
int n, s, i, j = 0, z = 0 ;
scanf ("%d %d", &n, &s);
negocio v[n];
negoci... | |
In this task you need to process a set of stock exchange orders and use them to create order book.An order is an instruction of some participant to buy or sell stocks on stock exchange. The order number i has price pi, direction di — buy or sell, and integer qi. This means that the participant is ready to buy or sell q... | Print no more than 2s lines with aggregated orders from order book of depth s. The output format for orders should be the same as in input. | C | 267c04c77f97bbdf7697dc88c7bfa4af | cd0db02a6c92b2faba20ea07db1749e6 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"data structures",
"implementation",
"sortings",
"greedy"
] | 1440261000 | ["6 2\nB 10 3\nS 50 2\nS 40 1\nS 50 6\nB 20 4\nB 25 10"] | NoteDenote (x, y) an order with price x and volume y. There are 3 aggregated buy orders (10, 3), (20, 4), (25, 10) and two sell orders (50, 8), (40, 1) in the sample.You need to print no more than two best orders for each direction, so you shouldn't print the order (10 3) having the worst price among buy orders. | PASSED | 1,300 | standard input | 2 seconds | The input starts with two positive integers n and s (1 ≤ n ≤ 1000, 1 ≤ s ≤ 50), the number of orders and the book depth. Next n lines contains a letter di (either 'B' or 'S'), an integer pi (0 ≤ pi ≤ 105) and an integer qi (1 ≤ qi ≤ 104) — direction, price and volume respectively. The letter 'B' means buy, 'S' means se... | ["S 50 8\nS 40 1\nB 25 10\nB 20 4"] | #include<stdio.h>
#include<string.h>
int main()
{
int i,j,b=1,s=1,n,m,temp;
scanf("%d %d",&n,&m);
long long int b_c[n+1][2],s_c[n+1][2];
s_c[0][0]=99999999;
char c[2];
for(i=1;i<=n;i++)
{
scanf("%s",&c);
if(strcmp(c,"S")==0)
{
scanf("%lld %lld",&s_c[s][0]... | |
You are given two circles. Find the area of their intersection. | Print the area of the intersection of the circles. The answer will be considered correct if the absolute or relative error doesn't exceed 10 - 6. | C | 94d98a05741019f648693085d2f08872 | 6d74c294d6be270a958b7de28bead052 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"geometry"
] | 1448636400 | ["0 0 4\n6 0 4", "0 0 5\n11 0 5"] | null | PASSED | 2,000 | standard input | 2 seconds | The first line contains three integers x1, y1, r1 ( - 109 ≤ x1, y1 ≤ 109, 1 ≤ r1 ≤ 109) — the position of the center and the radius of the first circle. The second line contains three integers x2, y2, r2 ( - 109 ≤ x2, y2 ≤ 109, 1 ≤ r2 ≤ 109) — the position of the center and the radius of the second circle. | ["7.25298806364175601379", "0.00000000000000000000"] | #include <stdio.h>
#include <math.h>
int main(void)
{
int x1, y1, r1, x2, y2, r2;
scanf("%d %d %d %d %d %d", &x1, &y1, &r1, &x2, &y2, &r2);
long double d = sqrtl((long double) (x1 - x2) * (x1 - x2) + (long double) (y1 - y2) * (y1 - y2));
int minr = r1 <= r2 ? r1 : r2, maxr = r1 >= r2 ? r1 : r2;
if ... | |
You are given two circles. Find the area of their intersection. | Print the area of the intersection of the circles. The answer will be considered correct if the absolute or relative error doesn't exceed 10 - 6. | C | 94d98a05741019f648693085d2f08872 | 2f35214f7cfeb04a4d8cd7c3e744359d | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"geometry"
] | 1448636400 | ["0 0 4\n6 0 4", "0 0 5\n11 0 5"] | null | PASSED | 2,000 | standard input | 2 seconds | The first line contains three integers x1, y1, r1 ( - 109 ≤ x1, y1 ≤ 109, 1 ≤ r1 ≤ 109) — the position of the center and the radius of the first circle. The second line contains three integers x2, y2, r2 ( - 109 ≤ x2, y2 ≤ 109, 1 ≤ r2 ≤ 109) — the position of the center and the radius of the second circle. | ["7.25298806364175601379", "0.00000000000000000000"] | #include <stdio.h>
#include <math.h>
#define M_PI 3.14159265358979323846264338327950288
long double min(long double a, long double b) {
return a < b ? a : b;
}
long double f(long double r1, long double r2, long double d) {
long double a = acosl((r2*r2 + d*d - r1*r1) / (2*r2*d));
long double s = a*r2*r2;
long dou... | |
You are given two circles. Find the area of their intersection. | Print the area of the intersection of the circles. The answer will be considered correct if the absolute or relative error doesn't exceed 10 - 6. | C | 94d98a05741019f648693085d2f08872 | 26cf054463d8e25f69531d949b062611 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"geometry"
] | 1448636400 | ["0 0 4\n6 0 4", "0 0 5\n11 0 5"] | null | PASSED | 2,000 | standard input | 2 seconds | The first line contains three integers x1, y1, r1 ( - 109 ≤ x1, y1 ≤ 109, 1 ≤ r1 ≤ 109) — the position of the center and the radius of the first circle. The second line contains three integers x2, y2, r2 ( - 109 ≤ x2, y2 ≤ 109, 1 ≤ r2 ≤ 109) — the position of the center and the radius of the second circle. | ["7.25298806364175601379", "0.00000000000000000000"] | /* upsolve following Dukkha */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define PI (acos(-1))
#define ABS(x) ((x) < 0 ? -(x) : (x))
#define N 50
void shift1(int *aa) {
int i;
for (i = N - 1; i > 0; i--)
aa[i] = aa[i - 1];
aa[0] = 0;
}
void subtract(int *aa, int *bb) {
int i... | |
You are given two circles. Find the area of their intersection. | Print the area of the intersection of the circles. The answer will be considered correct if the absolute or relative error doesn't exceed 10 - 6. | C | 94d98a05741019f648693085d2f08872 | 5babd997ecb753041bf4b6c14dc0bee1 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"geometry"
] | 1448636400 | ["0 0 4\n6 0 4", "0 0 5\n11 0 5"] | null | PASSED | 2,000 | standard input | 2 seconds | The first line contains three integers x1, y1, r1 ( - 109 ≤ x1, y1 ≤ 109, 1 ≤ r1 ≤ 109) — the position of the center and the radius of the first circle. The second line contains three integers x2, y2, r2 ( - 109 ≤ x2, y2 ≤ 109, 1 ≤ r2 ≤ 109) — the position of the center and the radius of the second circle. | ["7.25298806364175601379", "0.00000000000000000000"] | #include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<inttypes.h>
int main()
{
int64_t x1,x2,y1,y2,r1,r2,e,f,h;
scanf("%" PRId64 "%" PRId64 "%" PRId64,&x1,&y1,&r1);
scanf("%" PRId64 "%" PRId64 "%" PRId64,&x2,&y2,&r2);
long double p,k1,k2,g,pi=3.141592653589793;
e=x2-x1;
f=y2-y1;
if(r1<=r2)
{
h=r1;
g=(long do... | |
You are given two circles. Find the area of their intersection. | Print the area of the intersection of the circles. The answer will be considered correct if the absolute or relative error doesn't exceed 10 - 6. | C | 94d98a05741019f648693085d2f08872 | a810626ea7c874f88a6f90e164860f68 | GNU C11 | standard output | 256 megabytes | train_003.jsonl | [
"geometry"
] | 1448636400 | ["0 0 4\n6 0 4", "0 0 5\n11 0 5"] | null | PASSED | 2,000 | standard input | 2 seconds | The first line contains three integers x1, y1, r1 ( - 109 ≤ x1, y1 ≤ 109, 1 ≤ r1 ≤ 109) — the position of the center and the radius of the first circle. The second line contains three integers x2, y2, r2 ( - 109 ≤ x2, y2 ≤ 109, 1 ≤ r2 ≤ 109) — the position of the center and the radius of the second circle. | ["7.25298806364175601379", "0.00000000000000000000"] | #include<stdio.h>
#include<math.h>
long long min(long long a,long long b){
return (a<b)?a:b;
}
long double sqr(long long x){
return (long double)(x*x);
}
int main(){
long double pi=(long double)(acosl(-1.0L));
long long x1,y1,r1;
long long x2,y2,r2;
scanf("%lld%lld%lld",&x1,&y1,&r1);
... | |
Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:(1n + 2n + 3n + 4n) mod 5for given value of n. Fedya managed to complete the task. Can you? Note that given number n can be extremely large (e.g. it can exceed any integer type of your programming language). | Print the value of the expression without leading zeros. | C | 74cbcbafbffc363137a02697952a8539 | 028e34cf2899ca76562433c046d9cee2 | GNU C | standard output | 256 megabytes | train_003.jsonl | [
"number theory",
"math"
] | 1407511800 | ["4", "124356983594583453458888889"] | NoteOperation x mod y means taking remainder after division x by y.Note to the first sample: | PASSED | 1,200 | standard input | 1 second | The single line contains a single integer n (0 ≤ n ≤ 10105). The number doesn't contain any leading zeroes. | ["4", "0"] | #include "stdio.h"
#include "string.h"
int main()
{
int m;
char s[1000001];
scanf("%s",s);
int l=strlen(s);
int unit=s[l-1]-'0',ten=s[l-2]-'0';
int number=ten*10+unit;
if(number%4==0)
printf("4\n");
else
printf("0\n");
return 0;
} | |
Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:(1n + 2n + 3n + 4n) mod 5for given value of n. Fedya managed to complete the task. Can you? Note that given number n can be extremely large (e.g. it can exceed any integer type of your programming language). | Print the value of the expression without leading zeros. | C | 74cbcbafbffc363137a02697952a8539 | 44fa271d843602e7ec7e37734a038e38 | GNU C | standard output | 256 megabytes | train_003.jsonl | [
"number theory",
"math"
] | 1407511800 | ["4", "124356983594583453458888889"] | NoteOperation x mod y means taking remainder after division x by y.Note to the first sample: | PASSED | 1,200 | standard input | 1 second | The single line contains a single integer n (0 ≤ n ≤ 10105). The number doesn't contain any leading zeroes. | ["4", "0"] | #include<stdio.h>
int main(){
int a,sum ,i;
scanf("%d",&a);
a %= 100;
if(a % 4 == 0 )
printf("4\n");
else printf("0\n");
return 0;
} | |
Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:(1n + 2n + 3n + 4n) mod 5for given value of n. Fedya managed to complete the task. Can you? Note that given number n can be extremely large (e.g. it can exceed any integer type of your programming language). | Print the value of the expression without leading zeros. | C | 74cbcbafbffc363137a02697952a8539 | 7c5c794fdeb46975a1508f72073a37af | GNU C | standard output | 256 megabytes | train_003.jsonl | [
"number theory",
"math"
] | 1407511800 | ["4", "124356983594583453458888889"] | NoteOperation x mod y means taking remainder after division x by y.Note to the first sample: | PASSED | 1,200 | standard input | 1 second | The single line contains a single integer n (0 ≤ n ≤ 10105). The number doesn't contain any leading zeroes. | ["4", "0"] | #include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
long long int n,k,l,p,j;
scanf("%d",&n);
if(n%4==0)
{
printf("4");
}
else
{
printf("0");
}
} | |
Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:(1n + 2n + 3n + 4n) mod 5for given value of n. Fedya managed to complete the task. Can you? Note that given number n can be extremely large (e.g. it can exceed any integer type of your programming language). | Print the value of the expression without leading zeros. | C | 74cbcbafbffc363137a02697952a8539 | a0994d86c7a2f139fbcccc030f42a057 | GNU C | standard output | 256 megabytes | train_003.jsonl | [
"number theory",
"math"
] | 1407511800 | ["4", "124356983594583453458888889"] | NoteOperation x mod y means taking remainder after division x by y.Note to the first sample: | PASSED | 1,200 | standard input | 1 second | The single line contains a single integer n (0 ≤ n ≤ 10105). The number doesn't contain any leading zeroes. | ["4", "0"] | #include<stdio.h>
char arr[100000];
int main()
{
scanf("%s",arr);
int n,a;
n=strlen(arr);
if(n==1)
{
a=arr[0]-'0';
a=a%4;
}
else
{
a=arr[n-2]*10+arr[n-1];
a=a%4;
}
if(a==0)
printf("4");
else
{
printf("0");
}
return ... | |
Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:(1n + 2n + 3n + 4n) mod 5for given value of n. Fedya managed to complete the task. Can you? Note that given number n can be extremely large (e.g. it can exceed any integer type of your programming language). | Print the value of the expression without leading zeros. | C | 74cbcbafbffc363137a02697952a8539 | 9dbc48579752130cef1ea05cce262004 | GNU C | standard output | 256 megabytes | train_003.jsonl | [
"number theory",
"math"
] | 1407511800 | ["4", "124356983594583453458888889"] | NoteOperation x mod y means taking remainder after division x by y.Note to the first sample: | PASSED | 1,200 | standard input | 1 second | The single line contains a single integer n (0 ≤ n ≤ 10105). The number doesn't contain any leading zeroes. | ["4", "0"] | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int t,o,len,num;
char s[1000000];
gets(s);
len = strlen(s);
t = s[len-2] - 48;
o = s[len-1] - 48;
num = t*10+o;
if(t == 0 && o ==0){
printf("4");
}
else if(num != 0 && num%4 == 0){
printf("4"... | |
Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:(1n + 2n + 3n + 4n) mod 5for given value of n. Fedya managed to complete the task. Can you? Note that given number n can be extremely large (e.g. it can exceed any integer type of your programming language). | Print the value of the expression without leading zeros. | C | 74cbcbafbffc363137a02697952a8539 | a1cec31c5b96fff4b94d0c17a0a84ca4 | GNU C | standard output | 256 megabytes | train_003.jsonl | [
"number theory",
"math"
] | 1407511800 | ["4", "124356983594583453458888889"] | NoteOperation x mod y means taking remainder after division x by y.Note to the first sample: | PASSED | 1,200 | standard input | 1 second | The single line contains a single integer n (0 ≤ n ≤ 10105). The number doesn't contain any leading zeroes. | ["4", "0"] | #include<stdio.h>
int main()
{
int n;
scanf("%d", &n);
if (n % 4 == 0)
{
printf("4\n");
}
else
{
printf("0\n");
}
return 0;
} | |
Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:(1n + 2n + 3n + 4n) mod 5for given value of n. Fedya managed to complete the task. Can you? Note that given number n can be extremely large (e.g. it can exceed any integer type of your programming language). | Print the value of the expression without leading zeros. | C | 74cbcbafbffc363137a02697952a8539 | f9e4041e9fd70d05844937950acbbae2 | GNU C | standard output | 256 megabytes | train_003.jsonl | [
"number theory",
"math"
] | 1407511800 | ["4", "124356983594583453458888889"] | NoteOperation x mod y means taking remainder after division x by y.Note to the first sample: | PASSED | 1,200 | standard input | 1 second | The single line contains a single integer n (0 ≤ n ≤ 10105). The number doesn't contain any leading zeroes. | ["4", "0"] | #include <stdio.h>
#include <string.h>
char s[100000000];
int main(void) {
char s[1000000];
scanf("%s",s);
int l=0; int i;
for(i=0;s[i]!='\0';i++)
{
l++;
}
int n=(s[l-2]-'0')*10+(s[l-1]-'0');
if(n%4==0)
printf("4\n");
else
printf("0\n");
return 0;
}
| |
Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:(1n + 2n + 3n + 4n) mod 5for given value of n. Fedya managed to complete the task. Can you? Note that given number n can be extremely large (e.g. it can exceed any integer type of your programming language). | Print the value of the expression without leading zeros. | C | 74cbcbafbffc363137a02697952a8539 | 13d7614c5ed32ee4efc8efa0acddfef5 | GNU C | standard output | 256 megabytes | train_003.jsonl | [
"number theory",
"math"
] | 1407511800 | ["4", "124356983594583453458888889"] | NoteOperation x mod y means taking remainder after division x by y.Note to the first sample: | PASSED | 1,200 | standard input | 1 second | The single line contains a single integer n (0 ≤ n ≤ 10105). The number doesn't contain any leading zeroes. | ["4", "0"] | #include<stdio.h>
#include<string.h>
int main()
{ char a[100000];
scanf("%s",a);
int d,sol=1,x=0;
d=strlen(a);
if(a[d-1]%2==0)
sol+=1;
else sol-=1;
x+=(a[d-1]);
x+=((a[d-2])*10);
x%=4;
if(x==0)
printf("4");
else printf("0");
return 0;
}
| |
Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:(1n + 2n + 3n + 4n) mod 5for given value of n. Fedya managed to complete the task. Can you? Note that given number n can be extremely large (e.g. it can exceed any integer type of your programming language). | Print the value of the expression without leading zeros. | C | 74cbcbafbffc363137a02697952a8539 | 6fae6aa679f0575a88be923ab86f9a17 | GNU C | standard output | 256 megabytes | train_003.jsonl | [
"number theory",
"math"
] | 1407511800 | ["4", "124356983594583453458888889"] | NoteOperation x mod y means taking remainder after division x by y.Note to the first sample: | PASSED | 1,200 | standard input | 1 second | The single line contains a single integer n (0 ≤ n ≤ 10105). The number doesn't contain any leading zeroes. | ["4", "0"] | #include<stdio.h>
int main()
{
int n,x;
scanf("%d", &n);
if(n%4 == 0)
{
x=4;
}
else
{
x=0;
}
printf("%d\n", x);
return 0;
} | |
Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:(1n + 2n + 3n + 4n) mod 5for given value of n. Fedya managed to complete the task. Can you? Note that given number n can be extremely large (e.g. it can exceed any integer type of your programming language). | Print the value of the expression without leading zeros. | C | 74cbcbafbffc363137a02697952a8539 | 0cb4a8ae82db97e8849ac5b5c26b331d | GNU C | standard output | 256 megabytes | train_003.jsonl | [
"number theory",
"math"
] | 1407511800 | ["4", "124356983594583453458888889"] | NoteOperation x mod y means taking remainder after division x by y.Note to the first sample: | PASSED | 1,200 | standard input | 1 second | The single line contains a single integer n (0 ≤ n ≤ 10105). The number doesn't contain any leading zeroes. | ["4", "0"] | #include<stdio.h>
int main()
{
long int n;
scanf("%ld",&n);
if(n%4==0)
printf("4");
else
printf("0");
return 0;
} | |
Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:(1n + 2n + 3n + 4n) mod 5for given value of n. Fedya managed to complete the task. Can you? Note that given number n can be extremely large (e.g. it can exceed any integer type of your programming language). | Print the value of the expression without leading zeros. | C | 74cbcbafbffc363137a02697952a8539 | 17ac38f2153c9e72c3c4eb694909f5f1 | GNU C | standard output | 256 megabytes | train_003.jsonl | [
"number theory",
"math"
] | 1407511800 | ["4", "124356983594583453458888889"] | NoteOperation x mod y means taking remainder after division x by y.Note to the first sample: | PASSED | 1,200 | standard input | 1 second | The single line contains a single integer n (0 ≤ n ≤ 10105). The number doesn't contain any leading zeroes. | ["4", "0"] | #include <stdio.h>
#include <stdlib.h>
int main()
{
int len = 200000;
char number[len];
scanf("%s", number);
int mode = 1;
int lng = strlen(number);
if (lng > 1) {
int two = (number[lng-2] - '0') * 10 + (number[lng-1] - '0');
two %= 4;
//2 4 3 1
switch(two) {... | |
Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:(1n + 2n + 3n + 4n) mod 5for given value of n. Fedya managed to complete the task. Can you? Note that given number n can be extremely large (e.g. it can exceed any integer type of your programming language). | Print the value of the expression without leading zeros. | C | 74cbcbafbffc363137a02697952a8539 | a4d6754678d1078623c2778ec1c26b12 | GNU C | standard output | 256 megabytes | train_003.jsonl | [
"number theory",
"math"
] | 1407511800 | ["4", "124356983594583453458888889"] | NoteOperation x mod y means taking remainder after division x by y.Note to the first sample: | PASSED | 1,200 | standard input | 1 second | The single line contains a single integer n (0 ≤ n ≤ 10105). The number doesn't contain any leading zeroes. | ["4", "0"] |
#include<stdio.h>
#include<string.h>
int findmod(char [],int);
int main()
{
int n,i,j,res,res1,res2,res3,res4;
char ar[100003];
res1=1;
res2=1;
res3=1;res4=1;
scanf("%s",ar);
//printf("%d\n",findmod(ar,2));
if(findmod(ar,4)==0)
{
res2=1;
res3=1;
}
else if(findmod(ar,4)==2)
{
res2=4;
... | |
Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:(1n + 2n + 3n + 4n) mod 5for given value of n. Fedya managed to complete the task. Can you? Note that given number n can be extremely large (e.g. it can exceed any integer type of your programming language). | Print the value of the expression without leading zeros. | C | 74cbcbafbffc363137a02697952a8539 | 35467d1946a9a5137a6cda74ff2d9e35 | GNU C | standard output | 256 megabytes | train_003.jsonl | [
"number theory",
"math"
] | 1407511800 | ["4", "124356983594583453458888889"] | NoteOperation x mod y means taking remainder after division x by y.Note to the first sample: | PASSED | 1,200 | standard input | 1 second | The single line contains a single integer n (0 ≤ n ≤ 10105). The number doesn't contain any leading zeroes. | ["4", "0"] | #include <stdio.h>
#include<string.h>
int i, j, k, l, m, n, x, y, len, temp_1, temp_2, temp_3, temp_4, ans;
char str[400000];
int main()
{
scanf("%s", str);
len = strlen(str);
if(len == 1 && str[len - 1] == '0'){
printf("%d", 4);
return 0;
}
if(len == 1) n = str[len - 1] - '0';
... | |
Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:(1n + 2n + 3n + 4n) mod 5for given value of n. Fedya managed to complete the task. Can you? Note that given number n can be extremely large (e.g. it can exceed any integer type of your programming language). | Print the value of the expression without leading zeros. | C | 74cbcbafbffc363137a02697952a8539 | cb2eb4c4eb427ee6fa0dc24ccd46cb6f | GNU C | standard output | 256 megabytes | train_003.jsonl | [
"number theory",
"math"
] | 1407511800 | ["4", "124356983594583453458888889"] | NoteOperation x mod y means taking remainder after division x by y.Note to the first sample: | PASSED | 1,200 | standard input | 1 second | The single line contains a single integer n (0 ≤ n ≤ 10105). The number doesn't contain any leading zeroes. | ["4", "0"] | /*
###############################
“It ain't over till it's over.”
############dheeraj############
*/
#include <stdio.h>
#define ll long long
#define rep(i,n) for(int i = 0;i < n; ++i)
#define repn(i,n) for(int i = 0;i < n; --i)
#define reb(i,n) for(int i = n-1;i >= 0; --i)
#define mp make_pair
#define fill... | |
Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:(1n + 2n + 3n + 4n) mod 5for given value of n. Fedya managed to complete the task. Can you? Note that given number n can be extremely large (e.g. it can exceed any integer type of your programming language). | Print the value of the expression without leading zeros. | C | 74cbcbafbffc363137a02697952a8539 | be8abf6c6c03d72c7c2db92483f4a754 | GNU C | standard output | 256 megabytes | train_003.jsonl | [
"number theory",
"math"
] | 1407511800 | ["4", "124356983594583453458888889"] | NoteOperation x mod y means taking remainder after division x by y.Note to the first sample: | PASSED | 1,200 | standard input | 1 second | The single line contains a single integer n (0 ≤ n ≤ 10105). The number doesn't contain any leading zeroes. | ["4", "0"] | #include <stdio.h>
#include <string.h>
main(){
char a[100005];
scanf("%s",a);
printf("%d",(((a[strlen(a)-2]-'0')*10+(a[strlen(a)-1]-'0'))%4==0)*4);
}
| |
Fedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:(1n + 2n + 3n + 4n) mod 5for given value of n. Fedya managed to complete the task. Can you? Note that given number n can be extremely large (e.g. it can exceed any integer type of your programming language). | Print the value of the expression without leading zeros. | C | 74cbcbafbffc363137a02697952a8539 | 32c52a27f4919f79deeaefd873929f58 | GNU C | standard output | 256 megabytes | train_003.jsonl | [
"number theory",
"math"
] | 1407511800 | ["4", "124356983594583453458888889"] | NoteOperation x mod y means taking remainder after division x by y.Note to the first sample: | PASSED | 1,200 | standard input | 1 second | The single line contains a single integer n (0 ≤ n ≤ 10105). The number doesn't contain any leading zeroes. | ["4", "0"] | main(n){scanf("%d",&n);puts(n%4?"0":"4");} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.