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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting.The game consists of multiple rounds. Its rules are very simple: in each round, a natural number k is chosen. Then, the one who says (or barks) it faster than the other wins the round. After that, the winner's score is m... | For each pair of scores, answer "Yes" if it's possible for a game to finish with given score, and "No" otherwise. You can output each letter in arbitrary case (upper or lower). | C | 933135ef124b35028c1f309d69515e44 | c76f65675b22f8de5f6dabed4fa182d6 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1501425300 | ["6\n2 4\n75 45\n8 8\n16 16\n247 994\n1000000000 1000000"] | NoteFirst game might have been consisted of one round, in which the number 2 would have been chosen and Pushok would have won.The second game needs exactly two rounds to finish with such result: in the first one, Slastyona would have said the number 5, and in the second one, Pushok would have barked the number 3. | PASSED | 1,700 | standard input | 1 second | In the first string, the number of games n (1 ≤ n ≤ 350000) is given. Each game is represented by a pair of scores a, b (1 ≤ a, b ≤ 109) – the results of Slastyona and Pushok, correspondingly. | ["Yes\nYes\nYes\nNo\nNo\nYes"] | #include<stdio.h>
cuberoot(unsigned long long int x)
{
long long int low=0,high=1000006,mid;
while(low!=high)
{
mid=(low+high+1)/2;
if(mid*mid*mid>x)
high=mid-1;
else
low=mid;
}
return low;
}
main()
{
int n,i;
unsigned long long int a,b,x;
scanf("... | |
Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting.The game consists of multiple rounds. Its rules are very simple: in each round, a natural number k is chosen. Then, the one who says (or barks) it faster than the other wins the round. After that, the winner's score is m... | For each pair of scores, answer "Yes" if it's possible for a game to finish with given score, and "No" otherwise. You can output each letter in arbitrary case (upper or lower). | C | 933135ef124b35028c1f309d69515e44 | 03182eb899ff0adaf0e6ddf264b897be | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1501425300 | ["6\n2 4\n75 45\n8 8\n16 16\n247 994\n1000000000 1000000"] | NoteFirst game might have been consisted of one round, in which the number 2 would have been chosen and Pushok would have won.The second game needs exactly two rounds to finish with such result: in the first one, Slastyona would have said the number 5, and in the second one, Pushok would have barked the number 3. | PASSED | 1,700 | standard input | 1 second | In the first string, the number of games n (1 ≤ n ≤ 350000) is given. Each game is represented by a pair of scores a, b (1 ≤ a, b ≤ 109) – the results of Slastyona and Pushok, correspondingly. | ["Yes\nYes\nYes\nNo\nNo\nYes"] | #include<stdio.h>
#include<math.h>
int main()
{
long long int n,a,b,m,l=1,r=1000000,i,flag=0;
scanf("%lld",&n);
while(n--)
{
flag=0;
l=1,r=1000000;
scanf("%lld%lld",&a,&b);
for(i=0;i<50;i++)
{
m=(l+r)/2;
if(a*b == m*m*m && a%m==0 && b%m==0)
flag=1;
else if(a*b < m*m*m)
r=m-1;
else
... | |
Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting.The game consists of multiple rounds. Its rules are very simple: in each round, a natural number k is chosen. Then, the one who says (or barks) it faster than the other wins the round. After that, the winner's score is m... | For each pair of scores, answer "Yes" if it's possible for a game to finish with given score, and "No" otherwise. You can output each letter in arbitrary case (upper or lower). | C | 933135ef124b35028c1f309d69515e44 | 98ec89e85c3a5dead6ec1e3c32924384 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1501425300 | ["6\n2 4\n75 45\n8 8\n16 16\n247 994\n1000000000 1000000"] | NoteFirst game might have been consisted of one round, in which the number 2 would have been chosen and Pushok would have won.The second game needs exactly two rounds to finish with such result: in the first one, Slastyona would have said the number 5, and in the second one, Pushok would have barked the number 3. | PASSED | 1,700 | standard input | 1 second | In the first string, the number of games n (1 ≤ n ≤ 350000) is given. Each game is represented by a pair of scores a, b (1 ≤ a, b ≤ 109) – the results of Slastyona and Pushok, correspondingly. | ["Yes\nYes\nYes\nNo\nNo\nYes"] | #include<stdio.h>
#include<math.h>
/*int gcd(int a, int b)
{
int temp;
while(a!=0)
{
temp=a;
a=b%a;
b=temp;
}
return b;
}*/
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
long long int a,b,i,k;
long long int ans=1;
double temp;
... | |
Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting.The game consists of multiple rounds. Its rules are very simple: in each round, a natural number k is chosen. Then, the one who says (or barks) it faster than the other wins the round. After that, the winner's score is m... | For each pair of scores, answer "Yes" if it's possible for a game to finish with given score, and "No" otherwise. You can output each letter in arbitrary case (upper or lower). | C | 933135ef124b35028c1f309d69515e44 | 9006e9f76e44e8b77910b88f400c0e8c | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1501425300 | ["6\n2 4\n75 45\n8 8\n16 16\n247 994\n1000000000 1000000"] | NoteFirst game might have been consisted of one round, in which the number 2 would have been chosen and Pushok would have won.The second game needs exactly two rounds to finish with such result: in the first one, Slastyona would have said the number 5, and in the second one, Pushok would have barked the number 3. | PASSED | 1,700 | standard input | 1 second | In the first string, the number of games n (1 ≤ n ≤ 350000) is given. Each game is represented by a pair of scores a, b (1 ≤ a, b ≤ 109) – the results of Slastyona and Pushok, correspondingly. | ["Yes\nYes\nYes\nNo\nNo\nYes"] | //codeforces 426 C
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
const int MAXR = 1000005;
long long solve(long long a)
{
long long t = 0 , r = MAXR;
while (t != r)
{
long long m = (t+r+1)/2;
if (m*m*m > a)
r = m - 1;
else
t = m;
}
return t;
... | |
Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting.The game consists of multiple rounds. Its rules are very simple: in each round, a natural number k is chosen. Then, the one who says (or barks) it faster than the other wins the round. After that, the winner's score is m... | For each pair of scores, answer "Yes" if it's possible for a game to finish with given score, and "No" otherwise. You can output each letter in arbitrary case (upper or lower). | C | 933135ef124b35028c1f309d69515e44 | 0c49b8fd0e8235251e7fb851e7faaf0f | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1501425300 | ["6\n2 4\n75 45\n8 8\n16 16\n247 994\n1000000000 1000000"] | NoteFirst game might have been consisted of one round, in which the number 2 would have been chosen and Pushok would have won.The second game needs exactly two rounds to finish with such result: in the first one, Slastyona would have said the number 5, and in the second one, Pushok would have barked the number 3. | PASSED | 1,700 | standard input | 1 second | In the first string, the number of games n (1 ≤ n ≤ 350000) is given. Each game is represented by a pair of scores a, b (1 ≤ a, b ≤ 109) – the results of Slastyona and Pushok, correspondingly. | ["Yes\nYes\nYes\nNo\nNo\nYes"] | /*QAQ三连:以前的题都补了吗,今天的题都做了吗,不会的算法都会了吗*/
/*金桔退役三连:退役选手不学不会不练*/
#include <stdio.h>
#define LDQ 1000000007
#define QAQ 0x3f3f3f3f
int gcd(int a,int b)
{
int t;
while(b!=0)
{
t=a%b;
a=b;
b=t;
}
return a;
}
int main()
{
int a,b,n,t,x,y;
scanf("%d",&n);
while(n--)
{
... | |
Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting.The game consists of multiple rounds. Its rules are very simple: in each round, a natural number k is chosen. Then, the one who says (or barks) it faster than the other wins the round. After that, the winner's score is m... | For each pair of scores, answer "Yes" if it's possible for a game to finish with given score, and "No" otherwise. You can output each letter in arbitrary case (upper or lower). | C | 933135ef124b35028c1f309d69515e44 | dfee8dc9cb28a52cb8de73ecbdec97b1 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1501425300 | ["6\n2 4\n75 45\n8 8\n16 16\n247 994\n1000000000 1000000"] | NoteFirst game might have been consisted of one round, in which the number 2 would have been chosen and Pushok would have won.The second game needs exactly two rounds to finish with such result: in the first one, Slastyona would have said the number 5, and in the second one, Pushok would have barked the number 3. | PASSED | 1,700 | standard input | 1 second | In the first string, the number of games n (1 ≤ n ≤ 350000) is given. Each game is represented by a pair of scores a, b (1 ≤ a, b ≤ 109) – the results of Slastyona and Pushok, correspondingly. | ["Yes\nYes\nYes\nNo\nNo\nYes"] |
#include <stdio.h>
long long max_value = 1000005;
long long binary_search( long long x)
{
long long l, r;
l = 0;
r = max_value;
while ( l != r )
{
long long mid = (l+r+1)/2;
if ( mid*mid*mid > x)
{
r = mid-1;
}
else
{
l = m... | |
Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting.The game consists of multiple rounds. Its rules are very simple: in each round, a natural number k is chosen. Then, the one who says (or barks) it faster than the other wins the round. After that, the winner's score is m... | For each pair of scores, answer "Yes" if it's possible for a game to finish with given score, and "No" otherwise. You can output each letter in arbitrary case (upper or lower). | C | 933135ef124b35028c1f309d69515e44 | 07ee5888798dc1c6fab3cc0953f493cc | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1501425300 | ["6\n2 4\n75 45\n8 8\n16 16\n247 994\n1000000000 1000000"] | NoteFirst game might have been consisted of one round, in which the number 2 would have been chosen and Pushok would have won.The second game needs exactly two rounds to finish with such result: in the first one, Slastyona would have said the number 5, and in the second one, Pushok would have barked the number 3. | PASSED | 1,700 | standard input | 1 second | In the first string, the number of games n (1 ≤ n ≤ 350000) is given. Each game is represented by a pair of scores a, b (1 ≤ a, b ≤ 109) – the results of Slastyona and Pushok, correspondingly. | ["Yes\nYes\nYes\nNo\nNo\nYes"] | #include <stdio.h>
typedef long long int ll;
int main() {
int n, i, j, found;
ll a, b;
scanf("%d", &n);
for(i=0;i<n;i++) {
scanf("%lld%lld", &a, &b);
ll l, m, r;
found = 0;
l = 1; r = 1000000;
for(j=0;j<50;j++) {
m = (l+r)/2;
if(a*b == m*m*m && a%m == 0 && b%m == 0) {
found = 1;
} else i... | |
Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting.The game consists of multiple rounds. Its rules are very simple: in each round, a natural number k is chosen. Then, the one who says (or barks) it faster than the other wins the round. After that, the winner's score is m... | For each pair of scores, answer "Yes" if it's possible for a game to finish with given score, and "No" otherwise. You can output each letter in arbitrary case (upper or lower). | C | 933135ef124b35028c1f309d69515e44 | 3c8260df4824a7ab982c9e375ac460da | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1501425300 | ["6\n2 4\n75 45\n8 8\n16 16\n247 994\n1000000000 1000000"] | NoteFirst game might have been consisted of one round, in which the number 2 would have been chosen and Pushok would have won.The second game needs exactly two rounds to finish with such result: in the first one, Slastyona would have said the number 5, and in the second one, Pushok would have barked the number 3. | PASSED | 1,700 | standard input | 1 second | In the first string, the number of games n (1 ≤ n ≤ 350000) is given. Each game is represented by a pair of scores a, b (1 ≤ a, b ≤ 109) – the results of Slastyona and Pushok, correspondingly. | ["Yes\nYes\nYes\nNo\nNo\nYes"] | #include<stdio.h>
long long cuberoot(long long ans){
long long l = 1, r = 1000000, mid, z;
while(l <= r){
mid = l + (r-l)/2;
z = mid*mid*mid;
if(z == ans)
return mid;
if(z < ans)
l = mid + 1;
else
r = mid - 1;
}
return -1;
}... | |
Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting.The game consists of multiple rounds. Its rules are very simple: in each round, a natural number k is chosen. Then, the one who says (or barks) it faster than the other wins the round. After that, the winner's score is m... | For each pair of scores, answer "Yes" if it's possible for a game to finish with given score, and "No" otherwise. You can output each letter in arbitrary case (upper or lower). | C | 933135ef124b35028c1f309d69515e44 | 67ce493b16a87530373f1df6395d25a5 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1501425300 | ["6\n2 4\n75 45\n8 8\n16 16\n247 994\n1000000000 1000000"] | NoteFirst game might have been consisted of one round, in which the number 2 would have been chosen and Pushok would have won.The second game needs exactly two rounds to finish with such result: in the first one, Slastyona would have said the number 5, and in the second one, Pushok would have barked the number 3. | PASSED | 1,700 | standard input | 1 second | In the first string, the number of games n (1 ≤ n ≤ 350000) is given. Each game is represented by a pair of scores a, b (1 ≤ a, b ≤ 109) – the results of Slastyona and Pushok, correspondingly. | ["Yes\nYes\nYes\nNo\nNo\nYes"] | #include <stdio.h>
#include <stdlib.h>
// using namespace std;
// typedef long long long long;
long long gd(long long a, long long b){
if(a < b)
return gd(b, a);
if(b == 0)
return a;
return gd(b, a%b);
}
int main(){
// ios_base::sync_with_stdio(0);
long long a, b, n;
// cin >> n;
int nn;
scanf("%d", &nn)... | |
Slastyona and her loyal dog Pushok are playing a meaningless game that is indeed very interesting.The game consists of multiple rounds. Its rules are very simple: in each round, a natural number k is chosen. Then, the one who says (or barks) it faster than the other wins the round. After that, the winner's score is m... | For each pair of scores, answer "Yes" if it's possible for a game to finish with given score, and "No" otherwise. You can output each letter in arbitrary case (upper or lower). | C | 933135ef124b35028c1f309d69515e44 | 35f52a678a64cca37999385a172815d4 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"math"
] | 1501425300 | ["6\n2 4\n75 45\n8 8\n16 16\n247 994\n1000000000 1000000"] | NoteFirst game might have been consisted of one round, in which the number 2 would have been chosen and Pushok would have won.The second game needs exactly two rounds to finish with such result: in the first one, Slastyona would have said the number 5, and in the second one, Pushok would have barked the number 3. | PASSED | 1,700 | standard input | 1 second | In the first string, the number of games n (1 ≤ n ≤ 350000) is given. Each game is represented by a pair of scores a, b (1 ≤ a, b ≤ 109) – the results of Slastyona and Pushok, correspondingly. | ["Yes\nYes\nYes\nNo\nNo\nYes"] | #include <stdio.h>
#include <stdlib.h>
int main(){
long long int q;
scanf("%lld",&q);
while(q--){
long long int a,b;
scanf("%lld %lld",&a,&b);
float cc=cbrt(a*b) ;
// printf("%f\n",cc);
long long int dc=cc;
//printf("%lld\n",dc);
if(a%dc==0 && b%dc==0 && cc==dc)printf("Yes\n");
e... | |
Let $$$f_{x} = c^{2x-6} \cdot f_{x-1} \cdot f_{x-2} \cdot f_{x-3}$$$ for $$$x \ge 4$$$.You have given integers $$$n$$$, $$$f_{1}$$$, $$$f_{2}$$$, $$$f_{3}$$$, and $$$c$$$. Find $$$f_{n} \bmod (10^{9}+7)$$$. | Print $$$f_{n} \bmod (10^{9} + 7)$$$. | C | 6fcd8713af5a108d590bc99da314cded | 96e5e8b418257d08028f1da7811d2a9c | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"dp",
"number theory",
"math",
"matrices"
] | 1560258300 | ["5 1 2 5 3", "17 97 41 37 11"] | NoteIn the first example, $$$f_{4} = 90$$$, $$$f_{5} = 72900$$$.In the second example, $$$f_{17} \approx 2.28 \times 10^{29587}$$$. | PASSED | 2,300 | standard input | 1 second | The only line contains five integers $$$n$$$, $$$f_{1}$$$, $$$f_{2}$$$, $$$f_{3}$$$, and $$$c$$$ ($$$4 \le n \le 10^{18}$$$, $$$1 \le f_{1}$$$, $$$f_{2}$$$, $$$f_{3}$$$, $$$c \le 10^{9}$$$). | ["72900", "317451037"] | #include <stdio.h>
#define MD 1000000007
void mult(int aa[][3], int bb[][3], int cc[][3]) {
int i, j, k;
for (i = 0; i < 3; i++)
for (j = 0; j < 3; j++) {
int c = 0;
for (k = 0; k < 3; k++)
c = (c + (long long) aa[i][k] * bb[k][j]) % (MD - 1);
cc[i][j] = c;
}
}
long long power(int a, int k) {
l... | |
Let $$$f_{x} = c^{2x-6} \cdot f_{x-1} \cdot f_{x-2} \cdot f_{x-3}$$$ for $$$x \ge 4$$$.You have given integers $$$n$$$, $$$f_{1}$$$, $$$f_{2}$$$, $$$f_{3}$$$, and $$$c$$$. Find $$$f_{n} \bmod (10^{9}+7)$$$. | Print $$$f_{n} \bmod (10^{9} + 7)$$$. | C | 6fcd8713af5a108d590bc99da314cded | 026b091998aee57a587463a7a99d03ee | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"dp",
"number theory",
"math",
"matrices"
] | 1560258300 | ["5 1 2 5 3", "17 97 41 37 11"] | NoteIn the first example, $$$f_{4} = 90$$$, $$$f_{5} = 72900$$$.In the second example, $$$f_{17} \approx 2.28 \times 10^{29587}$$$. | PASSED | 2,300 | standard input | 1 second | The only line contains five integers $$$n$$$, $$$f_{1}$$$, $$$f_{2}$$$, $$$f_{3}$$$, and $$$c$$$ ($$$4 \le n \le 10^{18}$$$, $$$1 \le f_{1}$$$, $$$f_{2}$$$, $$$f_{3}$$$, $$$c \le 10^{9}$$$). | ["72900", "317451037"] | #include<stdio.h>
#include<stdlib.h>
#include<stdint.h>
#include<inttypes.h>
typedef int64_t i64;
typedef int32_t i32;
static void print_int(i64 n){if(n<0){putchar('-');n=-n;}if(n==0){putchar('0');return;}int s[20],len=0;while(n>0){s[len++]=n%10+'0';n/=10;}while(len>0){putchar(s[--len]);}}
static i64 read_int(void){i... | |
Let $$$f_{x} = c^{2x-6} \cdot f_{x-1} \cdot f_{x-2} \cdot f_{x-3}$$$ for $$$x \ge 4$$$.You have given integers $$$n$$$, $$$f_{1}$$$, $$$f_{2}$$$, $$$f_{3}$$$, and $$$c$$$. Find $$$f_{n} \bmod (10^{9}+7)$$$. | Print $$$f_{n} \bmod (10^{9} + 7)$$$. | C | 6fcd8713af5a108d590bc99da314cded | b35650e62cada047a614acde168c5f7a | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"dp",
"number theory",
"math",
"matrices"
] | 1560258300 | ["5 1 2 5 3", "17 97 41 37 11"] | NoteIn the first example, $$$f_{4} = 90$$$, $$$f_{5} = 72900$$$.In the second example, $$$f_{17} \approx 2.28 \times 10^{29587}$$$. | PASSED | 2,300 | standard input | 1 second | The only line contains five integers $$$n$$$, $$$f_{1}$$$, $$$f_{2}$$$, $$$f_{3}$$$, and $$$c$$$ ($$$4 \le n \le 10^{18}$$$, $$$1 \le f_{1}$$$, $$$f_{2}$$$, $$$f_{3}$$$, $$$c \le 10^{9}$$$). | ["72900", "317451037"] | #include<stdio.h>
#define lint long long
const int m = 1000000007;
void mul( int c[], int a[], int b[] ) {
int t[5];
for( int i=0; i<=4; ++i )
t[i] = 0;
for( int i=0; i<=2; ++i )
for( int j=0; j<=2; ++j )
t[i+j] = (t[i+j] + 1ll*a[i]*b[j]) %(m-1);
for( int i=4; i>=3; --i )
for( int j=1; j<=3; ++j )
t[i-... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | d7a2efbeaeec84d86598bcd8982d3c2b | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include <stdio.h>
int main()
{int t,i,j;
unsigned int n,s,k,b,x,y,c,a[100000];
scanf("%d",&t);
for(i=0;i<t;i++)
{scanf("%u %u %u",&n,&s,&k);
for(j=0;j<k;j++)
scanf("%u",&a[j]);
x=s;
y=s;
c=1;
while(c!=0)
{
if(x<=n){
for(j=0;j<k;j++)
{
if(a[j]==x) {x++; c=1; break;}
else {c=0... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | bcbbebb1eb2454a4727517cfc44d9c12 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include<stdio.h>
#include<string.h>
int main(){
int t,n,s,k,i,a[2000],dps[2000]={0},dpb[2000]={0};
scanf("%d",&t);
while(t--){
int mark=1;
memset(a,0,sizeof(a));memset(dps,0,sizeof(dps));memset(dpb,0,sizeof(dpb));
scanf("%d%d%d",&n,&s,&k);
int x=1,y=1,xs,ys;
for(i=1;i<=k;i++){
scanf("%d",&a[i]);
if(... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | e5d8516554e45b7de386bce4ac4f54b6 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include<stdio.h>
int main()
{
int t,n,s,k,i,j,p,c,d,a,b,q;
scanf("%d",&t);
while(t--)
{
p=0;
scanf("%d %d %d",&n,&s,&k);
int m[k+1];
for(i=1;i<=k;i++)
{
scanf("%d",&m[i]);
if(m[i]==s) p=i;
}
if(p==0) printf("0\n");
... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | 520f32396242c5f75e137cc3759e04d8 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] |
int search(int k,int a[],int x)
{
int i,jok=0;
for(i=0;i<k;i++)
{
//printf("hell %d \n",a[i]);
if(x==a[i]){
jok=1;
break;
}
}
if(jok==1)
return 0;
else
return 1;
}
int main(){
int t,n,s,k,i,m=0,g=0,l,f;
scanf("%d",&t);
for(i=0;i<t;i++)
{
scanf("%d %d %d",&n,&s,&k);
int j,a[k];
for(j=0;j<k;j++)
scanf("... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | 08832f11a5f42dfab264cc85fff9b02b | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include<stdio.h>
int main()
{
long long int n;
scanf("%lld",&n);
long long int po=0;
while(po++!=n)
{
long long int no,present,damage;
scanf("%lld%lld%lld",&no,&present,&damage);
long long int A[damage],C[4007];
for(int i=0; i<4007; i++)
{
C[i]=1;
}
for(long long int i=0; i<dam... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | f24f0379ef9616e2c8a15b2c46a2d5b5 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include<stdio.h>
int main()
{
int t;
scanf("%d",&t);
while(t--){
int n,s,k,a,b,count1=0,count2=0;
scanf("%d%d%d",&n,&s,&k);
int arr[k];
for(int i=0;i<k;i++)
scanf("%d",&arr[i]);
for(int i=0;i<=1000;i++){
a=0;
for(int j=0;j... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | 5a0229bb34e06212f543776106e4a45c | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include <stdio.h>
#include <stdlib.h>
int cmp(const void *a, const void *b){
return *(int *)a-*(int *)b;
}
int main(void){
int T, n, s, k, i, idx, dis, on, K[1000];
scanf("%d", &T);
while(T--){
scanf("%d %d %d", &n, &s, &k);
on=1;
for(i=0; i<k; ++i){
scanf("%d", &K[i]);
}
qsort(K, k, sizeof(i... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | e293cc6aa6f7b49e95f09f7e66afb67e | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include<stdio.h>
#include<math.h>
int main()
{
int t;
scanf("%d",&t);
while(t--){
int i,j;
long long int n,now,close;
int close_now[1001];
scanf("%lld %lld %lld",&n,&now,&close);
for(i=1;i<=close;i++){
scanf("%d",&close_now[i]);
}
int min=0;
while(1){
int k1=1,k2=1;
for(i=1;i<=close;i++){
... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | d6a82d9d42d9689fffadf9ca513d57c1 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include<stdio.h>
int a[1002][1002];
int main(){
int t,n,s,k,z,min,mid,l,r,f;
scanf("%d",&t);
for(int p=1;p<=t;++p){
scanf("%d %d %d",&n,&s,&k);
for(int j=1;j<=k;++j){
scanf("%d",&a[p][j]);
}
for(int i=1;i<=k;++i){
min=i;
for(int j=i;j<=k;++j){
if(a[p][j]<a[p][min])min=j;
}
z=a[p][i];
a... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | a218de13627baa8ee89373cb21531b7b | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include<stdio.h>
#include<math.h>
int main()
{
int t;
scanf("%d",&t);
int n,s,k;
for(int i=0;i<t;i++)
{
scanf("%d%d%d",&n,&s,&k);
int o;
int m[1001]={0};
for(o=0;o<k;o++)
{
scanf("%d",&m[o]);
m[o]=abs(m[o]-s);
}
for (o=0;o<k-1;o++)
{
for (int j=0;j<k-o-1;j++)
if (m[j]>m[j+1])
{
int ... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | eaa6a41c4d568bedc8b3748f260bbbc8 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | # include <stdio.h>
void merge(long long int *a, long long int na,long long int *b, long long int nb){
long long int ta[na],tb[nb], i;
for(i=0; i< na; i++)
ta[i]= a[i];
for(i=0;i <nb; i++)
tb[i] = b[i];
int ia=0, ib=0;
i=0;
while(ia<na && ib<nb)
a[i++] = (ta[ia] < tb[ib]) ? ta[ia++] : tb[ib++];
while(i... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | b62b6911984add6b8974681ce500cb4d | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include<stdio.h>
#define lli long long int
void merge(lli arr[],lli l,lli m, lli r)
{
lli i, j, k;
lli n1 = m - l + 1;
lli n2 = r - m;
lli L[n1], R[n2];
for (i = 0; i < n1; i++)
L[i] = arr[l + i];
for (j = 0; j < n2; j++)
R[j] = arr[m + 1+ j];
/* Merge the temp arrays back into arr[l..r]*/
i = 0; // Init... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | 861375ebb04ce86b09e222cbe5d3c344 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include<stdio.h>
int binary(int a[],int num,int n)
{
int i=0;
int j=n;
while(i<j)
{
if( i == j-1 )
if( num == a[i])
return 1;
else
return 0;
if( num == a[(i+j)/2] )
return 1;
if( num > a[(i+j)/2] )
... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | 73a8fd3e563d7db032ebae84332060dd | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include<stdio.h>
#include<stdlib.h>
int main()
{
int t;
scanf("%d",&t);
for (int i=0;i<t;i++)
{
int c=0,u,q,e,ud,neeche,upar,solution;
int n,s,k;
scanf("%d%d%d",&n,&s,&k);
int a[k];
for(int m=1;m<=k;m++)
scanf("%d",&a[m]);
for(int w=1;w<k;w++)
... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | 4396b1db04ca76390a19e8eb205fa399 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include <stdio.h>
#include <limits.h>
#include <stdlib.h>
int is_closed(int *closed, const int floor, const int k){
for(int i = 0; i < k; i++)
if(closed[i] == floor)
return 1;
return 0;
}
int main(void){
int t;
scanf("%d", &t);
for(int i = 0; i < t; i++){
int closed[... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | 78761d14c0af01013d96bf07a8995816 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include<stdio.h>
#include<math.h>
int min(int x,int y)
{
if (x>y) return y;
else return x;
}
int flor[1024];
int sort(int l,int r)
{
int mid;
int i,j;
i=l;j=r;
mid=flor[(l+r)>>1];
int tmp;
while (i<j)
{
while (flor[i]<mid) i++;
while (flor[j]>mid) j--;
if (i<=j)
{
tmp=flor[i];
flor[i]=flor[j... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | bc181a4a68d4706586024298e8501b06 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include <stdio.h>
int t,n,s,k,tmp;
int a[1001];
int f(){
for(int j=0; j<=k; j++){
int p=s+j, q=s-j;
int x=1,y=1;
if(p<=n){
for(int u=0; u<k; u++){
if(a[u]==p){
x=0;
break;
}
}
if(x==1) return j;
}
if(q>0){
for(int u=0; u<k; u++){
if(a[u]==q){
y=0;
break;
}
... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | de1b4d47b877e442210d2f97a5bceca2 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include<stdio.h>
#include<string.h>
#include<math.h>
#define mid 1200
int book[2500];
int main()
{
int num;
int T;
int n,s,k;
scanf("%d",&T);
int i;
while(T--){
memset(book,0,sizeof(book));
scanf("%d %d %d",&n,&s,&k);
for(i=0;i<k;i++){
scanf("%d",&num);
if(abs(num-s)<=1000){
book[mid+num-s]=1;
... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | 3d3a9f917c8415ae279f27c8cbab2e5b | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<string.h>
#include<math.h>
#include<limits.h>
#include<ctype.h>
#define FOR(i, a, b) for(int i = a; i < b; i++)
int cmpfunc(const void * a, const void * b) {
int x = *((int *) a);
int y = *((int *) b);
return (x - y);
}
int binarySearch(int... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | 990e4688b147fc0f637e6f42259463bc | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include<stdio.h>
#include<stdlib.h>
int linearSearch(int*,int,int);
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
int n,s,k;
scanf("%d %d %d",&n,&s,&k);
int array[k];
for(int i=0; i < k ; i++)
scanf("%d",&array[i]);
int i = 0;
while(i < k +... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | fc3844a0a0a366ef2bdf3f25712d2ea1 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
int a[1100];
int main()
{
int casee;
scanf("%d",&casee);
for(int o=1;o<=casee;o++)
{
//printf("Case %d: ",o);
int n,s,k;
scanf("%d%d%d",&n,&s,&k);
for(int i=0;i<k;i++)
{
scan... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | e688290e45ea445571c09638986f322c | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include <stdio.h>
/*───▄▀▀▀▄▄▄▄▄▄▄▀▀▀▄───
───█▒▒░░░░░░░░░▒▒█───
────█░░█░░░░░█░░█────
─▄▄──█░░░▀█▀░░░█──▄▄─
█░░█─▀▄░░░░░░░▄▀─█░░█*/
int main(){
int t, n, s, k;
int i, j;
scanf("%d", &t);
while(t--){
scanf("%d %d %d", &n, &s, &k);
int closed[k], down = 9999999, up = 9999999;
for(i = 0; i < k;... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | 7958dc5b61421d510f6675bc67af527a | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include<stdio.h>
#include<math.h>
int main()
{
int t;
scanf("%d",&t);
int n,s,k;
for(int i=0;i<t;i++)
{
scanf("%d%d%d",&n,&s,&k);
int o;
int w[1001]={0};
for(o=0;o<k;o++)
{
scanf("%d",&w[o]);
w[o]=abs(w[o]-s);
}
for (o=0;o<k-1;o++)
{
for (int j=0;j<k-o-1;j++)
if (w[j]>w[j+1])
{
int ... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | 455671607b4249a56ff5d57ac3995365 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | // #include <stdio.h>
// #include <math.h>
// void merge(long long int start, long long mid, long long int end, long long int array[] )
// {
// // printf("2\n");
// long long int n1=mid-start+1,n2=end-mid,j=0,k=0,l=start;
// long long int left[n1],right[n2];
// for (int i = 0; i < n1; ++i)
// left[i]=array[start+... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | 3a0b38917e49d304ad1eeb95dd531da2 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include<stdio.h>
int main()
{
int t,n,s,k,i,j,p,cnt,cmt,fla,flg,sum,m,a[100001],b;
scanf("%d",&t);
while(t--)
{
scanf("%d %d %d",&n,&s,&k);
for(i=0;i<k;i++) scanf("%d",&a[i]);
cnt=0;cmt=0;
for(i=s;i<=n+1;i++)
{
fla=1;
for(j=0;j<k;j++)
... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | d6a992e69517d6b8e030e888b4f28a7a | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include <stdio.h>
#include <string.h>
#include <math.h>
int main()
{
int t;
int n,s,k;
int i,j;
int x;
int min1,min2;
int min;
scanf("%d",&t);
int a[1005]={0};
while(t--)
{
scanf("%d %d %d",&n,&s,&k);
for(i=0;i<k;i++)
{
scanf("%d",&a[i]);
}
min1=s;
min2=s;
min=0;
for(i=s;i>=1;i--)
{
... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | f9c23c0a052ab2f1070dff44a1129708 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include <stdio.h>
int main()
{
int t;
scanf("%d",&t);
while(t--)
{
long int n, s, k;
scanf("%ld%ld%ld",&n,&s,&k);
long int a[k], i, d=0, c, b;
for(i=0;i<k;i++)
{
scanf("%ld",&a[i]);
if(a[i]==s)d=1;
}
if(!d){printf("0\n");c... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | 52a0af0b19bd9773a1b811ef22a434ef | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include<stdio.h>
int minn(int a,int b)
{
return (a>b)?b:a;
}
void mergesort(int 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(int arr[], int l, int m, int r)
{
int i, j, k;
int n1 = m - l + 1;
int n2 = r - m;
int L[n1], R[n2];
fo... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | 8b4c9e6be329b9e512c45fa559d9e3de | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define ll long long
#define inc(i, first, end) for (int i = first; i <= end; i++)
#define dec(i, first, end) for (int i = fiest; i >= end; i--)
#define mem(a) memset(a, 0, sizeof(a))
int cmp(const void *a, const void *b)
{
return *(int *)a - *(int *)b;
... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | dd155bbd3de62d2e8334c5b795313064 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include <stdio.h>
#include <string.h>
int main(){
int t, n, s, k, i, p, q, flag, turn, res;
int a[1000];
scanf("%d", &t);
while(t--){
scanf("%d%d%d", &n, &s, &k);
for(i = 0; i < k; i++){
scanf("%d", &a[i]);
}
turn = 1;
flag = 1;
p = q = s;
while(flag){
//printf("%d %d %d %d\n", flag, turn, p, ... | |
Sakuzyo - ImprintingA.R.C. Markland-N is a tall building with $$$n$$$ floors numbered from $$$1$$$ to $$$n$$$. Between each two adjacent floors in the building, there is a staircase connecting them.It's lunchtime for our sensei Colin "ConneR" Neumann Jr, and he's planning for a location to enjoy his meal.ConneR's offic... | For each test case print a single integer — the minimum number of staircases required for ConneR to walk from the floor $$$s$$$ to a floor with an open restaurant. | C | faae9c0868b92b2355947c9adcaefb43 | f1a9d07ac6a7d935d24da92f309ef334 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"binary search",
"implementation",
"brute force"
] | 1579440900 | ["5\n5 2 3\n1 2 3\n4 3 3\n4 1 2\n10 2 6\n1 2 3 4 5 7\n2 1 1\n2\n100 76 8\n76 75 36 67 41 74 10 77"] | NoteIn the first example test case, the nearest floor with an open restaurant would be the floor $$$4$$$.In the second example test case, the floor with ConneR's office still has an open restaurant, so Sensei won't have to go anywhere.In the third example test case, the closest open restaurant is on the $$$6$$$-th floo... | PASSED | 1,100 | standard input | 1 second | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first line of a test case contains three integers $$$n$$$, $$$s$$$ and $$$k$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le s \le n$$$, $$$1 \le k \le \min(n-1, 1000)... | ["2\n0\n4\n0\n2"] | #include<stdio.h>
int main()
{
int T,n,s,k,i,j,a[1005],b[1000],x1=0,x2=0,p,q;
scanf("%d",&T);
while(T--){
x1=0;
x2=0;
scanf("%d %d %d",&n,&s,&k);
for(i=0;i<k;i++){
scanf("%d",&a[i]);
}
for(i=s;i<=n;i++){
for(j=0;j<k;j++){
if(i==a[j]){
break;
}
}
if(j==k){
x1=i;
break;
... | |
You received a notebook which is called Death Note. This notebook has infinite number of pages. A rule is written on the last page (huh) of this notebook. It says: "You have to write names in this notebook during $$$n$$$ consecutive days. During the $$$i$$$-th day you have to write exactly $$$a_i$$$ names.". You got sc... | Print exactly $$$n$$$ integers $$$t_1, t_2, \dots, t_n$$$, where $$$t_i$$$ is the number of times you will turn the page during the $$$i$$$-th day. | C | a2085c2d21b2dbe4cc27a15fa4a1ec4f | d6d66cafb294e3c67903573fd21fbfa7 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy",
"math"
] | 1533307500 | ["3 5\n3 7 9", "4 20\n10 9 19 2", "1 100\n99"] | NoteIn the first example pages of the Death Note will look like this $$$[1, 1, 1, 2, 2], [2, 2, 2, 2, 2], [3, 3, 3, 3, 3], [3, 3, 3, 3]$$$. Each number of the array describes during which day name on the corresponding position will be written. It is easy to see that you should turn the first and the second page during ... | PASSED | 900 | standard input | 2 seconds | The first line of the input contains two integers $$$n$$$, $$$m$$$ ($$$1 \le n \le 2 \cdot 10^5$$$, $$$1 \le m \le 10^9$$$) — the number of days you will write names in the notebook and the number of names which can be written on each page of the notebook. The second line contains $$$n$$$ integers $$$a_1, a_2, \dots, a... | ["0 2 1", "0 0 1 1", "0"] | #include <stdio.h>
int main() {
int n, m;
scanf("%d", &n);
scanf("%d", &m);
int inp;
int r = 0;
int p;
for(int i =0;i<n;i++)
{
scanf("%d", &inp);
inp+=r;
p=inp/m;
printf("%d ",p);
r=inp%m;
}
}
| |
You received a notebook which is called Death Note. This notebook has infinite number of pages. A rule is written on the last page (huh) of this notebook. It says: "You have to write names in this notebook during $$$n$$$ consecutive days. During the $$$i$$$-th day you have to write exactly $$$a_i$$$ names.". You got sc... | Print exactly $$$n$$$ integers $$$t_1, t_2, \dots, t_n$$$, where $$$t_i$$$ is the number of times you will turn the page during the $$$i$$$-th day. | C | a2085c2d21b2dbe4cc27a15fa4a1ec4f | c0013acfefef019f6a615463dedd51a5 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy",
"math"
] | 1533307500 | ["3 5\n3 7 9", "4 20\n10 9 19 2", "1 100\n99"] | NoteIn the first example pages of the Death Note will look like this $$$[1, 1, 1, 2, 2], [2, 2, 2, 2, 2], [3, 3, 3, 3, 3], [3, 3, 3, 3]$$$. Each number of the array describes during which day name on the corresponding position will be written. It is easy to see that you should turn the first and the second page during ... | PASSED | 900 | standard input | 2 seconds | The first line of the input contains two integers $$$n$$$, $$$m$$$ ($$$1 \le n \le 2 \cdot 10^5$$$, $$$1 \le m \le 10^9$$$) — the number of days you will write names in the notebook and the number of names which can be written on each page of the notebook. The second line contains $$$n$$$ integers $$$a_1, a_2, \dots, a... | ["0 2 1", "0 0 1 1", "0"] | #include<stdio.h>
long long int A[200005]={0};
int main()
{
long long int n,m,i,p=0,a,k;
scanf("%lld%lld",&n,&m);
k=m;
for(i=0;i<n;i++)
{
scanf("%lld",&a);
if(k==m)
{
A[p]=a/k;
p++;
k=m-(a%k);
}
else if(k>a)
{
A[p]=0;
p++;
k=k-a;
}
else if(k<a)
{
A[p]=1;
a=a-k;
k=m;
A[p]+=a/k;
k=m-(a%k);
p++;
}
else if(k==a)
{
A[p]=1;
... | |
You received a notebook which is called Death Note. This notebook has infinite number of pages. A rule is written on the last page (huh) of this notebook. It says: "You have to write names in this notebook during $$$n$$$ consecutive days. During the $$$i$$$-th day you have to write exactly $$$a_i$$$ names.". You got sc... | Print exactly $$$n$$$ integers $$$t_1, t_2, \dots, t_n$$$, where $$$t_i$$$ is the number of times you will turn the page during the $$$i$$$-th day. | C | a2085c2d21b2dbe4cc27a15fa4a1ec4f | 627f13e0e05c30500741c4fbcf1f63b4 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy",
"math"
] | 1533307500 | ["3 5\n3 7 9", "4 20\n10 9 19 2", "1 100\n99"] | NoteIn the first example pages of the Death Note will look like this $$$[1, 1, 1, 2, 2], [2, 2, 2, 2, 2], [3, 3, 3, 3, 3], [3, 3, 3, 3]$$$. Each number of the array describes during which day name on the corresponding position will be written. It is easy to see that you should turn the first and the second page during ... | PASSED | 900 | standard input | 2 seconds | The first line of the input contains two integers $$$n$$$, $$$m$$$ ($$$1 \le n \le 2 \cdot 10^5$$$, $$$1 \le m \le 10^9$$$) — the number of days you will write names in the notebook and the number of names which can be written on each page of the notebook. The second line contains $$$n$$$ integers $$$a_1, a_2, \dots, a... | ["0 2 1", "0 0 1 1", "0"] | #include<stdio.h>
int main()
{
long long int n,m,i;
scanf("%lld %lld",&n,&m);
long long int a[n],rem=m;
for(i=0;i<n;i++)
scanf("%lld",a+i);
for(i=0;i<n;i++)
{
if(a[i]<rem)
{
printf("0 ");
rem-=a[i];
}
else if(a[i]==rem)
{
pr... | |
You received a notebook which is called Death Note. This notebook has infinite number of pages. A rule is written on the last page (huh) of this notebook. It says: "You have to write names in this notebook during $$$n$$$ consecutive days. During the $$$i$$$-th day you have to write exactly $$$a_i$$$ names.". You got sc... | Print exactly $$$n$$$ integers $$$t_1, t_2, \dots, t_n$$$, where $$$t_i$$$ is the number of times you will turn the page during the $$$i$$$-th day. | C | a2085c2d21b2dbe4cc27a15fa4a1ec4f | 5162585c193647b6a6fc8cc137e9b40f | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy",
"math"
] | 1533307500 | ["3 5\n3 7 9", "4 20\n10 9 19 2", "1 100\n99"] | NoteIn the first example pages of the Death Note will look like this $$$[1, 1, 1, 2, 2], [2, 2, 2, 2, 2], [3, 3, 3, 3, 3], [3, 3, 3, 3]$$$. Each number of the array describes during which day name on the corresponding position will be written. It is easy to see that you should turn the first and the second page during ... | PASSED | 900 | standard input | 2 seconds | The first line of the input contains two integers $$$n$$$, $$$m$$$ ($$$1 \le n \le 2 \cdot 10^5$$$, $$$1 \le m \le 10^9$$$) — the number of days you will write names in the notebook and the number of names which can be written on each page of the notebook. The second line contains $$$n$$$ integers $$$a_1, a_2, \dots, a... | ["0 2 1", "0 0 1 1", "0"] | #include <stdio.h>
int main(){
int n,m,i,x;
int vire,lista;
int resto,sobro;
scanf("%d %d",&n,&m);
lista = m;
for(i=0;i<1;i++){
scanf("%d",&x);
vire = 0;
if(x>=lista){
resto = x - lista;
vire = 1;
printf("%d",vire+(resto/m));
lista = m;
lista = lista - (resto%m);
}
else{
printf("0")... | |
You received a notebook which is called Death Note. This notebook has infinite number of pages. A rule is written on the last page (huh) of this notebook. It says: "You have to write names in this notebook during $$$n$$$ consecutive days. During the $$$i$$$-th day you have to write exactly $$$a_i$$$ names.". You got sc... | Print exactly $$$n$$$ integers $$$t_1, t_2, \dots, t_n$$$, where $$$t_i$$$ is the number of times you will turn the page during the $$$i$$$-th day. | C | a2085c2d21b2dbe4cc27a15fa4a1ec4f | 542c4c0da3037c25a35e2bf928089fc9 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy",
"math"
] | 1533307500 | ["3 5\n3 7 9", "4 20\n10 9 19 2", "1 100\n99"] | NoteIn the first example pages of the Death Note will look like this $$$[1, 1, 1, 2, 2], [2, 2, 2, 2, 2], [3, 3, 3, 3, 3], [3, 3, 3, 3]$$$. Each number of the array describes during which day name on the corresponding position will be written. It is easy to see that you should turn the first and the second page during ... | PASSED | 900 | standard input | 2 seconds | The first line of the input contains two integers $$$n$$$, $$$m$$$ ($$$1 \le n \le 2 \cdot 10^5$$$, $$$1 \le m \le 10^9$$$) — the number of days you will write names in the notebook and the number of names which can be written on each page of the notebook. The second line contains $$$n$$$ integers $$$a_1, a_2, \dots, a... | ["0 2 1", "0 0 1 1", "0"] | #include <stdio.h>
int main(){
int n,m,i,x;
int vire,lista;
int resto,sobro;
scanf("%d %d",&n,&m);
lista = m;
for(i=0;i<1;i++){
scanf("%d",&x);
vire = 0;
if(x>=lista){
resto = x - lista;
vire = 1;
printf("%d",vire+(resto/m));
lista = m;
lista = lista - (resto%m);
}
else{
printf("0")... | |
You received a notebook which is called Death Note. This notebook has infinite number of pages. A rule is written on the last page (huh) of this notebook. It says: "You have to write names in this notebook during $$$n$$$ consecutive days. During the $$$i$$$-th day you have to write exactly $$$a_i$$$ names.". You got sc... | Print exactly $$$n$$$ integers $$$t_1, t_2, \dots, t_n$$$, where $$$t_i$$$ is the number of times you will turn the page during the $$$i$$$-th day. | C | a2085c2d21b2dbe4cc27a15fa4a1ec4f | 7c235bad6f046075db906f647b5688bc | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy",
"math"
] | 1533307500 | ["3 5\n3 7 9", "4 20\n10 9 19 2", "1 100\n99"] | NoteIn the first example pages of the Death Note will look like this $$$[1, 1, 1, 2, 2], [2, 2, 2, 2, 2], [3, 3, 3, 3, 3], [3, 3, 3, 3]$$$. Each number of the array describes during which day name on the corresponding position will be written. It is easy to see that you should turn the first and the second page during ... | PASSED | 900 | standard input | 2 seconds | The first line of the input contains two integers $$$n$$$, $$$m$$$ ($$$1 \le n \le 2 \cdot 10^5$$$, $$$1 \le m \le 10^9$$$) — the number of days you will write names in the notebook and the number of names which can be written on each page of the notebook. The second line contains $$$n$$$ integers $$$a_1, a_2, \dots, a... | ["0 2 1", "0 0 1 1", "0"] | #include <stdio.h>
int main(void) {
int n,m;
scanf("%d %d",&n,&m);
int space=m;
for(int i=0;i<n;i++){
int t=0;
int a;
scanf("%d",&a);
if(space>a)
space-=a;
else if(space==a){
space=m;
t++;
}
else if(space<a){
while(a!=0){
if(a>=s... | |
You received a notebook which is called Death Note. This notebook has infinite number of pages. A rule is written on the last page (huh) of this notebook. It says: "You have to write names in this notebook during $$$n$$$ consecutive days. During the $$$i$$$-th day you have to write exactly $$$a_i$$$ names.". You got sc... | Print exactly $$$n$$$ integers $$$t_1, t_2, \dots, t_n$$$, where $$$t_i$$$ is the number of times you will turn the page during the $$$i$$$-th day. | C | a2085c2d21b2dbe4cc27a15fa4a1ec4f | b6444e7b3a8d4d38fe5b405077dd6468 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy",
"math"
] | 1533307500 | ["3 5\n3 7 9", "4 20\n10 9 19 2", "1 100\n99"] | NoteIn the first example pages of the Death Note will look like this $$$[1, 1, 1, 2, 2], [2, 2, 2, 2, 2], [3, 3, 3, 3, 3], [3, 3, 3, 3]$$$. Each number of the array describes during which day name on the corresponding position will be written. It is easy to see that you should turn the first and the second page during ... | PASSED | 900 | standard input | 2 seconds | The first line of the input contains two integers $$$n$$$, $$$m$$$ ($$$1 \le n \le 2 \cdot 10^5$$$, $$$1 \le m \le 10^9$$$) — the number of days you will write names in the notebook and the number of names which can be written on each page of the notebook. The second line contains $$$n$$$ integers $$$a_1, a_2, \dots, a... | ["0 2 1", "0 0 1 1", "0"] | #include <stdio.h>
#include <stdlib.h>
int main()
{
int n;
scanf("%d",&n);
int k;
scanf("%d",&k);
int temp;
int arr[n];
int turns[n];
int i ;
for(i=0;i<n;i++) scanf("%d",&arr[i]);
for(i=0;i<n;i++){
if(i==0){
if(arr[i]<k){
turns[0]=0;
... | |
You received a notebook which is called Death Note. This notebook has infinite number of pages. A rule is written on the last page (huh) of this notebook. It says: "You have to write names in this notebook during $$$n$$$ consecutive days. During the $$$i$$$-th day you have to write exactly $$$a_i$$$ names.". You got sc... | Print exactly $$$n$$$ integers $$$t_1, t_2, \dots, t_n$$$, where $$$t_i$$$ is the number of times you will turn the page during the $$$i$$$-th day. | C | a2085c2d21b2dbe4cc27a15fa4a1ec4f | 658aa3261fb5e09d8e478f77a5599043 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy",
"math"
] | 1533307500 | ["3 5\n3 7 9", "4 20\n10 9 19 2", "1 100\n99"] | NoteIn the first example pages of the Death Note will look like this $$$[1, 1, 1, 2, 2], [2, 2, 2, 2, 2], [3, 3, 3, 3, 3], [3, 3, 3, 3]$$$. Each number of the array describes during which day name on the corresponding position will be written. It is easy to see that you should turn the first and the second page during ... | PASSED | 900 | standard input | 2 seconds | The first line of the input contains two integers $$$n$$$, $$$m$$$ ($$$1 \le n \le 2 \cdot 10^5$$$, $$$1 \le m \le 10^9$$$) — the number of days you will write names in the notebook and the number of names which can be written on each page of the notebook. The second line contains $$$n$$$ integers $$$a_1, a_2, \dots, a... | ["0 2 1", "0 0 1 1", "0"] | #include<stdio.h>
int abs(int x){
if(x>=0)
return x;
else
return -x;
}
int main(){
int n,m;
scanf("%d %d",&n,&m);
int a[n],t[n],b=0;
for(int k=0;k<n;k++)
scanf("%d",&a[k]);
for(int i=0;i<n;i++){
t[i]=0;
if(a[i]+b>m){
t[i]=(a[i]+b)/m;
b=(a[i]+b)%m;
}
... | |
You received a notebook which is called Death Note. This notebook has infinite number of pages. A rule is written on the last page (huh) of this notebook. It says: "You have to write names in this notebook during $$$n$$$ consecutive days. During the $$$i$$$-th day you have to write exactly $$$a_i$$$ names.". You got sc... | Print exactly $$$n$$$ integers $$$t_1, t_2, \dots, t_n$$$, where $$$t_i$$$ is the number of times you will turn the page during the $$$i$$$-th day. | C | a2085c2d21b2dbe4cc27a15fa4a1ec4f | 729fded30c77d78e5e4da4a337a0363b | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy",
"math"
] | 1533307500 | ["3 5\n3 7 9", "4 20\n10 9 19 2", "1 100\n99"] | NoteIn the first example pages of the Death Note will look like this $$$[1, 1, 1, 2, 2], [2, 2, 2, 2, 2], [3, 3, 3, 3, 3], [3, 3, 3, 3]$$$. Each number of the array describes during which day name on the corresponding position will be written. It is easy to see that you should turn the first and the second page during ... | PASSED | 900 | standard input | 2 seconds | The first line of the input contains two integers $$$n$$$, $$$m$$$ ($$$1 \le n \le 2 \cdot 10^5$$$, $$$1 \le m \le 10^9$$$) — the number of days you will write names in the notebook and the number of names which can be written on each page of the notebook. The second line contains $$$n$$$ integers $$$a_1, a_2, \dots, a... | ["0 2 1", "0 0 1 1", "0"] | #include<stdio.h>
int main(void){
int n, m;
scanf("%d %d", &n, &m);
int A[200000 + 7], sum = 0;
for(int i = 0; i < n; i++){
int count = 0;
scanf("%d", &A[i]);
sum += A[i];
count = sum / m;
sum = sum % m;
printf("%d ", count);
}
}
| |
You received a notebook which is called Death Note. This notebook has infinite number of pages. A rule is written on the last page (huh) of this notebook. It says: "You have to write names in this notebook during $$$n$$$ consecutive days. During the $$$i$$$-th day you have to write exactly $$$a_i$$$ names.". You got sc... | Print exactly $$$n$$$ integers $$$t_1, t_2, \dots, t_n$$$, where $$$t_i$$$ is the number of times you will turn the page during the $$$i$$$-th day. | C | a2085c2d21b2dbe4cc27a15fa4a1ec4f | f506825e561eef7f40b62e3798deab6b | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy",
"math"
] | 1533307500 | ["3 5\n3 7 9", "4 20\n10 9 19 2", "1 100\n99"] | NoteIn the first example pages of the Death Note will look like this $$$[1, 1, 1, 2, 2], [2, 2, 2, 2, 2], [3, 3, 3, 3, 3], [3, 3, 3, 3]$$$. Each number of the array describes during which day name on the corresponding position will be written. It is easy to see that you should turn the first and the second page during ... | PASSED | 900 | standard input | 2 seconds | The first line of the input contains two integers $$$n$$$, $$$m$$$ ($$$1 \le n \le 2 \cdot 10^5$$$, $$$1 \le m \le 10^9$$$) — the number of days you will write names in the notebook and the number of names which can be written on each page of the notebook. The second line contains $$$n$$$ integers $$$a_1, a_2, \dots, a... | ["0 2 1", "0 0 1 1", "0"] | #include<stdio.h>
int main(void)
{
int day,page,dpage,sum=0,i;
while(scanf("%d%d",&day,&page)==2)
{
for(i=0;i<day;i++)
{
scanf("%d",&dpage);
sum+=dpage;
printf("%d ",sum/page);
sum%=page;
}
}
return 0;
}
| |
You received a notebook which is called Death Note. This notebook has infinite number of pages. A rule is written on the last page (huh) of this notebook. It says: "You have to write names in this notebook during $$$n$$$ consecutive days. During the $$$i$$$-th day you have to write exactly $$$a_i$$$ names.". You got sc... | Print exactly $$$n$$$ integers $$$t_1, t_2, \dots, t_n$$$, where $$$t_i$$$ is the number of times you will turn the page during the $$$i$$$-th day. | C | a2085c2d21b2dbe4cc27a15fa4a1ec4f | 3f94039b5ed9b5bd3875513a6f702ad0 | GNU C | standard output | 256 megabytes | train_000.jsonl | [
"implementation",
"greedy",
"math"
] | 1533307500 | ["3 5\n3 7 9", "4 20\n10 9 19 2", "1 100\n99"] | NoteIn the first example pages of the Death Note will look like this $$$[1, 1, 1, 2, 2], [2, 2, 2, 2, 2], [3, 3, 3, 3, 3], [3, 3, 3, 3]$$$. Each number of the array describes during which day name on the corresponding position will be written. It is easy to see that you should turn the first and the second page during ... | PASSED | 900 | standard input | 2 seconds | The first line of the input contains two integers $$$n$$$, $$$m$$$ ($$$1 \le n \le 2 \cdot 10^5$$$, $$$1 \le m \le 10^9$$$) — the number of days you will write names in the notebook and the number of names which can be written on each page of the notebook. The second line contains $$$n$$$ integers $$$a_1, a_2, \dots, a... | ["0 2 1", "0 0 1 1", "0"] | # include <stdio.h>
int main()
{
int n,k,i,p,p1;
scanf("%d%d",&n,&k);
int a[n];
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
p=0;
for(i=0;i<n;i++)
{
p1=(p+a[i]);
p=p1%k;
printf("%d ",p1/k);
}
}
| |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 89d4c969ca76b026033227088a17d691 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
#include<string.h>
int main()
{
char str[1001];
scanf("%s", str);
int ara[26],i,alp=0,even=0,p=1;
for(i=0;i<26;i++)
{
ara[i] = 0;
}
for(i=0;str[i]!='\0';i++)
{
ara[str[i]-97]++;
}
for(i=0;i<26;i++)
{
if(ara[i]>0)
{
... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | e0e08676204b3efb89a1b54d7b1ae288 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(){
char tab[1001];
int occ[26]={0};
int k=1,l,i,j,count=0;
gets(tab);
l=strlen(tab);
for(i=0;i<l;i++){
occ[tab[i]-97]++;
}
for(i=0;i<26;i++){
if(occ[i]%2!=0)
count++;
}
if(count==0||count%2!=0)printf("First");
else printf("Seco... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 5480f2dda389e653715ae1c149c7c2f7 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
#include<string.h>
int a1[30];
int main()
{
char s1[1000];
int len,i1,c=0;
scanf("%s",&s1);
len=strlen(s1);
for(i1=0;i1<len;i1++){
if(s1[i1]=='a'){
a1[1]=a1[1]+1;
}
else if(s1[i1]=='b'){
a1[2]=a1[2]+1;
}
else if(s1[i... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 76b4690c7bb9b6f01776954bdc514bcd | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] |
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define MAX 1010
int main(void) {
int n, i;
char s[MAX];
scanf("%s", s);
int fr[26];
for (i = 0; i < 26; i++)
fr[i] = 0;
n = strlen(s);
for (i = 0; i < n; i++)
fr[s[i]-'a']++;
int sum = 0;
for (i = 0; i < 26; i++)
... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 8a10921cb45d2994c2eca1518822a69b | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <stdio.h>
#include <string.h>
int main ()
{
char a [1005];
int i, ara [26] = {0};
gets (a);
int l = strlen(a);
for (i = 0; i < l; i ++) {
ara [a [i] - 97] ++;
}
int cnt = 0;
for (i = 0; i < 26; i ++) {
if (ara [i] & 1)
cnt ++;
}
if (cnt... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 9c2ea199ddfb7db40508525c45c19f61 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
#include<string.h>
int main()
{
char a[1000];
scanf("%s",a);
int arr[26]={0},j,n,count=0;
for(j=0;j<strlen(a);j++)
{
arr[a[j]-'a']=arr[a[j]-'a']+1;
}
for(j=0;j<26;j++)
{
if(arr[j]%2!=0)
{
count++;
}
}
if(count==0 || count%2!=0)
{
printf("First\n");
}
else
{
... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 3829127ed0772db00334fc9f8032895b | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
#include<string.h>
int count[30];
int main()
{
int len;
char s[1005];
scanf("%s",s);
len=strlen(s);
int i,num;
for(i=0;i<len;i++)
{
num=s[i]-'a';
count[num]++;
}
int odd=0;
int even=0;
for(i=0;i<27;i++)
{
if(count[i]&1)
odd++;
else
even++;
}
int time=0;
if(odd==0)
printf... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | b7510f94d303df2f3300c0601754dd0b | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
int main()
{
char a[1003];
int count=0,ct[26]={0},i;
i=0;
scanf("%s",a);
while(a[i]!='\0')
ct[a[i++]-97]++;
for(i=0;i<26;i++)
if(ct[i]%2!=0)
count++;
if(count==0||count%2!=0)
printf("First\n");
else
printf("Second\n");
return 0;
} | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 7f4df3f46505e363b43a5559064359e4 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
#include<string.h>
int main()
{
char a[1001];
char b[1001];
int c[1001];
scanf("%s",a);
int l = strlen(a);
int i, j, count = 0, temp;
for(i = 0; i < l; i++){
for(j = 0; j < l - i - 1; j++){
if(a[j] > a[j+1]){
temp = a[j];
a[j] =... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 79ef8f1deeab6ff657a046478833cf91 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
int main()
{
char a[1003];
int count=0,ct[26]={0},i;
i=0;
scanf("%s",a);
while(a[i]!='\0')
ct[a[i++]-97]++;
for(i=0;i<26;i++)
if(ct[i]%2!=0)
count++;
if(count==0||count%2!=0)
printf("First\n");
else
printf("Second\n");
return 0;
} | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 0833cf95e185452b2da38778b15fcbc6 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | /* AUTHOR:AKASH JAIN
* USERNAME:akash19jain
* DATE:09/07/2019
*/
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#define MOD 1000000007
int cmp(const void * a,const void * b);
int main()
{
long long t=1;
//scanf("%lld",&t);
while(t--)
{
... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 96f9a234b949ab3553485a9131c4ea12 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
int c[28];
int main()
{
char a[1005];
int i=0,m=0,n=0;
scanf("%s",a);
while(a[m]!='\0')
{
c[a[m]-97]++;
m++;
}
while(i<26)
{
if((c[i]%2)==1)
{
n++;
}
i++;
}
if(n!=0)
n--;
if(n%2==0)
{
... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 692c5be4cba2308811c3689295bab82b | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
int main()
{
int counts[26]= {0},i=0,odd=0;
char ch=0;
while(1)
{
ch = getchar();
if(ch=='\n')
break;
counts[ch-'a']++;
}
for(i=0; i<26; i++)
{
if(counts[i]%2==1)
odd++;
}
if(odd%2!=0 || odd==0)
printf... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 3e041528b1680ba9a7bef39c0e9a7dc8 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <string.h>
#include <stdio.h>
int cnt[26];
int main()
{
char ch[1011];
scanf("%s",ch);
int l=strlen(ch);
char q;
int j,k,p,i;
for(i=0;i<l;i++)
{
cnt[ch[i]]++;
}
j=0,k=0;
for(q='a';q<='z';q++)
{
if(cnt[q]%2==0)
j++;
e... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | fa1461ab98f387d6448be37d3d639b0a | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
long long cmpfunc (const void * a, const void * b) {
return ( *(long long*)a - *(long long*)b );
}
int main(void){
long long int test,i,j,n,count,flag=0,o1=0,o2=0,b1,x,m,l,max,sum2,min,f,r,o,sum1,sum=0,y,count1=0,a[100000]={0},b[100000]... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 267e89f386fceb51d77b367cd2b8498a | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <string.h>
#include <stdlib.h>
#include <stdio.h>
int a[26];
int main(){
char s[1001];
scanf("%s",s);
int i,odd=0,j;
for(i=0;i<strlen(s);i++){
j=s[i]-'a';
a[j]++;
}
for(i=0;i<26;i++)
{
if(a[i]%2)
odd++;
}
if(odd==0 || odd%2==1)
pr... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 11b27f45389fee30af123b6e08ea3c80 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <stdio.h>
int main(void) {
char s[1001];
scanf(" %s",s);
int temp[26];
for(int i=0;i<26;i++)
{
temp[i]=0;
}
for(int i=0;s[i]!='\0';i++)
{
temp[s[i]-97]++;
}
int k=0;
for(int i=0;i<26;i++)
{
if(temp[i]%2!=0)
{
k++;
... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | b2a7e4b72f5f24e1ece0dd38ab1de38a | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <stdio.h>
int main() {
int a[26];
for(int i = 0; i < 26; i++) a[i] = 0;
char ch = getchar();
while(ch!='\n'){
a[ch-'a'] = !a[ch-'a'];
ch = getchar();
}
int count = 0;
for(int i = 0; i < 26; i++)
if(a[i]) count++;
if(count <= 1) printf("First");
else{
... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 07a800870aa762c246b5d1ee29467f74 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <stdio.h>
#include <string.h>
int main(){
char a[1001];
int i;
int q;
int s=0;
scanf("%s",a);
int c=0;
int t;
char b[strlen(a)];
for(i=0;i<strlen(a);i++){
for(q=0;q<i;q++){
if((a[i]==a[q])){
s++;
}
}
if(!s){
b[c]=a[i];
c++;
}
s=0;
}
int d[c];
for(q=0;q<c;q++){
d[q]=0;
}... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 9197298378154061aaf7b78ea1f8e6dd | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
char s[1000],key[99];
int i,j,k=0,n,a[1000][2],c,m;
scanf("%s",s);
if(s[0]=='j'&&s[1]=='y'&&s[2]=='e'){
printf("Second"); exit(0);
}
for(i=0;i<strlen(s);i++)
{
if(s[i]!='0')
{
c... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | ac3ed17bff12efd17e36deb93bf4e76d | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <stdio.h>
int main(void)
{
char string[26] = {0};
char c;
while ((c = getchar()) != '\n')
string[c - 97]++;
int sum = 0;
for (int i = 0; i < 26; i++)
sum += (string[i]%2);
if (sum % 2 || sum == 0)
printf("First\n");
else
printf("Second\n");
return 0;
}
| |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | a964e9b78274853f1f11e1938a7ac078 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <stdio.h>
#include <string.h>
#define N 1000
int main() {
static char s[N + 1];
static int kk[26];
int n, i, k;
scanf("%s", s);
n = strlen(s);
for (i = 0; i < n; i++)
kk[s[i] - 'a']++;
k = 0;
for (i = 0; i < n; i++)
if (kk[s[i] - 'a'] % 2)
k++;
printf(n % 2 || (n % 2 == 0 && k == 0) ? "First... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 4b335a35dde6e86fd6c8cd948ecc8837 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
#include<string.h>
int main()
{
char s[1001];
scanf("%s",&s);
int i,j,count[26];
char alpha;
alpha='a';
for(i=0;i<26;i++)
{
count[i]=0;
for(j=0;j<strlen(s);j++)
{
if(s[j]==alpha)
{
count[i]++;
}
... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 34cc566f807b5b2d39e5e97048b52ea9 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <stdio.h>
#include <stdlib.h>
int main()
{
long long int i,j,k,a=0,b=0,n,t=0,u,m,g=0;
long long int x[30],y[30],max;
char s[1000];
scanf("%s",s);
for(t='a';t<='z';t++)
{
for(i=0;s[i]!=0;i++)
if(t==s[i])
b++;
if(b>0)
x[g++]=b;
b=0; }
for(i=0;i<g;i++)
if(x[i]%2==1)
a++;
... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | c5e8bcc67119ed8c96743d1b4e2f3c84 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
#include<string.h>
int main(void)
{
char str[100000];
int ara[100000];
int i,j,n,b,e=0,g=0;
scanf("%s",str);
n = strlen(str);
for(i=0;i<n;i++){
for(j=0;j<n;j++){
if(str[i]==str[j]&&str[i]!='0'&&str[j]!='0'){
if(j>i)str[j]='0';
... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 39e1c6229d1820890aee0f78f6166b17 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <stdio.h>
#include <string.h>
#include <stdlib.h>
int even, odd;
int main()
{
char ch[1000];
scanf("%s", ch);
int n = strlen(ch);
if (n == 1) {
printf("%s\n", "First" );
return 0;
}
else if (n == 2) {
if ((ch[0] != ch[1])) {
printf("%s\n", "Second" );
}
else {
printf("%s\n", "First" );
... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 6aedb5479fca2bcc2a08601510b6c609 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
#include<string.h>
int main()
{
char a[1005];
int i,ln,ck=0;
int cnt[26]= {0};
scanf("%s",a);
ln=strlen(a);
for (i = 0; i < ln; i++)
{
cnt[a[i] - 'a']++;
}
for (i = 0; i < 26; i++)
{
if (cnt[i] % 2 == 1)
ck++;
}
if(ck==0 || ck%2==1)
printf("First"... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 10d3efc6568b1878e3005e62745a382b | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int a[26],i,l,k=0;
char str[2000];
scanf("%s",str);
l=strlen(str);
for(i=0;i<l;i++)
{
a[str[i]-'a']++;
}
for(i=0;i<26;i++)
{
if(a[i]%2==1)
k++;
}
if((k==0)||(k%2==1))
pr... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 065075593587a48f37f6c73951eb8781 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int a[26],i,l,k=0;
char str[2000];
scanf("%s",str);
l=strlen(str);
for(i=0;i<l;i++)
{
a[str[i]-'a']++;
}
for(i=0;i<26;i++)
{
if(a[i]%2==1)
k++;
}
if((k==0)||(l%2==1))
pr... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 043a7ce3c066db1ec97a6ec39793d966 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
#include<string.h>
int a[26];
int main(){
char c[1005];
scanf("%s",c);
int n=strlen(c),k=0;
for(int i=0;i<n;i++){
a[c[i]-'a']++;
}
for(int i=0;i<26;i++)
if(a[i]%2==1)k++;
if((k==0)||((n%2)==1))printf("First");
else printf("Second");
}
| |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | af2659cc059fe69cad52621f8ded69c4 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <stdio.h>
int main()
{ char a[1001];
int b[26],c=0;
for(int i=0;i<26;i++)b[i]=0;
scanf("%s" , &a);
for(int i=0;a[i]!='\0';i++)
{
b[a[i]-'a']++;
b[a[i]-'a']=b[a[i]-'a']%2;
}
for(int i=0;i<26;i++)
{
c=c+b[i];
}
if(c==0||c==1){printf("First");retu... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 56100789f00608b82dc6989e8a0f3213 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
#include<string.h>
#define maxn 1010
int main()
{
char s[maxn];
int a[26];
while(scanf("%s",s)!=EOF)
{
int l=strlen(s);
int i,ans;
memset(a,0,sizeof(a));
for(i=0;i<l;i++)
{
a[s[i]-'a']++;
}
ans=0;
for(i=0;i<26;... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | dd381fbebed97cb433eb9332842a0bff | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
#include<string.h>
int main()
{char a[1000001];scanf("%s", a);int c[26]={0},i,d,e=0;for(i=0;i<strlen(a);i++){d=(int)a[i]-97;c[d]++;}
for(i=0;i<26;i++){if(c[i]%2!=0)e++;}if(e%2==0&&e!=0)printf("Second\n");else{printf("First\n");}return 0;} | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 5867ceae8daa0d0cc6fa56b64c89e4d2 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define size 1002
main()
{
char s[size];
int i,k=0,n;
scanf("%s",s);
int was[26]={0};
n=strlen(s);
for(i=0;i<n;++i)
{
was[s[i]-'a']++;
}
for(i=0;i<26;++i)
{
if(was[i]%2==1)
{
k++;
}
}
if(k==0 || k==1)
{
printf("First");
}
else
{... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | fb38e9919574970d739ecf14960d2696 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <stdio.h>
#include <string.h>
char s[1001];
int d[26];
int main()
{
#ifdef LOCAL
freopen("test.txt", "r", stdin);
#endif
scanf("%s", s);
int len = strlen(s);
memset(d, 0, sizeof(int)*26);
for(int i = 0; i < len; i++)
d[s[i]-'a']++;
int odd = 0;
for(int i = 0; i < 26; i++)
{... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 163a32158aa3133608eb08298d9c31b0 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int letters[27];
int main() {
char* s = malloc(100001);
gets(s);
int count_odd = 0;
int size = strlen(s);
for (int i = 0; i < size; i++)
{
letters[s[i]-'a']++;
}
for (int i = 0; i < 26; i++)
{
if (letter... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | a54c1da0818bb52a6cd3a7b8174207a8 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <stdio.h>
#include <stdlib.h>
/* Written by Nishant Mittal aka nishantwrp */
int count[26];
int main()
{
char input[10000];
gets(input);
int ocount = 0;
int i=0;
while(input[i]!='\0') {
count[input[i] - 'a']++;
i++;
}
int j=0;
while(j<26) {
if (count[j]%2 == 1) {
ocount++;
}
j++;
}
if (ocount ==... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | bbe9b72d77cdf0ed8904cd9b05eabc4c | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
#define MAXI 1001
#define LETTERS 26
// Time
// len(s) + 26 + c belongs to O(n), n = len(s)
// Memory
// O(1)
int alpha[LETTERS];
char s[MAXI];
int main(void){
scanf("%s", s);
for(int i = 0; s[i] != '\0'; i++){
alpha[s[i] - 'a'] += 1;
}
int par = 0;
int impar = 0;
for(int i = 0; i < LETT... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 3eb32814c786a2ec27611e386c8e5762 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
int main(){
int arr[125]={0},i,odd=1;
char arb[1005],temp;
scanf("%s",arb);
for(i=0;arb[i]!='\0';i++){
temp=arb[i];
arr[temp]+=1;
}
for(i=97;i<=122;i++){
if(arr[i]%2==1){
odd++;
}
}
odd=odd-1;
if(odd==0){
p... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | bf0ce257029e18f53ff7721cbb4d8548 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <stdio.h>
#include <string.h>
int main(){
char s[1000];
int lettercount[26]={0};
scanf("%s",s);
for(int i=0;i<26;i++){
for(int j=0;j<strlen(s);j++){
if(s[j]==i+97){
lettercount[i]++;
}
}
}
int count=0;
int sum=0;
for(int i=0;i<26;i++){
if(lettercount[i]!=0){
count++;
sum=sum+(let... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 0bb1bcdfd78c64206ca717c536d8a525 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
char a[1000];
scanf("%s",a);
char b[26]={'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'};
int d=0,odd=0;
int l=strlen(a);
for(int i=0;i<l;i++)
{
d=a[i]-'a';
... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | bef96db00f802248f4398be03a54ca21 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#include <string.h>
int main()
{
int amounts[256] = {0};
char c;
while((c = getchar())!='\n') amounts[c]++;
int odds = 0;
for(int i = 'a'; i <= 'z'; i++) odds += amounts[i]&1;
if(odds)odds--;
printf(odds&1?"... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | dab9816ebded2a30f809fccf0042a275 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <stdio.h>
int main()
{
char S[1000], XS;
scanf("%s", S);
unsigned short i = 0, j = 0, Counter = 0, No_Of_Odd = 0;
while( S[i] != '\0'){
while( S[i] == '0'){
i++;
if(S[i] == '\0') break;
}
if(S[i] == '\0') break;
XS = S[i];
whil... | |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | 92ba97d00144500f320e77a8ef4ca993 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include<stdlib.h>
#include<string.h>
int main()
{
char s[1001];
scanf("%s",s);
int n,i,j=0,A[26];
n=strlen(s);
for(i=0;i<26;i++)
{
A[i]=0;
}
for(i=0;i<n;i++)
{
A[s[i]-'a']++;
}
for(i=0;i<26;i++)
{
if(A[i]%2!=0)
j++;
}
if(j==0||j%2==1)
printf("First");
else
printf("Second");
return 0;
}
| |
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor... | In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes. | C | bbf2dbdea6dd3aa45250ab5a86833558 | e493040427e07c20c362127ae0eafc18 | GNU C11 | standard output | 256 megabytes | train_000.jsonl | [
"greedy",
"games"
] | 1361719800 | ["aba", "abca"] | null | PASSED | 1,300 | standard input | 2 seconds | The input contains a single line, containing string s (1 ≤ |s| ≤ 103). String s consists of lowercase English letters. | ["First", "Second"] | #include <stdio.h>
#include <memory.h>
int target[27];
int main(){
int res = 0;
char c;
memset(target, 0, sizeof(target));
while(scanf("%c", &c) > 0){
target[c - 'a']++;
}
for(int i = 0; i < 26; i++){
if(target[i] % 2 > 0){
res++;
}
}
if(res && res %... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.