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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Andrew plays a game called "Civilization". Dima helps him.The game has n cities and m bidirectional roads. The cities are numbered from 1 to n. Between any pair of cities there either is a single (unique) path, or there is no path at all. A path is such a sequence of distinct cities v1, v2, ..., vk, that there is a roa... | For each event of the first type print the answer on a separate line. | C | 54c1d57482a1aa9c1013c2d54c5f9c13 | 48077918c94ce114b5c2c8c6b274b8aa | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"dp",
"trees",
"dsu",
"dfs and similar",
"ternary search"
] | 1407511800 | ["6 0 6\n2 1 2\n2 3 4\n2 5 6\n2 3 2\n2 5 3\n1 1"] | null | PASSED | 2,100 | standard input | 1 second | The first line contains three integers n, m, q (1 ≤ n ≤ 3·105; 0 ≤ m < n; 1 ≤ q ≤ 3·105) — the number of cities, the number of the roads we already have and the number of queries, correspondingly. Each of the following m lines contains two integers, ai and bi (ai ≠ bi; 1 ≤ ai, bi ≤ n). These numbers represent the ro... | ["4"] | /* practice with Dukkha */
#include <stdio.h>
#include <string.h>
#define N 300000
int max(int a, int b) { return a > b ? a : b; }
int next[1 + (N - 1) * 2], jj[1 + (N - 1) * 2];
int link(int l, int j) {
static int l_ = 1;
next[l_] = l;
jj[l_] = j;
return l_++;
}
int ao[N], cc[N], d_, j_;
void dfs(int p, int... | |
Happy PMP is freshman and he is learning about algorithmic problems. He enjoys playing algorithmic games a lot.One of the seniors gave Happy PMP a nice game. He is given two permutations of numbers 1 through n and is asked to convert the first one to the second. In one move he can remove the last number from the permut... | Print a single integer denoting the minimum number of moves required to convert the first permutation to the second. | C | a26e048eb9b18f87f1703d42e172f318 | 03cd986d6b3c7f48b1d0685e18feb9eb | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"greedy"
] | 1336663800 | ["3\n3 2 1\n1 2 3", "5\n1 2 3 4 5\n1 5 2 3 4", "5\n1 5 2 3 4\n1 2 3 4 5"] | NoteIn the first sample, he removes number 1 from end of the list and places it at the beginning. After that he takes number 2 and places it between 1 and 3.In the second sample, he removes number 5 and inserts it after 1.In the third sample, the sequence of changes are like this: 1 5 2 3 4 1 4 5 2 3 1 3 4 5 2 1 2 3 4... | PASSED | 1,500 | standard input | 2 seconds | The first line contains a single integer n (1 ≤ n ≤ 2·105) — the quantity of the numbers in the both given permutations. Next line contains n space-separated integers — the first permutation. Each number between 1 to n will appear in the permutation exactly once. Next line describe the second permutation in the same ... | ["2", "1", "3"] | /* practice with Dukkha */
#include <stdio.h>
#define N 200000
int main() {
static int pp[N], ii[N];
int n, i, q;
scanf("%d", &n);
for (i = 0; i < n; i++)
scanf("%d", &pp[i]), pp[i]--;
for (i = 0; i < n; i++) {
scanf("%d", &q), q--;
ii[q] = i;
}
for (i = 0; i < n; i++)
pp[i] = ii[pp[i]];
i = 1;
whil... | |
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.The robber girl was angry at first, but then she decided to arrange the animals herself. She re... | Print the sequence of operations that will rearrange the animals by non-decreasing height. The output should contain several lines, i-th of the lines should contain two space-separated integers li and ri (1 ≤ li < ri ≤ n) — descriptions of segments the robber girl should name. The segments should be described in the... | C | 233c2806db31916609421fbd126133d0 | 8bd00a0fd6e403bc129dc81bff428511 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"constructive algorithms",
"implementation",
"sortings"
] | 1466699700 | ["4\n2 1 4 3", "7\n36 28 57 39 66 69 68", "5\n1 2 1 2 1"] | NoteNote that you don't have to minimize the number of operations. Any solution that performs at most 20 000 operations is allowed. | PASSED | 1,100 | standard input | 2 seconds | The first line contains a single integer n (1 ≤ n ≤ 100) — number of animals in the robber girl's zoo. The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 109), where ai is the height of the animal occupying the i-th place. | ["1 4", "1 4\n6 7", "2 5\n3 4\n1 4\n1 4"] | #include <stdio.h>
#include <stdlib.h>
int main()
{
int n;
scanf("%d", &n);
int *v = (int*) malloc(n*sizeof(int));
for (int i = 0; i < n; i++) scanf("%d", &v[i]);
for (int i = n-1; i > 0; --i)
{
for (int j = 0; j < i; j++)
{
if (v[j] > v[j+1])
{
... | |
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.The robber girl was angry at first, but then she decided to arrange the animals herself. She re... | Print the sequence of operations that will rearrange the animals by non-decreasing height. The output should contain several lines, i-th of the lines should contain two space-separated integers li and ri (1 ≤ li < ri ≤ n) — descriptions of segments the robber girl should name. The segments should be described in the... | C | 233c2806db31916609421fbd126133d0 | 5a0edeb56108f6c84412666c16f5c360 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"constructive algorithms",
"implementation",
"sortings"
] | 1466699700 | ["4\n2 1 4 3", "7\n36 28 57 39 66 69 68", "5\n1 2 1 2 1"] | NoteNote that you don't have to minimize the number of operations. Any solution that performs at most 20 000 operations is allowed. | PASSED | 1,100 | standard input | 2 seconds | The first line contains a single integer n (1 ≤ n ≤ 100) — number of animals in the robber girl's zoo. The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 109), where ai is the height of the animal occupying the i-th place. | ["1 4", "1 4\n6 7", "2 5\n3 4\n1 4\n1 4"] | #include <stdio.h>
int main() {
int n;
scanf("%d", &n);
long long grid[n];
for(int i = 0 ; i < n ; i++) {
scanf("%lld", grid+i);
}
/* a[0] to a[n-1] is the array to sort */
int i,j;
/* advance the position through the entire array */
/* (could do j < n-1 because single el... | |
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.The robber girl was angry at first, but then she decided to arrange the animals herself. She re... | Print the sequence of operations that will rearrange the animals by non-decreasing height. The output should contain several lines, i-th of the lines should contain two space-separated integers li and ri (1 ≤ li < ri ≤ n) — descriptions of segments the robber girl should name. The segments should be described in the... | C | 233c2806db31916609421fbd126133d0 | 8ed07d7d5dc125341ec6836bd1fa1158 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"constructive algorithms",
"implementation",
"sortings"
] | 1466699700 | ["4\n2 1 4 3", "7\n36 28 57 39 66 69 68", "5\n1 2 1 2 1"] | NoteNote that you don't have to minimize the number of operations. Any solution that performs at most 20 000 operations is allowed. | PASSED | 1,100 | standard input | 2 seconds | The first line contains a single integer n (1 ≤ n ≤ 100) — number of animals in the robber girl's zoo. The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 109), where ai is the height of the animal occupying the i-th place. | ["1 4", "1 4\n6 7", "2 5\n3 4\n1 4\n1 4"] | #include <stdio.h>
int main()
{
int n,a,t,i,j;
int z[105];
scanf("%d",&n);
for(a=0;n>a;a++){
scanf("%d",&z[a]);
}
i=0;
j=1;
for(;j<n;){
if(z[i]>z[j]){
printf("%d %d\n",i+1,j+1);
t=z[i];
z[i]=z[j];
z[j]=t;
if(z[i-... | |
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.The robber girl was angry at first, but then she decided to arrange the animals herself. She re... | Print the sequence of operations that will rearrange the animals by non-decreasing height. The output should contain several lines, i-th of the lines should contain two space-separated integers li and ri (1 ≤ li < ri ≤ n) — descriptions of segments the robber girl should name. The segments should be described in the... | C | 233c2806db31916609421fbd126133d0 | 796158b7e5af6bf33602222d8582a6fc | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"constructive algorithms",
"implementation",
"sortings"
] | 1466699700 | ["4\n2 1 4 3", "7\n36 28 57 39 66 69 68", "5\n1 2 1 2 1"] | NoteNote that you don't have to minimize the number of operations. Any solution that performs at most 20 000 operations is allowed. | PASSED | 1,100 | standard input | 2 seconds | The first line contains a single integer n (1 ≤ n ≤ 100) — number of animals in the robber girl's zoo. The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 109), where ai is the height of the animal occupying the i-th place. | ["1 4", "1 4\n6 7", "2 5\n3 4\n1 4\n1 4"] | #include <stdio.h>
#define N 100
int sorted(int *aa, int n) {
int i;
for (i = 0; i < n - 1; i++)
if (aa[i] > aa[i + 1])
return 0;
return 1;
}
int main() {
static int aa[N];
int n, i;
scanf("%d", &n);
for (i = 0; i < n; i++)
scanf("%d", &aa[i]);
while (!sorted(aa, n))
for (i = 0; i < n - 1; i++)
... | |
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.The robber girl was angry at first, but then she decided to arrange the animals herself. She re... | Print the sequence of operations that will rearrange the animals by non-decreasing height. The output should contain several lines, i-th of the lines should contain two space-separated integers li and ri (1 ≤ li < ri ≤ n) — descriptions of segments the robber girl should name. The segments should be described in the... | C | 233c2806db31916609421fbd126133d0 | d236bb8bfb70fd0728ba2b5bd7370b25 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"constructive algorithms",
"implementation",
"sortings"
] | 1466699700 | ["4\n2 1 4 3", "7\n36 28 57 39 66 69 68", "5\n1 2 1 2 1"] | NoteNote that you don't have to minimize the number of operations. Any solution that performs at most 20 000 operations is allowed. | PASSED | 1,100 | standard input | 2 seconds | The first line contains a single integer n (1 ≤ n ≤ 100) — number of animals in the robber girl's zoo. The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 109), where ai is the height of the animal occupying the i-th place. | ["1 4", "1 4\n6 7", "2 5\n3 4\n1 4\n1 4"] | #include <stdio.h>
int main() {
static int aa[100];
int i, j, n, tmp;
scanf("%d", &n);
for (i = 0; i < n; i++)
scanf("%d", &aa[i]);
for (i = 0; i < n; i++)
for (j = 1; j < n; j++)
if (aa[j - 1] > aa[j]) {
tmp = aa[j - 1], aa[j - 1] = aa[j], aa[j] = tmp;
printf("%d %d\n", j, j + 1);
}
return 0... | |
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.The robber girl was angry at first, but then she decided to arrange the animals herself. She re... | Print the sequence of operations that will rearrange the animals by non-decreasing height. The output should contain several lines, i-th of the lines should contain two space-separated integers li and ri (1 ≤ li < ri ≤ n) — descriptions of segments the robber girl should name. The segments should be described in the... | C | 233c2806db31916609421fbd126133d0 | 799a579f54cde751679e40b3df750b13 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"constructive algorithms",
"implementation",
"sortings"
] | 1466699700 | ["4\n2 1 4 3", "7\n36 28 57 39 66 69 68", "5\n1 2 1 2 1"] | NoteNote that you don't have to minimize the number of operations. Any solution that performs at most 20 000 operations is allowed. | PASSED | 1,100 | standard input | 2 seconds | The first line contains a single integer n (1 ≤ n ≤ 100) — number of animals in the robber girl's zoo. The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 109), where ai is the height of the animal occupying the i-th place. | ["1 4", "1 4\n6 7", "2 5\n3 4\n1 4\n1 4"] | #include<stdio.h>
int main()
{
int n, f=1, i, x, k;
scanf("%d", &n);
int a[n+1];
for(k=0; k<n; k++)
{
scanf("%d", &a[k]);
}
while(f==1)
{
f=0;
for(i=0; i<n-1; i++)
{
if(a[i]>a[i+1])
{
printf("%d %d\n", i+1, i+2);
f=1;
x=a[i];
a[i]=a[i+1];
a[i+1]=x;
}
}
}
return 0;
} | |
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.The robber girl was angry at first, but then she decided to arrange the animals herself. She re... | Print the sequence of operations that will rearrange the animals by non-decreasing height. The output should contain several lines, i-th of the lines should contain two space-separated integers li and ri (1 ≤ li < ri ≤ n) — descriptions of segments the robber girl should name. The segments should be described in the... | C | 233c2806db31916609421fbd126133d0 | cb5303bbc1bb9a6d86b751ae2ea094ab | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"constructive algorithms",
"implementation",
"sortings"
] | 1466699700 | ["4\n2 1 4 3", "7\n36 28 57 39 66 69 68", "5\n1 2 1 2 1"] | NoteNote that you don't have to minimize the number of operations. Any solution that performs at most 20 000 operations is allowed. | PASSED | 1,100 | standard input | 2 seconds | The first line contains a single integer n (1 ≤ n ≤ 100) — number of animals in the robber girl's zoo. The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 109), where ai is the height of the animal occupying the i-th place. | ["1 4", "1 4\n6 7", "2 5\n3 4\n1 4\n1 4"] | #include <stdio.h>
int main (void){
int n;
scanf("%d", &n);
long h[n];
int i;
for (i=0; i<n; i++)
{
scanf("%ld", &h[i]);
}
int j;
for (i=n; i>1; i--){
for(j=0; j<i-1; j++){
if(h[j]>h[j+1]){
printf("%d %d\n",j+1,j+1+1);
int temp=h[j+1];
h[j+1]=h[j];
h[j]=temp;
}
}
}
}
| |
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.The robber girl was angry at first, but then she decided to arrange the animals herself. She re... | Print the sequence of operations that will rearrange the animals by non-decreasing height. The output should contain several lines, i-th of the lines should contain two space-separated integers li and ri (1 ≤ li < ri ≤ n) — descriptions of segments the robber girl should name. The segments should be described in the... | C | 233c2806db31916609421fbd126133d0 | 15ba4b3f7996a0ca920230ba1fd196a0 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"constructive algorithms",
"implementation",
"sortings"
] | 1466699700 | ["4\n2 1 4 3", "7\n36 28 57 39 66 69 68", "5\n1 2 1 2 1"] | NoteNote that you don't have to minimize the number of operations. Any solution that performs at most 20 000 operations is allowed. | PASSED | 1,100 | standard input | 2 seconds | The first line contains a single integer n (1 ≤ n ≤ 100) — number of animals in the robber girl's zoo. The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 109), where ai is the height of the animal occupying the i-th place. | ["1 4", "1 4\n6 7", "2 5\n3 4\n1 4\n1 4"] | #include<stdio.h>
int main()
{
int n,i,r,t;
scanf("%d",&n);
int a[n+1];
for(i=1;i<=n;i++)
scanf("%d",&a[i]);
r=n;
while(r!=1){
for(i=1;i<r;i++){
if(a[i]>a[i+1]){
t=a[i];
a[i]=a[i+1];
a[i+1]=t;
printf("%d %d\n",i,i+1);
}
}
r--;
}
} | |
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.The robber girl was angry at first, but then she decided to arrange the animals herself. She re... | Print the sequence of operations that will rearrange the animals by non-decreasing height. The output should contain several lines, i-th of the lines should contain two space-separated integers li and ri (1 ≤ li < ri ≤ n) — descriptions of segments the robber girl should name. The segments should be described in the... | C | 233c2806db31916609421fbd126133d0 | 22ebddcdad85dbb5fe58244d1e1929ec | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"constructive algorithms",
"implementation",
"sortings"
] | 1466699700 | ["4\n2 1 4 3", "7\n36 28 57 39 66 69 68", "5\n1 2 1 2 1"] | NoteNote that you don't have to minimize the number of operations. Any solution that performs at most 20 000 operations is allowed. | PASSED | 1,100 | standard input | 2 seconds | The first line contains a single integer n (1 ≤ n ≤ 100) — number of animals in the robber girl's zoo. The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 109), where ai is the height of the animal occupying the i-th place. | ["1 4", "1 4\n6 7", "2 5\n3 4\n1 4\n1 4"] | #include<stdio.h>
int main(){
long long arr[105],n,i,j,temp;
scanf("%lld",&n);
for(i=0;i<n;i++)
scanf("%lld",&arr[i]);
for(i=0;i<n-1;i++){
for(j=0;j<n-i-1;j++){
if(arr[j]>arr[j+1]){
temp= arr[j];
arr[j]=arr[j+1];
arr[j+1]=temp;
printf("%lld %lld\n",j+1,j+2);
}
}
}
return 0;
}
| |
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.The robber girl was angry at first, but then she decided to arrange the animals herself. She re... | Print the sequence of operations that will rearrange the animals by non-decreasing height. The output should contain several lines, i-th of the lines should contain two space-separated integers li and ri (1 ≤ li < ri ≤ n) — descriptions of segments the robber girl should name. The segments should be described in the... | C | 233c2806db31916609421fbd126133d0 | d7b757cdbd03a0f5d9bbff984b90d7fa | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"constructive algorithms",
"implementation",
"sortings"
] | 1466699700 | ["4\n2 1 4 3", "7\n36 28 57 39 66 69 68", "5\n1 2 1 2 1"] | NoteNote that you don't have to minimize the number of operations. Any solution that performs at most 20 000 operations is allowed. | PASSED | 1,100 | standard input | 2 seconds | The first line contains a single integer n (1 ≤ n ≤ 100) — number of animals in the robber girl's zoo. The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 109), where ai is the height of the animal occupying the i-th place. | ["1 4", "1 4\n6 7", "2 5\n3 4\n1 4\n1 4"] | #include <stdio.h>
int main (void){
int n;
scanf("%d", &n);
long h[n];
int i;
for (i=0; i<n; i++)
{
scanf("%ld", &h[i]);
}
int j;
for (i=n; i>1; i--){
for(j=0; j<i-1; j++){
if(h[j]>h[j+1]){
printf("%d %d\n",j+1,j+1+1);
int temp=h[j+1];
h[j+1]=h[j];
h[j]=temp;
}
}
}
} | |
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.The robber girl was angry at first, but then she decided to arrange the animals herself. She re... | Print the sequence of operations that will rearrange the animals by non-decreasing height. The output should contain several lines, i-th of the lines should contain two space-separated integers li and ri (1 ≤ li < ri ≤ n) — descriptions of segments the robber girl should name. The segments should be described in the... | C | 233c2806db31916609421fbd126133d0 | c761104b58f44001fc0e566bae7164ad | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"constructive algorithms",
"implementation",
"sortings"
] | 1466699700 | ["4\n2 1 4 3", "7\n36 28 57 39 66 69 68", "5\n1 2 1 2 1"] | NoteNote that you don't have to minimize the number of operations. Any solution that performs at most 20 000 operations is allowed. | PASSED | 1,100 | standard input | 2 seconds | The first line contains a single integer n (1 ≤ n ≤ 100) — number of animals in the robber girl's zoo. The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 109), where ai is the height of the animal occupying the i-th place. | ["1 4", "1 4\n6 7", "2 5\n3 4\n1 4\n1 4"] | #include <stdlib.h>
#include <stdio.h>
int main()
{
int n, x;
scanf("%d", &n);
long long int A[n];
for(x=0; x<n; x++)
{
scanf("%lld", &A[x]);
}
int temp, swapped;
while(1)
{
swapped = 0;
for(x=0; x<n-1; x++)
{
if(A[x]>A[x+1])
... | |
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.The robber girl was angry at first, but then she decided to arrange the animals herself. She re... | Print the sequence of operations that will rearrange the animals by non-decreasing height. The output should contain several lines, i-th of the lines should contain two space-separated integers li and ri (1 ≤ li < ri ≤ n) — descriptions of segments the robber girl should name. The segments should be described in the... | C | 233c2806db31916609421fbd126133d0 | a708d290fdb144afa03c5fea259c2982 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"constructive algorithms",
"implementation",
"sortings"
] | 1466699700 | ["4\n2 1 4 3", "7\n36 28 57 39 66 69 68", "5\n1 2 1 2 1"] | NoteNote that you don't have to minimize the number of operations. Any solution that performs at most 20 000 operations is allowed. | PASSED | 1,100 | standard input | 2 seconds | The first line contains a single integer n (1 ≤ n ≤ 100) — number of animals in the robber girl's zoo. The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 109), where ai is the height of the animal occupying the i-th place. | ["1 4", "1 4\n6 7", "2 5\n3 4\n1 4\n1 4"] | #include <stdio.h>
int main()
{
int n;
scanf("%d", &n);
long h[n];
for (int i = 0; i < n; i++)
scanf("%ld", h+i);
int run = 1;
while (run)
{
run = 0;
for (int i = 0; i < n-1; i++)
{
if (h[i] > h[i+1])
{
printf("%d %d\n", i+1, i+2);
h[i] ^= h[i+1];
h[i+1] ^= h[i];
h[i] ^= h[i+1]... | |
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.The robber girl was angry at first, but then she decided to arrange the animals herself. She re... | Print the sequence of operations that will rearrange the animals by non-decreasing height. The output should contain several lines, i-th of the lines should contain two space-separated integers li and ri (1 ≤ li < ri ≤ n) — descriptions of segments the robber girl should name. The segments should be described in the... | C | 233c2806db31916609421fbd126133d0 | bf4ce6929c3d69edc2893053fc0df3fa | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"constructive algorithms",
"implementation",
"sortings"
] | 1466699700 | ["4\n2 1 4 3", "7\n36 28 57 39 66 69 68", "5\n1 2 1 2 1"] | NoteNote that you don't have to minimize the number of operations. Any solution that performs at most 20 000 operations is allowed. | PASSED | 1,100 | standard input | 2 seconds | The first line contains a single integer n (1 ≤ n ≤ 100) — number of animals in the robber girl's zoo. The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 109), where ai is the height of the animal occupying the i-th place. | ["1 4", "1 4\n6 7", "2 5\n3 4\n1 4\n1 4"] | #include <stdio.h>
int main(void) {
int n,a[102],i=0,flag=1;
scanf("%d",&n);
while(i<n)
{
scanf("%d",&a[i]);
i++;
}
while(flag)
{
i=0;
flag=0;
while(i<n-1)
{
if(a[i+1]<a[i])
{
int temp=a[i];
a[i]=a[i+1];
a[i+1]=temp;
printf("%d %d\n",i+1,i+2);
flag=1;
}
i+... | |
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.The robber girl was angry at first, but then she decided to arrange the animals herself. She re... | Print the sequence of operations that will rearrange the animals by non-decreasing height. The output should contain several lines, i-th of the lines should contain two space-separated integers li and ri (1 ≤ li < ri ≤ n) — descriptions of segments the robber girl should name. The segments should be described in the... | C | 233c2806db31916609421fbd126133d0 | 68bc32a85bea9c4ea8875e250f39171a | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"constructive algorithms",
"implementation",
"sortings"
] | 1466699700 | ["4\n2 1 4 3", "7\n36 28 57 39 66 69 68", "5\n1 2 1 2 1"] | NoteNote that you don't have to minimize the number of operations. Any solution that performs at most 20 000 operations is allowed. | PASSED | 1,100 | standard input | 2 seconds | The first line contains a single integer n (1 ≤ n ≤ 100) — number of animals in the robber girl's zoo. The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 109), where ai is the height of the animal occupying the i-th place. | ["1 4", "1 4\n6 7", "2 5\n3 4\n1 4\n1 4"] | /* 20160711 JJA Codeforces #359 B.Little Robber Girl's Zoo */
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
int isInversion(int start);
void swapping(int s, int e);
unsigned long long* height;
int l;
int r;
int tmpL;
int tmpR;
int between;
int n;
int main() {
n = 0;
l = 0;
r = -2;
tmpL... | |
Little Robber Girl likes to scare animals in her zoo for fun. She decided to arrange the animals in a row in the order of non-decreasing height. However, the animals were so scared that they couldn't stay in the right places.The robber girl was angry at first, but then she decided to arrange the animals herself. She re... | Print the sequence of operations that will rearrange the animals by non-decreasing height. The output should contain several lines, i-th of the lines should contain two space-separated integers li and ri (1 ≤ li < ri ≤ n) — descriptions of segments the robber girl should name. The segments should be described in the... | C | 233c2806db31916609421fbd126133d0 | ae95619f4ce4ebe3bb2071f59bdfd02e | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"constructive algorithms",
"implementation",
"sortings"
] | 1466699700 | ["4\n2 1 4 3", "7\n36 28 57 39 66 69 68", "5\n1 2 1 2 1"] | NoteNote that you don't have to minimize the number of operations. Any solution that performs at most 20 000 operations is allowed. | PASSED | 1,100 | standard input | 2 seconds | The first line contains a single integer n (1 ≤ n ≤ 100) — number of animals in the robber girl's zoo. The second line contains n space-separated integers a1, a2, ..., an (1 ≤ ai ≤ 109), where ai is the height of the animal occupying the i-th place. | ["1 4", "1 4\n6 7", "2 5\n3 4\n1 4\n1 4"] |
#include <stdio.h>
#include <stdlib.h>
/*
*
*/
int main(int argc, char** argv) {
int i, j, n, check = 0;
scanf("%d", &n);
long long a[n], x;
for (i = 0; i < n; i++) {
scanf("%I64d", &a[i]);
}
for (i = 0; i < n; i++) {
check = 0;
while (a[i] > a[i + 1]) {
... | |
Kolya got an integer array $$$a_1, a_2, \dots, a_n$$$. The array can contain both positive and negative integers, but Kolya doesn't like $$$0$$$, so the array doesn't contain any zeros.Kolya doesn't like that the sum of some subsegments of his array can be $$$0$$$. The subsegment is some consecutive segment of elements... | Print the minimum number of integers you have to insert into Kolya's array in such a way that the resulting array doesn't contain any subsegments with the sum $$$0$$$. | C | 05548be393d794bf106708627220b9a3 | b2f0cf8bd469a62c585e052c67b2e6f2 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"data structures",
"constructive algorithms",
"sortings",
"greedy"
] | 1601280300 | ["4\n1 -5 3 2", "5\n4 -2 3 -9 2", "9\n-1 1 -1 1 -1 1 1 -1 -1", "8\n16 -5 -11 -15 10 5 4 -4"] | NoteConsider the first example. There is only one subsegment with the sum $$$0$$$. It starts in the second element and ends in the fourth element. It's enough to insert one element so the array doesn't contain any subsegments with the sum equal to zero. For example, it is possible to insert the integer $$$1$$$ between ... | PASSED | 1,500 | standard input | 2 seconds | The first line of the input contains one integer $$$n$$$ ($$$2 \le n \le 200\,000$$$) — the number of elements in Kolya's array. The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$-10^{9} \le a_i \le 10^{9}, a_i \neq 0$$$) — the description of Kolya's array. | ["1", "0", "6", "3"] | #include<stdio.h>
long long int sum[200005];
int u[200005], v[200005], m;
int h[200005], l;
int comp_h(int a, int b, int z)
{
if (z == 0)
{
if (sum[h[a]] > sum[h[b]])
return 1;
else if (sum[h[a]] < sum[h[b]])
return -1;
else if (h[a] > h[b])
return 1;
else
return -1;
}
else
{
if (v[h[a]] > v[... | |
Kolya got an integer array $$$a_1, a_2, \dots, a_n$$$. The array can contain both positive and negative integers, but Kolya doesn't like $$$0$$$, so the array doesn't contain any zeros.Kolya doesn't like that the sum of some subsegments of his array can be $$$0$$$. The subsegment is some consecutive segment of elements... | Print the minimum number of integers you have to insert into Kolya's array in such a way that the resulting array doesn't contain any subsegments with the sum $$$0$$$. | C | 05548be393d794bf106708627220b9a3 | 1cfd66a57fe263cd190d5fc43a84f63a | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"data structures",
"constructive algorithms",
"sortings",
"greedy"
] | 1601280300 | ["4\n1 -5 3 2", "5\n4 -2 3 -9 2", "9\n-1 1 -1 1 -1 1 1 -1 -1", "8\n16 -5 -11 -15 10 5 4 -4"] | NoteConsider the first example. There is only one subsegment with the sum $$$0$$$. It starts in the second element and ends in the fourth element. It's enough to insert one element so the array doesn't contain any subsegments with the sum equal to zero. For example, it is possible to insert the integer $$$1$$$ between ... | PASSED | 1,500 | standard input | 2 seconds | The first line of the input contains one integer $$$n$$$ ($$$2 \le n \le 200\,000$$$) — the number of elements in Kolya's array. The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$-10^{9} \le a_i \le 10^{9}, a_i \neq 0$$$) — the description of Kolya's array. | ["1", "0", "6", "3"] | #pragma region kyopuro_templates
#pragma GCC optimize("Ofast")
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>
#include<assert.h>
#include<time.h>
#include<ctype.h>
typedef long long ll;
typedef long double ld;
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)f... | |
Kolya got an integer array $$$a_1, a_2, \dots, a_n$$$. The array can contain both positive and negative integers, but Kolya doesn't like $$$0$$$, so the array doesn't contain any zeros.Kolya doesn't like that the sum of some subsegments of his array can be $$$0$$$. The subsegment is some consecutive segment of elements... | Print the minimum number of integers you have to insert into Kolya's array in such a way that the resulting array doesn't contain any subsegments with the sum $$$0$$$. | C | 05548be393d794bf106708627220b9a3 | 673fb886466bf076395a2b647616a922 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"data structures",
"constructive algorithms",
"sortings",
"greedy"
] | 1601280300 | ["4\n1 -5 3 2", "5\n4 -2 3 -9 2", "9\n-1 1 -1 1 -1 1 1 -1 -1", "8\n16 -5 -11 -15 10 5 4 -4"] | NoteConsider the first example. There is only one subsegment with the sum $$$0$$$. It starts in the second element and ends in the fourth element. It's enough to insert one element so the array doesn't contain any subsegments with the sum equal to zero. For example, it is possible to insert the integer $$$1$$$ between ... | PASSED | 1,500 | standard input | 2 seconds | The first line of the input contains one integer $$$n$$$ ($$$2 \le n \le 200\,000$$$) — the number of elements in Kolya's array. The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$-10^{9} \le a_i \le 10^{9}, a_i \neq 0$$$) — the description of Kolya's array. | ["1", "0", "6", "3"] | #include <stdio.h>
#include <stdlib.h>
typedef struct Node {
long long int val;
struct Node *next;
} Node;
Node** setCreate(int size);
int setHash(int size, long long int val);
int setContains(Node** set, int size, long long int val);
void setAdd(Node** set, int size, long long int val);
void setDestroy(Node** set,... | |
Kolya got an integer array $$$a_1, a_2, \dots, a_n$$$. The array can contain both positive and negative integers, but Kolya doesn't like $$$0$$$, so the array doesn't contain any zeros.Kolya doesn't like that the sum of some subsegments of his array can be $$$0$$$. The subsegment is some consecutive segment of elements... | Print the minimum number of integers you have to insert into Kolya's array in such a way that the resulting array doesn't contain any subsegments with the sum $$$0$$$. | C | 05548be393d794bf106708627220b9a3 | 5be7a0f151a306144abeb798df9e6316 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"data structures",
"constructive algorithms",
"sortings",
"greedy"
] | 1601280300 | ["4\n1 -5 3 2", "5\n4 -2 3 -9 2", "9\n-1 1 -1 1 -1 1 1 -1 -1", "8\n16 -5 -11 -15 10 5 4 -4"] | NoteConsider the first example. There is only one subsegment with the sum $$$0$$$. It starts in the second element and ends in the fourth element. It's enough to insert one element so the array doesn't contain any subsegments with the sum equal to zero. For example, it is possible to insert the integer $$$1$$$ between ... | PASSED | 1,500 | standard input | 2 seconds | The first line of the input contains one integer $$$n$$$ ($$$2 \le n \le 200\,000$$$) — the number of elements in Kolya's array. The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$-10^{9} \le a_i \le 10^{9}, a_i \neq 0$$$) — the description of Kolya's array. | ["1", "0", "6", "3"] | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
typedef long long value_t;
typedef struct node node;
struct node {
value_t val;
node *next;
};
node *node_new(value_t val) {
node *n = malloc(sizeof(node));
n->val = val;
n->next = NULL;
return n;
}
void node_free(node *n) {
if ... | |
Kolya got an integer array $$$a_1, a_2, \dots, a_n$$$. The array can contain both positive and negative integers, but Kolya doesn't like $$$0$$$, so the array doesn't contain any zeros.Kolya doesn't like that the sum of some subsegments of his array can be $$$0$$$. The subsegment is some consecutive segment of elements... | Print the minimum number of integers you have to insert into Kolya's array in such a way that the resulting array doesn't contain any subsegments with the sum $$$0$$$. | C | 05548be393d794bf106708627220b9a3 | 56e8efdc730da8d2bcb5d06672e62d29 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"data structures",
"constructive algorithms",
"sortings",
"greedy"
] | 1601280300 | ["4\n1 -5 3 2", "5\n4 -2 3 -9 2", "9\n-1 1 -1 1 -1 1 1 -1 -1", "8\n16 -5 -11 -15 10 5 4 -4"] | NoteConsider the first example. There is only one subsegment with the sum $$$0$$$. It starts in the second element and ends in the fourth element. It's enough to insert one element so the array doesn't contain any subsegments with the sum equal to zero. For example, it is possible to insert the integer $$$1$$$ between ... | PASSED | 1,500 | standard input | 2 seconds | The first line of the input contains one integer $$$n$$$ ($$$2 \le n \le 200\,000$$$) — the number of elements in Kolya's array. The second line of the input contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$-10^{9} \le a_i \le 10^{9}, a_i \neq 0$$$) — the description of Kolya's array. | ["1", "0", "6", "3"] | #include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
typedef long long value_t;
typedef struct node node;
struct node {
value_t val;
node *next;
};
node *node_new(value_t val) {
node *n = malloc(sizeof(node));
n->val = val;
n->next = NULL;
return n;
}
void node_free(node *n) {
if ... | |
On a number axis directed from the left rightwards, n marbles with coordinates x1, x2, ..., xn are situated. Let's assume that the sizes of the marbles are infinitely small, that is in this task each of them is assumed to be a material point. You can stick pins in some of them and the cost of sticking in the marble num... | Output the single number — the least fine you will have to pay. | C | 334d2bcb32d88a7037bcf262f49938cf | e01b38eb7108ac2d382eb9e76f9150b4 | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"dp",
"sortings"
] | 1288440000 | ["3\n2 3\n3 4\n1 2", "4\n1 7\n3 1\n5 10\n6 1"] | null | PASSED | 1,800 | standard input | 2 seconds | The first input line contains an integer n (1 ≤ n ≤ 3000) which is the number of marbles. The next n lines contain the descriptions of the marbles in pairs of integers xi, ci ( - 109 ≤ xi, ci ≤ 109). The numbers are space-separated. Each description is given on a separate line. No two marbles have identical initial pos... | ["5", "11"] | #include <stdio.h>
#define MAXN 3005
#define oo 9223372036854775807LL
long n;
long long f[MAXN][MAXN]={0},min,ans=oo;
char h[MAXN][MAXN]={'\0'};
struct point {long long d,c;}a[MAXN]={0},tmp={0};
void qsort(long left,long right)
{
if(left<right)
{
long l=left,r=right,mid=(l+r)>>1;
tmp=a[mid];a[mid]=a[l];
whi... | |
On a number axis directed from the left rightwards, n marbles with coordinates x1, x2, ..., xn are situated. Let's assume that the sizes of the marbles are infinitely small, that is in this task each of them is assumed to be a material point. You can stick pins in some of them and the cost of sticking in the marble num... | Output the single number — the least fine you will have to pay. | C | 334d2bcb32d88a7037bcf262f49938cf | 47525d5c2306223a191549167a7a21d8 | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"dp",
"sortings"
] | 1288440000 | ["3\n2 3\n3 4\n1 2", "4\n1 7\n3 1\n5 10\n6 1"] | null | PASSED | 1,800 | standard input | 2 seconds | The first input line contains an integer n (1 ≤ n ≤ 3000) which is the number of marbles. The next n lines contain the descriptions of the marbles in pairs of integers xi, ci ( - 109 ≤ xi, ci ≤ 109). The numbers are space-separated. Each description is given on a separate line. No two marbles have identical initial pos... | ["5", "11"] | #include <stdio.h>
#include <stdlib.h>
long long dp[3000][3000];
typedef struct {
int x;
int c;
} marble;
int cmp(const void *a, const void *b)
{
return ((marble *)a)->x - ((marble *)b)->x;
}
long long minimum(long long a, long long b)
{
if (a < b) {
return a;
} else {
return b;
... | |
On a number axis directed from the left rightwards, n marbles with coordinates x1, x2, ..., xn are situated. Let's assume that the sizes of the marbles are infinitely small, that is in this task each of them is assumed to be a material point. You can stick pins in some of them and the cost of sticking in the marble num... | Output the single number — the least fine you will have to pay. | C | 334d2bcb32d88a7037bcf262f49938cf | 2dac2c457d4dd8ee31060ccca1b5afd8 | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"dp",
"sortings"
] | 1288440000 | ["3\n2 3\n3 4\n1 2", "4\n1 7\n3 1\n5 10\n6 1"] | null | PASSED | 1,800 | standard input | 2 seconds | The first input line contains an integer n (1 ≤ n ≤ 3000) which is the number of marbles. The next n lines contain the descriptions of the marbles in pairs of integers xi, ci ( - 109 ≤ xi, ci ≤ 109). The numbers are space-separated. Each description is given on a separate line. No two marbles have identical initial pos... | ["5", "11"] | #include <stdio.h>
#define oo 1000000000
struct zxf
{
long long c,x;
}a[5000]={0,0},tmp;
long long f[5000]={0};
void quick(long l,long r)
{
long i,j,t;
t=(l+r)/2; i=l; j=r+1;
while(i<j)
{
while(i<j && a[i].x>a[t].x) i++;
if(i<j)
{
tmp=a[i]; a[i]=a[t]; a[t]=tmp;
... | |
On a number axis directed from the left rightwards, n marbles with coordinates x1, x2, ..., xn are situated. Let's assume that the sizes of the marbles are infinitely small, that is in this task each of them is assumed to be a material point. You can stick pins in some of them and the cost of sticking in the marble num... | Output the single number — the least fine you will have to pay. | C | 334d2bcb32d88a7037bcf262f49938cf | 51c69ec7ee12ec36d50c45ac286367ff | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"dp",
"sortings"
] | 1288440000 | ["3\n2 3\n3 4\n1 2", "4\n1 7\n3 1\n5 10\n6 1"] | null | PASSED | 1,800 | standard input | 2 seconds | The first input line contains an integer n (1 ≤ n ≤ 3000) which is the number of marbles. The next n lines contain the descriptions of the marbles in pairs of integers xi, ci ( - 109 ≤ xi, ci ≤ 109). The numbers are space-separated. Each description is given on a separate line. No two marbles have identical initial pos... | ["5", "11"] | #include <stdio.h>
#include <stdlib.h>
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define INF 1ll << 62
typedef long long ll;
struct marble
{
int x;
int c;
};
struct marble a[3000];
ll dp[3000][2];
ll d[3000][3000];
int cmp(const void *_p, const void *_q)
{
struct marble *p = (struct marble *)_p;
st... | |
On a number axis directed from the left rightwards, n marbles with coordinates x1, x2, ..., xn are situated. Let's assume that the sizes of the marbles are infinitely small, that is in this task each of them is assumed to be a material point. You can stick pins in some of them and the cost of sticking in the marble num... | Output the single number — the least fine you will have to pay. | C | 334d2bcb32d88a7037bcf262f49938cf | fbbc2df257e5dc7b96a6f848956a67d8 | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"dp",
"sortings"
] | 1288440000 | ["3\n2 3\n3 4\n1 2", "4\n1 7\n3 1\n5 10\n6 1"] | null | PASSED | 1,800 | standard input | 2 seconds | The first input line contains an integer n (1 ≤ n ≤ 3000) which is the number of marbles. The next n lines contain the descriptions of the marbles in pairs of integers xi, ci ( - 109 ≤ xi, ci ≤ 109). The numbers are space-separated. Each description is given on a separate line. No two marbles have identical initial pos... | ["5", "11"] | #include <stdio.h>
#define oo 100000000000000000LL
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
struct case1
{
long long x,c;
}dian[3005]={{0,0}};
long long f[3005]={0};
long long g[3005]={0};
int main()
{
long long n,i,j;
long long s=0;
struct case1 temp;
scanf("%I64d",&n);
for(i=1... | |
On a number axis directed from the left rightwards, n marbles with coordinates x1, x2, ..., xn are situated. Let's assume that the sizes of the marbles are infinitely small, that is in this task each of them is assumed to be a material point. You can stick pins in some of them and the cost of sticking in the marble num... | Output the single number — the least fine you will have to pay. | C | 334d2bcb32d88a7037bcf262f49938cf | 3f327a51f2bb2a84328e6dfa9e51f154 | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"dp",
"sortings"
] | 1288440000 | ["3\n2 3\n3 4\n1 2", "4\n1 7\n3 1\n5 10\n6 1"] | null | PASSED | 1,800 | standard input | 2 seconds | The first input line contains an integer n (1 ≤ n ≤ 3000) which is the number of marbles. The next n lines contain the descriptions of the marbles in pairs of integers xi, ci ( - 109 ≤ xi, ci ≤ 109). The numbers are space-separated. Each description is given on a separate line. No two marbles have identical initial pos... | ["5", "11"] | #include<math.h>
#include<time.h>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#define oo 1000000000000000000LL
#define pi 3.14159265359
#define zero(a) (abb(a)<=1e-7)
#define lowbit(a) ((a)&(-(a)))
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define abb(a) ((a)>0?(a):(-(a)))
#defin... | |
On a number axis directed from the left rightwards, n marbles with coordinates x1, x2, ..., xn are situated. Let's assume that the sizes of the marbles are infinitely small, that is in this task each of them is assumed to be a material point. You can stick pins in some of them and the cost of sticking in the marble num... | Output the single number — the least fine you will have to pay. | C | 334d2bcb32d88a7037bcf262f49938cf | 06de4b170cc7d631006f86ded18c00f4 | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"dp",
"sortings"
] | 1288440000 | ["3\n2 3\n3 4\n1 2", "4\n1 7\n3 1\n5 10\n6 1"] | null | PASSED | 1,800 | standard input | 2 seconds | The first input line contains an integer n (1 ≤ n ≤ 3000) which is the number of marbles. The next n lines contain the descriptions of the marbles in pairs of integers xi, ci ( - 109 ≤ xi, ci ≤ 109). The numbers are space-separated. Each description is given on a separate line. No two marbles have identical initial pos... | ["5", "11"] | long long dp[3000][3000];
typedef struct {
int x;
int c;
} marble;
int cmp(const void *a, const void *b)
{
return ((marble *)a)->x - ((marble *)b)->x;
}
long long minimum(long long a, long long b)
{
if (a < b) {
return a;
} else {
return b;
}
}
int main()
{
int n, p = ... | |
Sometimes some words like "localization" or "internationalization" are so long that writing them many times in one text is quite tiresome.Let's consider a word too long, if its length is strictly more than 10 characters. All too long words should be replaced with a special abbreviation.This abbreviation is made like th... | Print n lines. The i-th line should contain the result of replacing of the i-th word from the input data. | C | 6639d6c53951f8c1a8324fb24ef68f7a | 8c84adf3593acd6c844f0f7f793f6e43 | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"strings"
] | 1301410800 | ["4\nword\nlocalization\ninternationalization\npneumonoultramicroscopicsilicovolcanoconiosis"] | null | PASSED | 800 | standard input | 1 second | The first line contains an integer n (1 ≤ n ≤ 100). Each of the following n lines contains one word. All the words consist of lowercase Latin letters and possess the lengths of from 1 to 100 characters. | ["word\nl10n\ni18n\np43s"] | #include<stdio.h>
main(){
int a,i,j,sum;
char n[200];
scanf("%d",&a);
for(i=1;i<=a;i++){
scanf("%s",n);
sum=0;
for(j=0;n[j]!='\0';j++){
sum++;
}
if(sum>10)
printf("%c%d%c\n",n[0],sum-2,n[sum-1]);
else
printf("%s\n",n);
}
} | |
Sometimes some words like "localization" or "internationalization" are so long that writing them many times in one text is quite tiresome.Let's consider a word too long, if its length is strictly more than 10 characters. All too long words should be replaced with a special abbreviation.This abbreviation is made like th... | Print n lines. The i-th line should contain the result of replacing of the i-th word from the input data. | C | 6639d6c53951f8c1a8324fb24ef68f7a | 9767ea67610b1a85e5bd9b1532a4044d | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"strings"
] | 1301410800 | ["4\nword\nlocalization\ninternationalization\npneumonoultramicroscopicsilicovolcanoconiosis"] | null | PASSED | 800 | standard input | 1 second | The first line contains an integer n (1 ≤ n ≤ 100). Each of the following n lines contains one word. All the words consist of lowercase Latin letters and possess the lengths of from 1 to 100 characters. | ["word\nl10n\ni18n\np43s"] | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{ char* word;
int x,i,y;
scanf("%d",&x);
for(i=0;i<x;i++)
{
word=(char*)malloc(sizeof(char)*120);
scanf("%s",word);
y=strlen(word);
if(y<=10)
printf("%s\n",word);
else
printf("%c%d%c\n",*word,(y-2),*(wo... | |
Sometimes some words like "localization" or "internationalization" are so long that writing them many times in one text is quite tiresome.Let's consider a word too long, if its length is strictly more than 10 characters. All too long words should be replaced with a special abbreviation.This abbreviation is made like th... | Print n lines. The i-th line should contain the result of replacing of the i-th word from the input data. | C | 6639d6c53951f8c1a8324fb24ef68f7a | 9e159b97af6bc3bcc8ffebcb5042dbfc | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"strings"
] | 1301410800 | ["4\nword\nlocalization\ninternationalization\npneumonoultramicroscopicsilicovolcanoconiosis"] | null | PASSED | 800 | standard input | 1 second | The first line contains an integer n (1 ≤ n ≤ 100). Each of the following n lines contains one word. All the words consist of lowercase Latin letters and possess the lengths of from 1 to 100 characters. | ["word\nl10n\ni18n\np43s"] | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main()
{
char* a;
a=calloc(102,sizeof(char));
int num;
scanf("%d",&num);
int i=0;
int x;
while(i!=num)
{
scanf("%s",a);
x=strlen(a);
if((x)<=10)
... | |
Sometimes some words like "localization" or "internationalization" are so long that writing them many times in one text is quite tiresome.Let's consider a word too long, if its length is strictly more than 10 characters. All too long words should be replaced with a special abbreviation.This abbreviation is made like th... | Print n lines. The i-th line should contain the result of replacing of the i-th word from the input data. | C | 6639d6c53951f8c1a8324fb24ef68f7a | c6c358fb47f886e468dbf79c3cf2f1ff | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"strings"
] | 1301410800 | ["4\nword\nlocalization\ninternationalization\npneumonoultramicroscopicsilicovolcanoconiosis"] | null | PASSED | 800 | standard input | 1 second | The first line contains an integer n (1 ≤ n ≤ 100). Each of the following n lines contains one word. All the words consist of lowercase Latin letters and possess the lengths of from 1 to 100 characters. | ["word\nl10n\ni18n\np43s"] | #include <stdio.h>
int main(void)
{
int g,i;
scanf("%d",&g);
char w[100][10000];
for(i=0;i<g;i++)
{
scanf("%s",&w[i]);
}
int j,k,l[100];
for(j=0;j<g;j++)
{
l[j]=strlen(w[j]);
}
for(k=0;k<g;k++)
{
if(l[k]<=10)
{
printf("%s",w[k]);
}
else
{
... | |
Sometimes some words like "localization" or "internationalization" are so long that writing them many times in one text is quite tiresome.Let's consider a word too long, if its length is strictly more than 10 characters. All too long words should be replaced with a special abbreviation.This abbreviation is made like th... | Print n lines. The i-th line should contain the result of replacing of the i-th word from the input data. | C | 6639d6c53951f8c1a8324fb24ef68f7a | 95e85eb203a590170bbdf03abf85000e | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"strings"
] | 1301410800 | ["4\nword\nlocalization\ninternationalization\npneumonoultramicroscopicsilicovolcanoconiosis"] | null | PASSED | 800 | standard input | 1 second | The first line contains an integer n (1 ≤ n ≤ 100). Each of the following n lines contains one word. All the words consist of lowercase Latin letters and possess the lengths of from 1 to 100 characters. | ["word\nl10n\ni18n\np43s"] | #include<stdio.h>
int panduan(char *p);
int main()
{
int i,n;
char str[105];
scanf("%d",&n);
while(n--)
{
scanf("%s",str);
i=panduan(str);
if(i>10)
{
printf("%c%d%c\n",str[0],(i-2),str[i-1]);
}
else
{
printf("%s\n",str);
}
}
return 0;
}
int panduan(char *p)
{
int i;
for(i=0;i<105;i++)
{... | |
Sometimes some words like "localization" or "internationalization" are so long that writing them many times in one text is quite tiresome.Let's consider a word too long, if its length is strictly more than 10 characters. All too long words should be replaced with a special abbreviation.This abbreviation is made like th... | Print n lines. The i-th line should contain the result of replacing of the i-th word from the input data. | C | 6639d6c53951f8c1a8324fb24ef68f7a | fe1da7d0d514c7453030fbc6bface2dc | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"strings"
] | 1301410800 | ["4\nword\nlocalization\ninternationalization\npneumonoultramicroscopicsilicovolcanoconiosis"] | null | PASSED | 800 | standard input | 1 second | The first line contains an integer n (1 ≤ n ≤ 100). Each of the following n lines contains one word. All the words consist of lowercase Latin letters and possess the lengths of from 1 to 100 characters. | ["word\nl10n\ni18n\np43s"] | #include<stdio.h>
#include<string.h>
void wtlw(char s[101])
{
int k=0,i=0;
k=strlen(s);
if(k>10)
printf("%c%d%c\n",s[0],k-2,s[k-1]);
else
printf("%s\n",s);
}
int main()
{
char s[100][101];
int n,i;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%s",s[i]);
}
for(i=0;i<n;i++)
wtlw(s[i]);
return 0;
} | |
Sometimes some words like "localization" or "internationalization" are so long that writing them many times in one text is quite tiresome.Let's consider a word too long, if its length is strictly more than 10 characters. All too long words should be replaced with a special abbreviation.This abbreviation is made like th... | Print n lines. The i-th line should contain the result of replacing of the i-th word from the input data. | C | 6639d6c53951f8c1a8324fb24ef68f7a | 68000257c339eee53f3bea89085470c8 | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"strings"
] | 1301410800 | ["4\nword\nlocalization\ninternationalization\npneumonoultramicroscopicsilicovolcanoconiosis"] | null | PASSED | 800 | standard input | 1 second | The first line contains an integer n (1 ≤ n ≤ 100). Each of the following n lines contains one word. All the words consist of lowercase Latin letters and possess the lengths of from 1 to 100 characters. | ["word\nl10n\ni18n\np43s"] | #include <stdio.h>
#include <string.h>
int main()
{
int i,j,n;
scanf("%d",&n);
char a[n][150];
for(i=0;i<n;i++)
scanf("%s",&a[i]);
for(i=0;i<n;i++)
if(strlen(a[i])>10)
printf("%c%d%c\n",a[i][0],strlen(a[i])-2,a[i][strlen(a[i])-1]);
else puts(a[i]);
return 0;
}
| |
Sometimes some words like "localization" or "internationalization" are so long that writing them many times in one text is quite tiresome.Let's consider a word too long, if its length is strictly more than 10 characters. All too long words should be replaced with a special abbreviation.This abbreviation is made like th... | Print n lines. The i-th line should contain the result of replacing of the i-th word from the input data. | C | 6639d6c53951f8c1a8324fb24ef68f7a | cb12b57521c788646fd0f33d5b981067 | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"strings"
] | 1301410800 | ["4\nword\nlocalization\ninternationalization\npneumonoultramicroscopicsilicovolcanoconiosis"] | null | PASSED | 800 | standard input | 1 second | The first line contains an integer n (1 ≤ n ≤ 100). Each of the following n lines contains one word. All the words consist of lowercase Latin letters and possess the lengths of from 1 to 100 characters. | ["word\nl10n\ni18n\np43s"] | #include<stdio.h>
#include<string.h>
int main()
{
int n,l;
char s[100];
scanf("%d",&n);
while(n--){
scanf("%s",s);
l=strlen(s);
if(l<=10)
printf("%s\n",s);
else
printf("%c%d%c\n",s[0],l-2,s[l-1]);
}
return 0;
} | |
Sometimes some words like "localization" or "internationalization" are so long that writing them many times in one text is quite tiresome.Let's consider a word too long, if its length is strictly more than 10 characters. All too long words should be replaced with a special abbreviation.This abbreviation is made like th... | Print n lines. The i-th line should contain the result of replacing of the i-th word from the input data. | C | 6639d6c53951f8c1a8324fb24ef68f7a | 21bc8f548656b926e6aaa38052fca86c | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"strings"
] | 1301410800 | ["4\nword\nlocalization\ninternationalization\npneumonoultramicroscopicsilicovolcanoconiosis"] | null | PASSED | 800 | standard input | 1 second | The first line contains an integer n (1 ≤ n ≤ 100). Each of the following n lines contains one word. All the words consist of lowercase Latin letters and possess the lengths of from 1 to 100 characters. | ["word\nl10n\ni18n\np43s"] | #include<stdio.h>
#include<string.h>
int main()
{
int i,n;
char a[100];
scanf("%d",&n);getchar();
for(i=0;i<n;i++)
{
gets(a);
if(strlen(a)>10)
printf("%c%d%c\n",a[0],strlen(a)-2,a[strlen(a)-1]);
else puts(a);
}
return 0;
} | |
Sometimes some words like "localization" or "internationalization" are so long that writing them many times in one text is quite tiresome.Let's consider a word too long, if its length is strictly more than 10 characters. All too long words should be replaced with a special abbreviation.This abbreviation is made like th... | Print n lines. The i-th line should contain the result of replacing of the i-th word from the input data. | C | 6639d6c53951f8c1a8324fb24ef68f7a | eaec87970a386e95e358dcfcea6718cd | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"strings"
] | 1301410800 | ["4\nword\nlocalization\ninternationalization\npneumonoultramicroscopicsilicovolcanoconiosis"] | null | PASSED | 800 | standard input | 1 second | The first line contains an integer n (1 ≤ n ≤ 100). Each of the following n lines contains one word. All the words consist of lowercase Latin letters and possess the lengths of from 1 to 100 characters. | ["word\nl10n\ni18n\np43s"] | #include<stdio.h>
#include<string.h>
int main()
{
int i,n,len;
char a[1000];
scanf("%d",&n);getchar();
for(i=0;i<n;i++)
{
gets(a);
if(strlen(a)>10)
printf("%c%d%c\n",a[0],strlen(a)-2,a[strlen(a)-1]);
else puts(a);
}
return 0;
} | |
Sometimes some words like "localization" or "internationalization" are so long that writing them many times in one text is quite tiresome.Let's consider a word too long, if its length is strictly more than 10 characters. All too long words should be replaced with a special abbreviation.This abbreviation is made like th... | Print n lines. The i-th line should contain the result of replacing of the i-th word from the input data. | C | 6639d6c53951f8c1a8324fb24ef68f7a | e27811de40c29f35f0cf74448a729f05 | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"strings"
] | 1301410800 | ["4\nword\nlocalization\ninternationalization\npneumonoultramicroscopicsilicovolcanoconiosis"] | null | PASSED | 800 | standard input | 1 second | The first line contains an integer n (1 ≤ n ≤ 100). Each of the following n lines contains one word. All the words consist of lowercase Latin letters and possess the lengths of from 1 to 100 characters. | ["word\nl10n\ni18n\np43s"] | #include<stdio.h>
#include<string.h>
int main()
{
int i,n,l;
char a[100];
scanf("%d",&n);
getchar();
for(i=0;i<n;i++)
{
gets(a);
if(strlen(a)>10)
printf("%c%d%c\n",a[0],strlen(a)-2,a[strlen(a)-1]);
else puts(a);
}
return 0;
} | |
Sometimes some words like "localization" or "internationalization" are so long that writing them many times in one text is quite tiresome.Let's consider a word too long, if its length is strictly more than 10 characters. All too long words should be replaced with a special abbreviation.This abbreviation is made like th... | Print n lines. The i-th line should contain the result of replacing of the i-th word from the input data. | C | 6639d6c53951f8c1a8324fb24ef68f7a | ec0ef31ae294f1e32dcfcf3c11ce1bc8 | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"strings"
] | 1301410800 | ["4\nword\nlocalization\ninternationalization\npneumonoultramicroscopicsilicovolcanoconiosis"] | null | PASSED | 800 | standard input | 1 second | The first line contains an integer n (1 ≤ n ≤ 100). Each of the following n lines contains one word. All the words consist of lowercase Latin letters and possess the lengths of from 1 to 100 characters. | ["word\nl10n\ni18n\np43s"] | #include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{
int x,y;
char z[100];
scanf("%d",&x);
for(int i=0;i<x;i++)
{
scanf("%s",&z);
if(strlen(z)<=10)
printf("%s",z);
else
printf("%c%d%c",z[0],strlen(z)-2,z[strlen(z)-1]);
printf("\n");
}
}
| |
Sometimes some words like "localization" or "internationalization" are so long that writing them many times in one text is quite tiresome.Let's consider a word too long, if its length is strictly more than 10 characters. All too long words should be replaced with a special abbreviation.This abbreviation is made like th... | Print n lines. The i-th line should contain the result of replacing of the i-th word from the input data. | C | 6639d6c53951f8c1a8324fb24ef68f7a | fdfa7b2dcce431c7de391101b2d7a16f | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"strings"
] | 1301410800 | ["4\nword\nlocalization\ninternationalization\npneumonoultramicroscopicsilicovolcanoconiosis"] | null | PASSED | 800 | standard input | 1 second | The first line contains an integer n (1 ≤ n ≤ 100). Each of the following n lines contains one word. All the words consist of lowercase Latin letters and possess the lengths of from 1 to 100 characters. | ["word\nl10n\ni18n\np43s"] | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int n,i=0,j;
char str[101];
scanf("%d",&n);
if(n<1||n>100)
exit(1);
do
{
scanf("%s",str);
char tmp = getchar();
for(j=0;j<strlen(str);j++)
{
if(str[j]<... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | df86270831c3dbe852ea6dc464b3ba40 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(){
int n,m,l,r;
char c1[2],c2[2];
scanf("%d%d",&n,&m);
char *str=malloc((n+1)*sizeof(char));
scanf("%s",str);
while(m--){
scanf("%d%d%s%s",&l,&r,c1,c2);
l--;r--;
// printf("%c\t%c\n",c1,c2);
for(int ... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 0a5854b1ca27f0b21cc7d4381dea4cf7 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include <stdio.h>
void change(char* str, int l, int r, char e, char s) {
for (int i=l-1; i<r; i++) {
if (str[i]==e) str[i]=s;
}
}
int main() {
int len,op;
scanf("%d %d",&len,&op);
char word[len];
scanf("%s",word);
for (int i=0; i<op; i++) {
int l,r,e,s;
scanf("%d %d ... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 205e679d488a2b3b2035d89bcf1b0ced | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
int main()
{
char ch[1000],c1,c2;
int i,j,l,r,n,m;
scanf("%d %d",&n,&m);
getchar();
gets(ch);
for(i=0; i<m; i++)
{
scanf("%d %d %c %c",&l,&r,&c1,&c2);
for(j=l-1; j<r; j++)
{
if(ch[j]==c1)
{
ch[j]=c2;
... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 44d86e61d70ae128af7ed0d5b531cd05 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include <stdio.h>
int main()
{
int n,m;
scanf("%d%d",&n,&m);
char s[n];
scanf("%s",s);
int a[m][2];
char c1[m],c2[m];
for(int i=0;i<m;i++)
{
scanf("%d%d %c %c",&a[i][0],&a[i][1],&c1[i],&c2[i]);
for(int j=a[i][0]-1;j<=a[i][1]-1;j++)
{
if(s[j]==c1[i])
s[j]=c2[i];
}
}
printf("%s",s);
}
| |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | fb17a33b2a7875b04312aa3f40d2f451 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
#include<string.h>
int main()
{
int n,m,l,r,i;
char c1,c2;
scanf("%d%d",&n,&m);
char S[n];
scanf("%s",S);
while(m--)
{
scanf("%d %d %c %c",&l,&r,&c1,&c2);
for(i=l-1;i<=r-1;i++)
{
if(S[i]==c1)
S[i]=c2;
}
... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 5fa9dcbb0b4b2588e59063440fbcf6ab | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
int main()
{
int n,m,i,j,p,q;
char c1,c2;
scanf("%d %d",&n,&m);
char a[n];
scanf("%s",a);
for(j=1; j<=m; j++)
{
scanf("%d %d %c %c",&p,&q,&c1,&c2);
for( i=p-1; i<q; i++)
{
if(a[i]==c1)
a[i]=c2;
}
}
prin... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 4f02f981437ab623b18bb18bed6d1e71 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
int main()
{
int n,m,l,r,i,j;
scanf("%d%d",&n,&m);
char s[n+1],c1[2],c2[2];
scanf("%s",s);
while(m--){
scanf("%d%d%s%s",&l,&r,&c1,&c2);
for(i=l-1;i<r;i++)
{
if(s[i]==c1[0])
s[i]=c2[0];
}
}
printf("%s\n",s);
}
| |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 21b660262fcad9cd2afd259bb7a0218a | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
int main()
{
int n,m;
scanf("%d %d",&n,&m);
char ch[n];
scanf("%s",ch);
for(int i=0;i<m;i++)
{
int a,b;
char x,y;
scanf("%d %d %c %c",&a,&b,&x,&y);
for(int j=a-1;j<b;j++)
{
if(ch[j]==x)
ch[j]=y;
}
}... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 7bcdb60812089f3c9ed79d6a3e7af9d2 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include <stdio.h>
int main()
{
int n, q;
scanf("%d%d", &n, &q);
char d[n+3];
scanf("%s", d);
while(q--)
{
int left, right;
char s1[3], s2[3];
scanf("%d%d%s%s", &left, &right, s1, s2);
for(int i = left-1; i <= right-1; i++)
{
if(d[i] == s1[0])
... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 576cbf5588d7bcf8c98c7c4c33a982d3 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
int main()
{
int n,m,l,r,i,j,a,b;
scanf("%d %d",&n,&m);
getchar();
char c[200],e,d;
for(i=0;i<n;i++)
scanf("%c",&c[i]);
for(i=0;i<m;i++){
scanf("%d %d %c %c",&a,&b,&e,&d);
for(j=a-1;j<b;j++){
if(c[j]==e)
c[j]=d;
}
... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 3fedfc0220d3ee86f16ebfa21abee31a | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int n, m, l, r, i, j;
scanf("%d %d", &n, &m);
getchar();
char str[n], c1, c2;
scanf(" %s", str);
while(m--)
{
scanf("%d %d %c %c", &l, &r, &c1, &c2);
getchar();
for(j = l-1; j < r; j++)
{
if(str[j] == c1)
{
... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 296dd6a324ec09fc961e72ede695ba5f | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
int main()
{
int n, m, l, r, i, j;
scanf("%d %d", &n, &m);
getchar();
char str[n], c1, c2;
scanf("%s", &str);
for(i = 0; i < m; i++)
{
scanf("%d %d %c %c", &l, &r, &c1, &c2);
for(j = l - 1; j < r; j+... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 3819f367f6d8ac6b6b36cdf0fe92d74f | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
#include<stdlib.h>
char str[10000];
int main(){
int n,i,j,k,l,m,r;
char c1,c2;
scanf("%d%d",&n,&m);
scanf("%s",str);
for(i=0;i<m;i++){
scanf("%d %d %c %c",&l,&r,&c1,&c2);
// printf("%d %d %c %c\n",l,r,c1,c2);
for(j=l-1;j<=r-1;j++){
if(str[j]==c1)
str[j]=c2;
}
}
printf("%s\n",str);
return 0;
}
| |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 0e3246c7ba8443e06cdb36a8f601c152 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
int main()
{
int n,m,i,j,l,r;
char s[101],c1,c2;
scanf("%d %d\n",&n,&m);
for(i=1;i<=n;i++)
{
scanf("%c",&s[i]);
}
for(i=1;i<=m;i++)
{
scanf("\n%d %d %c %c",&l,&r,&c1,&c2);
for(j=l;j<=r;j++)
{
if(s[j]==c1)
{
s[j]=c2;
}
}
}
for(i=1;i<=n;i++)
{
printf("%c",s[i]);
}
r... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | d4abe848685c72c4afc542b6e6e7fe52 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include <stdio.h>
int main()
{
int n , m ;
char ara[101] ;
scanf("%d %d %s",&n,&m,ara) ; // char ch = getchar() ;
// scanf("%s",ara) ;
int f , r ;
char c1 , c2 ;
for( int a = 0 ; a < m ; a++ ) {
scanf("%d %d %c %c",&f,&r,&c1... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | aa3ab56708261656d5dd3b592e199965 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include <stdio.h>
int main()
{
int n , m ;
scanf("%d %d",&n,&m) ; // char ch = getchar() ;
char ara[n] ;
scanf("%s",ara) ;
int f , r ;
char c1 , c2 ;
for( int a = 0 ; a < m ; a++ ) {
scanf("%d %d %c %c",&f,&r,&c1,&c2) ;
... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 0730102939475cdd527a6d940ff85b04 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
int main()
{
int n,i,m,j,l,r,count;
char c1,c2;
scanf("%d %d",&n,&m);
char s[n+1];
scanf("%s",&s);
for(i=1;i<=m;i=i+1)
{
scanf("%d %d %c %c",&l,&r,&c1,&c2);
j=l-1;
while(j<=r-1)
{
if(s[j]==c1)
{
s[j]=c2;
}
... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | ddc5937ebb217bc1a64af7590c7db031 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
int main()
{
int n,m;
int i,j,a,b;
char c,d;
scanf("%d %d",&n,&m);
char x[n];
scanf("%s",&x);
for(i=0;i<m;i++)
{
scanf("%d %d %c %c",&a,&b,&c,&d);
for(j=0;j<n;j++)
{
if((a<=(j+1))&&((j+1)<=b))
{
if(x[j]==c)... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 8602913a492a8636bb2a2851b4f015ff | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
#include<string.h>
int main()
{
int n,m,l,r;
char c1,c2,s[101];
scanf("%d %d %s",&n,&m,s);
for(int i=1;i<=m;i++)
{
scanf("%d %d %c %c",&l,&r,&c1,&c2);
for(int j=l-1;j<=r-1;j++)
{
if(s[j]==c1)
s[j]=c2;
}
}
prin... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 91ef9262d1449cbe863581ec041dfce0 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include <stdio.h>
int main()
{
int n, m, i, l, r;
scanf("%d%d", &n, &m);
char s[1001], c[2], d[2];
scanf("%s", s);
while (m--)
{
scanf("%d%d%s%s", &l, &r, c, d);
for (i = l-1 ; i < r; i++)
if (s[i] == c[0])
s[i] = d[0];
}
printf("%s\n", s);
} | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 74e95642fa43400301ba7a28fe42d8a3 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include <stdio.h>
int main()
{
int n,m;
scanf("%d%d",&n,&m);
char ar[n];
scanf("%s",ar);
char a,b;
int x,y;
for(int p=0;p<m;p++)
{
scanf("%d%d",&x,&y);
getchar();
scanf("%c",&a);
getchar();
scanf("%c",&b);
for(int i=x-1;i<y;i++)
... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 2aac138a8cc183b425affa966c394e7d | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h> //AA06( 15/ 04/ 20) If u see my code, Have a Good Day! (^_^)
int main()
{
int n, m, i, j, l, r;
char S[1000], C1, C2;
scanf("%d%d%s", &n, &m, S);
for(i = 0; i < m; i++) {
scanf("%d %d %c %c", &l, &r, & C1, &C2);
for(j = l; j <= r; j++) {
if(S[j - 1] == ... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 01529e07b7d1a1bb129a4b8e411dfadb | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
#include<string.h>
int main()
{
char s[101];
char ch1,ch2;
int i,j,l,r,m,n;
scanf("%d",&n);
scanf("%d",&m);
scanf(" %s", s);
for(i=1;i<=m;i++){
scanf("%d",&l);
scanf("%d",&r);
scanf(" %c", &ch1);
scanf(" %c", &ch2);
for(j=l-1;j<=r-1;j++){... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 7a9bf5a0e5457f22858bbee055ade94d | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
#include<string.h>
int main()
{
char s[101];
char ch1,ch2;
int i,j,l,r,m,n;
scanf("%d",&n);
scanf("%d",&m);
scanf("%s", s);
for(i=1;i<=m;i++){
scanf("%d",&l);
scanf("%d",&r);
scanf(" %c", &ch1);
scanf(" %c", &ch2);
for(j=l-1;j<=r-1;j++){
... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 6623bd61911ded0fdf082abd91676df9 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
int main()
{
int n,m;
scanf("%d %d",&n,&m);
char ch[n];
scanf("%s",&ch);
for(int i=0; i<m; i++)
{
int l,r;
char c1,c2;
scanf("%d %d %c %c",&l,&r,&c1,&c2);
for(int j = l-1; j < r; j++)
{
if(ch[j] == c1)
{
... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 098c20d5aa02541e8233b45815091bae | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
int main()
{
int n,m;
scanf("%d%d ",&n,&m);
char a[1000];
gets(a);
int j,i;
int l,r;
char c1,c2;
for(j=0;j<m;j++)
{
scanf("%d %d %c %c",&l,&r,&c1,&c2);
for(i=l-1;i<r;i++)
{
if(a[i]==c1)
{
a[i]=c2;
... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | af48e59a2388809d3fc816d8aca990e1 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
int main()
{
int num1,num2,i,j,c,d,e,sum=0;
scanf("%d %d ",&num1,&num2);
char a[num1],ch1,ch2;
gets(a);
for(i=0;i<num2;i++)
{
scanf("%d %d %c %c",&c,&d,&ch1,&ch2);
for(j=c-1;j<=d-1;j++){
if(a[j]==ch1){a[j]=ch2;}
}
}
puts(a);
}
| |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 8c7631761e48f9219f749f4585555a28 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include <stdio.h>
int main(void) {
int n,m,j,k,h,i;
char s[100],b,p;
scanf("%d %d",&n,&m);
scanf("%s",s);
for(j=0; j<m; j++)
{
scanf("%d %d %c %c",&k,&h,&b,&p);
for(i=k-1; i<=h-1; i++)
{
if(s[i]==b)
{
s[i] = p;
}
}
}
printf("%s",s);
return ... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 6b62c11c23f89472ec58c9ba14be7d59 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
#include<string.h>
int main ()
{
int n,m,x,y,i;
scanf("%d %d\n", &n,&m);
char a[n+1],z,z1;
gets(a);
for(i=0;i<m;i++)
{
scanf("%d %d %c %c",&x,&y,&z,&z1);
for(int j=x-1;j<y;j++)
{
if(a[j]==z)
a[j]=z1;
}
}
puts(... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 7b305a2c19ab68d6eb0f68cc6021bcde | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include <stdio.h>
int main (void)
{
char s[200];
int len,t;
while(~scanf("%d%d",&len,&t))
{
getchar();
for(int i=1;i<=len;i++)
scanf("%c",&s[i]);
getchar();
while(t--)
{
int l,r;
char a,b;
scanf("%d %d %c %c",&l,&r,... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | a04182475e7f7e6f888b2921a2720b45 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include <stdio.h>
int main()
{
char s1[100],c1,c2;
int n,m,l,r,i,j;
scanf("%d%d",&n,&m);
scanf("%s",s1);
for(i=0;i<m;i++)
{
scanf("%d %d %c %c",&l,&r,&c1,&c2);
l=l-1;
r=r-1;
for(j=l;j<=r;j++)
{
if(s1[j]==c1)
{
s1[j... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | f91e81e46cb6aa4d71d263224c2c4d55 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include <stdio.h>
int main ()
{
int i,j,t,a,b,x;
char s[100];
char ch1,ch2;
scanf ("%d %d",&j,&t);
scanf ("%s",s);
for (i=0;i<t;i++)
{
scanf ("%d %d",&a,&b);
x=a-1;
ch1=getchar();
ch1=getchar();
ch2=getchar();
ch2=getchar();
for (;x<b;... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | a44617359b24f0628f35c98ac0e8268c | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
int main()
{
int n,m,i,j,l,r;
char s[100],c,d;
scanf("%d%d",&n,&m);
scanf("%s",&s);
for(i=1;i<=m;i++)
{
scanf("%d%d",&l,&r);
scanf(" %c %c",&c,&d);
for(j=(l-1);j<r;j++)
{
if(s[j]==c)
{
s[j]=d;
}... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 01eb9b074e505fea7bcb8932aa5c8ae5 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include <stdio.h>
int main()
{
int n,m,i,j,l,r;
char c1,c2;
char s[100];
scanf("%d %d",&n,&m);
scanf("%s",s);
for(i=0;i<m;i++)
{
scanf("%d %d %c %c",&l,&r,&c1,&c2);
for(j=l-1;j<=r-1;j++)
{
if(s[j] == c1) s[j]=c2;
}
}
printf("%s",s);
re... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | d687a69294311b00ecf3ead6b6fc9dbb | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | int main()
{
int n,m;
scanf("%d %d",&n,&m);
char s[200];
scanf("%s",s);
for(int i=0;i<m;i++)
{
int l,r;
char c1,c2;
scanf("%d %d %c %c",&l,&r,&c1,&c2);
for(int i=l-1;i<=r-1;i++)
{
if(s[i]==c1)
s[i]=c2;
}
}
printf... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 606e8f62570d5b55ce70f666ecd3b965 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
int main()
{
int n, m,l,r;
scanf("%d%d",&n,&m);
char ch[n+1],a,b;
scanf("%s",ch);
for(int i=0;i<m;i++)
{
scanf("%d%d %c %c",&l,&r,&a,&b);
for(int j=l-1;j<r;j++)
{
if(ch[j]==a)
ch[j]=b;
}
}
//printf("%c %c",a,b);
printf("%s",ch);
return 0... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 8ef0a4ef2ea451ad36219d9f31b9add3 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
int main()
{
int n,m,i;
scanf("%d %d",&n,&m);
char c[101];
scanf("%s",&c);
for(i=1;i<=m;i++)
{
int l,r,j;
char c1,c2;
scanf("%d %d %c %c",&l,&r,&c1,&c2);
for(j=l-1;j<=r-1;j++)
{
if(c[j] == c1)
c[j] = c2;
}
}
printf("%s",c);
return 0;
}
| |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | aee7abe789475f8704702559854754ab | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include <stdio.h>
//CODED BY SAYEM MD. NAFI
int main()
{
int LENGTH, OPERATION, L, R, I;
char STRING[102], C1, C2;
scanf("%d %d %s", &LENGTH, &OPERATION, STRING);
while (OPERATION--) {
scanf("%d %d %c %c", &L, &R, &C1, &C2);
for(I = L; I <= R; I++) {
... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 20d5f41e8e14d34b583c468ef8bcbee4 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
int main(void)
{
int n,m,a,b;
scanf("%d%d",&n,&m);
char word[n];
getchar();
gets(word);
char c1,c2;
for(int i = 0; i < m; i++)
{
scanf("%d%d",&a,&b);
getchar();
scanf("%c %c",&c1,&c2);
for(int x = a-1; x < b; x++)
{
if... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 5446f8cdfc8058059e67c204ca163ba6 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
int main()
{
int n,m,i,j,x,y;
scanf("%d%d",&n,&m);
char ch[100],c1,c2;
scanf("%s",ch);
for(i=0;i<m;i++)
{
scanf("%d%d",&x,&y);
scanf(" %c",&c1);
scanf(" %c",&c2);
for(j=x-1;j<y;j++)
if(ch[j]==c1)
ch[j]=c2;
}
printf("%s",ch);
return ... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 81e008b89bb787580c1da4095a63e219 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include <stdio.h>
int main()
{
int n, m;
scanf("%d %d \n", &n, &m);
char c1, c2;
char s[n+1];
int i, l, r, j;
for( i = 0; i < n; i++)
{
scanf("%c", &s[i]);
}
for(j = 0 ; j < m; j++)
{
scanf("\n%d %d %c %c", &l, &r, &c1, &c2);
for( i = l-1 ;... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 6ba2e7844540cc1ae33d3a725c4907ca | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
#include<string.h>
int main()
{
int n,m,i,k,j,s,l,r;
scanf("%d %d",&n,&m);
char S[n+1];
scanf("%s",S);
for(s=0;s<m;s++)
{
char c1,c2;
scanf("%d %d %c %c",&l,&r,&c1,&c2);
for(i=l-1;i<r;i++)
{
if(S[i]==c1)
{
... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | db7fe424ed1a7b79715fe84e021b0c4e | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include <stdio.h>
int main(void)
{
int n,m,i,j,k,l,r;
char ch1,ch2;
scanf("%d %d",&n,&m);
char array[n+1];
scanf("%s",array);
for(i=0;i<m;i++)
{
scanf("%d %d %c %c",&l,&r,&ch1,&ch2);
for(j=l;j<=r;j++)
{
if(array[j-1]==ch1)
array[j-1]=ch2;
}
}
printf("%s",array);
return 0;
}
| |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 144609f6ebc9649e0d2ade8a7477c639 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include <stdio.h>
int main(){
int n, t, l, r;
char s[100], c1, c2;
fscanf(stdin,"%d%d%s",&n,&t,s);
for(int i=0;i<t;i++){
fscanf(stdin,"%d%d %c %c",&l,&r,&c1,&c2);
for(int j=l-1;j<r;j++){
if(s[j]==c1){
s[j]=c2;
}
}
}
fprintf(stdout,"%s",s);
return 0;
} | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 586484e925149db21abddbf20efdfe08 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[])
{
int num,j,i,oper,l,r;
char ch,arr[102],c1,c2;
scanf("%d %d",&num,&oper);
for(i=1;i<=num;i++)
{
scanf(" %c",&ch);
arr[i]=ch;
}
for(i=1;i<=oper;i++)
{
scanf("%d %d %c %c",&l,&r,&c1,&c2);
for(j=l;j<=r;j++)
... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 513860485f8e2564e6b28138c802f2c9 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
int main()
{
int n,m;
scanf("%d%d",&n,&m);
char s[n+1];
scanf("%s",s);
int l,r,j;
char c1,c2;
for(int i=1;i<=m;i++)
{
scanf("%d %d %c %c",&l,&r,&c1,&c2);
//scanf("%c%c",&c1,&c2);
for(j=l-1;j<r;j++)
{
... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | 1169b8adb552facf5424c8873ae78f77 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include<stdio.h>
int main(void)
{
int i,j,a,b,n,m;
scanf("%d %d",&n,&m);
char string[n+1],operation[8];
scanf("%s",string);
for(i=0;i<m;i++)
{
scanf("%d %d",&a,&b);
scanf(" %[^\n]",operation);
for(j=a-1;j<b;j++)
{
if(operation[0]==string[j])
... | |
Are you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true love of mine.Willem is taking the girl to the highest building in island No.28, however, neither of them knows how to get there.Willem asks his friend, Grick for directions, Grick helped them, and... | Output string s after performing m operations described above. | C | 3f97dc063286a7af4838b7cd1c01df69 | e609a01d7aa615e3cd1d9cf16cc2c251 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation"
] | 1512223500 | ["3 1\nioi\n1 1 i n", "5 3\nwxhak\n3 3 h x\n1 5 x a\n1 3 w g"] | NoteFor the second example:After the first operation, the string is wxxak.After the second operation, the string is waaak.After the third operation, the string is gaaak. | PASSED | 800 | standard input | 2 seconds | The first line contains two integers n and m (1 ≤ n, m ≤ 100). The second line contains a string s of length n, consisting of lowercase English letters. Each of the next m lines contains four parameters l, r, c1, c2 (1 ≤ l ≤ r ≤ n, c1, c2 are lowercase English letters), separated by space. | ["noi", "gaaak"] | #include <stdio.h>
#include <string.h>
int length,r1,r2,parameters;
char s[100000],wanted,target;
void change (int rr1,int rr2,char w,char t)
{
for (int i=rr1-1;i<rr2;i++)
{
if (s[i]==w) s[i] = t;
}
}
int main ()
{
//freopen ("cf.in","r",stdin),freopen("cf.out","w",stdout);
scanf ("%d %d %s",&length,¶mete... | |
Find the number of k-divisible numbers on the segment [a, b]. In other words you need to find the number of such integer values x that a ≤ x ≤ b and x is divisible by k. | Print the required number. | C | 98de093d78f74273e0ac5c7886fb7a41 | 6a07264f0d75049ca81209c9f9df7bbc | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"math"
] | 1447264800 | ["1 1 10", "2 -4 4"] | null | PASSED | 1,600 | standard input | 1 second | The only line contains three space-separated integers k, a and b (1 ≤ k ≤ 1018; - 1018 ≤ a ≤ b ≤ 1018). | ["10", "5"] | #include<stdio.h>
typedef long long ll;
ll S(ll x){return x<0?-x:x;}
int main()
{
ll k,a,b,c;
scanf("%I64d%I64d%I64d",&k,&a,&b);
c=a/k*k;while(c<a)c+=k;a=c;
c=b/k*k;while(c>b)c-=k;b=c;
printf("%I64d\n",b/k-a/k+1);
return 0;
}
| |
Find the number of k-divisible numbers on the segment [a, b]. In other words you need to find the number of such integer values x that a ≤ x ≤ b and x is divisible by k. | Print the required number. | C | 98de093d78f74273e0ac5c7886fb7a41 | 55ccb8ede7659d3c0cb3f39435cb6164 | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"math"
] | 1447264800 | ["1 1 10", "2 -4 4"] | null | PASSED | 1,600 | standard input | 1 second | The only line contains three space-separated integers k, a and b (1 ≤ k ≤ 1018; - 1018 ≤ a ≤ b ≤ 1018). | ["10", "5"] | #include <stdio.h>
int main(void) {
long long k, a, b;
long long t;
scanf("%lld %lld %lld", &k, &a, &b);
t = ((long long)1e18 + k - 1) / k * k;
a += t;
b += t;
printf("%lld\n", b / k - (a + k - 1) / k + 1);
return 0;
}
| |
Find the number of k-divisible numbers on the segment [a, b]. In other words you need to find the number of such integer values x that a ≤ x ≤ b and x is divisible by k. | Print the required number. | C | 98de093d78f74273e0ac5c7886fb7a41 | 04f9cdb77210c89d244738c9425a3ad0 | GNU C | standard output | 256 megabytes | train_001.jsonl | [
"math"
] | 1447264800 | ["1 1 10", "2 -4 4"] | null | PASSED | 1,600 | standard input | 1 second | The only line contains three space-separated integers k, a and b (1 ≤ k ≤ 1018; - 1018 ≤ a ≤ b ≤ 1018). | ["10", "5"] | #include <stdio.h>
#include <stdlib.h>
typedef long long ll;
int main() {
ll a, b, k, ans, temp;
scanf("%I64d %I64d %I64d", &k, &a, &b);
if (b < 0)
{
b*=-1;
a*=-1;
temp = b;
b = a;
a = temp;
}
if(b >= 0)
{
if(a <= 0){
a*=-1;
... | |
You have a given picture with size $$$w \times h$$$. Determine if the given picture has a single "+" shape or not. A "+" shape is described below: A "+" shape has one center nonempty cell. There should be some (at least one) consecutive non-empty cells in each direction (left, right, up, down) from the center. In oth... | If the given picture satisfies all conditions, print "YES". Otherwise, print "NO". You can output each letter in any case (upper or lower). | C | 6405161be280fea943201fa00ef6f448 | bc47ba750134528b6c4e14d01e0ab804 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation",
"dfs and similar",
"strings"
] | 1560258300 | ["5 6\n......\n..*...\n.****.\n..*...\n..*...", "3 5\n..*..\n****.\n.*...", "7 7\n.......\n...*...\n..****.\n...*...\n...*...\n.......\n.*.....", "5 6\n..**..\n..**..\n******\n..**..\n..**..", "3 7\n.*...*.\n***.***\n.*...*.", "5 10\n..........\n..*.......\n.*.******.\n..*.......\n.........."] | NoteIn the first example, the given picture contains one "+".In the second example, two vertical branches are located in a different column.In the third example, there is a dot outside of the shape.In the fourth example, the width of the two vertical branches is $$$2$$$.In the fifth example, there are two shapes.In the... | PASSED | 1,300 | standard input | 1 second | The first line contains two integers $$$h$$$ and $$$w$$$ ($$$1 \le h$$$, $$$w \le 500$$$) — the height and width of the picture. The $$$i$$$-th of the next $$$h$$$ lines contains string $$$s_{i}$$$ of length $$$w$$$ consisting "." and "*" where "." denotes the empty space and "*" denotes the non-empty space. | ["YES", "NO", "NO", "NO", "NO", "NO"] | #include<stdio.h>
#include<string.h>
int main()
{
int h,w,i,j,f=0,p=0,t=0,m,n;
scanf("%d %d",&h,&w);
char s[h][w];
for(i=0;i<h;i++){
scanf("%s",s[i]);
}
for(i=0;i<h;i++)
{
for(j=0;j<w;j++)
{
if(s[i][j]=='*'){p++;}
if(i>=1&&j>=1&&i<h-1&&j<w-1&&s[i][j]... | |
You have a given picture with size $$$w \times h$$$. Determine if the given picture has a single "+" shape or not. A "+" shape is described below: A "+" shape has one center nonempty cell. There should be some (at least one) consecutive non-empty cells in each direction (left, right, up, down) from the center. In oth... | If the given picture satisfies all conditions, print "YES". Otherwise, print "NO". You can output each letter in any case (upper or lower). | C | 6405161be280fea943201fa00ef6f448 | b15332ba3bac7d54c45c29dc3d6b11ee | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation",
"dfs and similar",
"strings"
] | 1560258300 | ["5 6\n......\n..*...\n.****.\n..*...\n..*...", "3 5\n..*..\n****.\n.*...", "7 7\n.......\n...*...\n..****.\n...*...\n...*...\n.......\n.*.....", "5 6\n..**..\n..**..\n******\n..**..\n..**..", "3 7\n.*...*.\n***.***\n.*...*.", "5 10\n..........\n..*.......\n.*.******.\n..*.......\n.........."] | NoteIn the first example, the given picture contains one "+".In the second example, two vertical branches are located in a different column.In the third example, there is a dot outside of the shape.In the fourth example, the width of the two vertical branches is $$$2$$$.In the fifth example, there are two shapes.In the... | PASSED | 1,300 | standard input | 1 second | The first line contains two integers $$$h$$$ and $$$w$$$ ($$$1 \le h$$$, $$$w \le 500$$$) — the height and width of the picture. The $$$i$$$-th of the next $$$h$$$ lines contains string $$$s_{i}$$$ of length $$$w$$$ consisting "." and "*" where "." denotes the empty space and "*" denotes the non-empty space. | ["YES", "NO", "NO", "NO", "NO", "NO"] | #include <stdio.h>
int main(){
char a[1000][1000];
int n,m,i,j,k,cnt=0,t;
scanf("%d%d",&n,&m);
for(i=1;i<=n;++i){
scanf("%s",a[i]+1);
for(j=1;j<=m;++j)if(a[i][j]=='*')++cnt;
}
for(i=2;i<n;++i)
for(j=2;j<m;++j)if(a[i][j]=='*'&&a[i-1][j]=='*'&&a[i+1][j]=='*'&&a[i][j-1]=='*'&&a[i][j+1]=='*'){
for(t=1,k=... | |
You have a given picture with size $$$w \times h$$$. Determine if the given picture has a single "+" shape or not. A "+" shape is described below: A "+" shape has one center nonempty cell. There should be some (at least one) consecutive non-empty cells in each direction (left, right, up, down) from the center. In oth... | If the given picture satisfies all conditions, print "YES". Otherwise, print "NO". You can output each letter in any case (upper or lower). | C | 6405161be280fea943201fa00ef6f448 | a0cca42fb966e7fe4cb4c60decec2fdb | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation",
"dfs and similar",
"strings"
] | 1560258300 | ["5 6\n......\n..*...\n.****.\n..*...\n..*...", "3 5\n..*..\n****.\n.*...", "7 7\n.......\n...*...\n..****.\n...*...\n...*...\n.......\n.*.....", "5 6\n..**..\n..**..\n******\n..**..\n..**..", "3 7\n.*...*.\n***.***\n.*...*.", "5 10\n..........\n..*.......\n.*.******.\n..*.......\n.........."] | NoteIn the first example, the given picture contains one "+".In the second example, two vertical branches are located in a different column.In the third example, there is a dot outside of the shape.In the fourth example, the width of the two vertical branches is $$$2$$$.In the fifth example, there are two shapes.In the... | PASSED | 1,300 | standard input | 1 second | The first line contains two integers $$$h$$$ and $$$w$$$ ($$$1 \le h$$$, $$$w \le 500$$$) — the height and width of the picture. The $$$i$$$-th of the next $$$h$$$ lines contains string $$$s_{i}$$$ of length $$$w$$$ consisting "." and "*" where "." denotes the empty space and "*" denotes the non-empty space. | ["YES", "NO", "NO", "NO", "NO", "NO"] | #include<stdio.h>
int main()
{
int h,w,f=0,r,c;
scanf("%d %d",&h,&w);
char a[h][w];
int star[h][w];
for(int i=0;i<h;i++)
{
scanf(" %[^\n]",a[i]);
}
for(int g=0;g<h;g++)
{
for(int k=0;k<w;k++)
{
star[g][k]=0;
... | |
You have a given picture with size $$$w \times h$$$. Determine if the given picture has a single "+" shape or not. A "+" shape is described below: A "+" shape has one center nonempty cell. There should be some (at least one) consecutive non-empty cells in each direction (left, right, up, down) from the center. In oth... | If the given picture satisfies all conditions, print "YES". Otherwise, print "NO". You can output each letter in any case (upper or lower). | C | 6405161be280fea943201fa00ef6f448 | 52299c68863a4ffe3415c6899ccaa8e3 | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation",
"dfs and similar",
"strings"
] | 1560258300 | ["5 6\n......\n..*...\n.****.\n..*...\n..*...", "3 5\n..*..\n****.\n.*...", "7 7\n.......\n...*...\n..****.\n...*...\n...*...\n.......\n.*.....", "5 6\n..**..\n..**..\n******\n..**..\n..**..", "3 7\n.*...*.\n***.***\n.*...*.", "5 10\n..........\n..*.......\n.*.******.\n..*.......\n.........."] | NoteIn the first example, the given picture contains one "+".In the second example, two vertical branches are located in a different column.In the third example, there is a dot outside of the shape.In the fourth example, the width of the two vertical branches is $$$2$$$.In the fifth example, there are two shapes.In the... | PASSED | 1,300 | standard input | 1 second | The first line contains two integers $$$h$$$ and $$$w$$$ ($$$1 \le h$$$, $$$w \le 500$$$) — the height and width of the picture. The $$$i$$$-th of the next $$$h$$$ lines contains string $$$s_{i}$$$ of length $$$w$$$ consisting "." and "*" where "." denotes the empty space and "*" denotes the non-empty space. | ["YES", "NO", "NO", "NO", "NO", "NO"] | #include <stdio.h>
int main(void) {
int h,w;
scanf(" %d %d",&h,&w);
char a[510][510];
for(int i=0;i<h;i++)
{
for(int j=0;j<w;j++)
{
scanf(" %c",&a[i][j]);
}
}
int count=0;
int x,y;
for(int i=0;i<h;i++)
{
for(int j=0;j<w;j++)
{
if(a[i][j]=='*'&&a[i-1][j]=='*'&&a[i]... | |
You have a given picture with size $$$w \times h$$$. Determine if the given picture has a single "+" shape or not. A "+" shape is described below: A "+" shape has one center nonempty cell. There should be some (at least one) consecutive non-empty cells in each direction (left, right, up, down) from the center. In oth... | If the given picture satisfies all conditions, print "YES". Otherwise, print "NO". You can output each letter in any case (upper or lower). | C | 6405161be280fea943201fa00ef6f448 | a0cfd490bc8645a4353aa9015b91a91e | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation",
"dfs and similar",
"strings"
] | 1560258300 | ["5 6\n......\n..*...\n.****.\n..*...\n..*...", "3 5\n..*..\n****.\n.*...", "7 7\n.......\n...*...\n..****.\n...*...\n...*...\n.......\n.*.....", "5 6\n..**..\n..**..\n******\n..**..\n..**..", "3 7\n.*...*.\n***.***\n.*...*.", "5 10\n..........\n..*.......\n.*.******.\n..*.......\n.........."] | NoteIn the first example, the given picture contains one "+".In the second example, two vertical branches are located in a different column.In the third example, there is a dot outside of the shape.In the fourth example, the width of the two vertical branches is $$$2$$$.In the fifth example, there are two shapes.In the... | PASSED | 1,300 | standard input | 1 second | The first line contains two integers $$$h$$$ and $$$w$$$ ($$$1 \le h$$$, $$$w \le 500$$$) — the height and width of the picture. The $$$i$$$-th of the next $$$h$$$ lines contains string $$$s_{i}$$$ of length $$$w$$$ consisting "." and "*" where "." denotes the empty space and "*" denotes the non-empty space. | ["YES", "NO", "NO", "NO", "NO", "NO"] | #include<stdio.h>
#include<stdlib.h>
char pic[550][550]={};
int n, m, cx=-1, cy=-1;
int isCenter( int i, int j )
{
if( pic[i-1][j] == '*' && pic[i+1][j] == '*' && pic[i][j-1] == '*' && pic[i][j+1] == '*' )
return 1;
return 0;
}
void del( int x, int y )
{
for( int i=x-1; i>=0; i-- ){ //上下左右
if( pic[i][y] == '.' ... | |
You have a given picture with size $$$w \times h$$$. Determine if the given picture has a single "+" shape or not. A "+" shape is described below: A "+" shape has one center nonempty cell. There should be some (at least one) consecutive non-empty cells in each direction (left, right, up, down) from the center. In oth... | If the given picture satisfies all conditions, print "YES". Otherwise, print "NO". You can output each letter in any case (upper or lower). | C | 6405161be280fea943201fa00ef6f448 | 7af9f92a450b09e647957752b96404fe | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation",
"dfs and similar",
"strings"
] | 1560258300 | ["5 6\n......\n..*...\n.****.\n..*...\n..*...", "3 5\n..*..\n****.\n.*...", "7 7\n.......\n...*...\n..****.\n...*...\n...*...\n.......\n.*.....", "5 6\n..**..\n..**..\n******\n..**..\n..**..", "3 7\n.*...*.\n***.***\n.*...*.", "5 10\n..........\n..*.......\n.*.******.\n..*.......\n.........."] | NoteIn the first example, the given picture contains one "+".In the second example, two vertical branches are located in a different column.In the third example, there is a dot outside of the shape.In the fourth example, the width of the two vertical branches is $$$2$$$.In the fifth example, there are two shapes.In the... | PASSED | 1,300 | standard input | 1 second | The first line contains two integers $$$h$$$ and $$$w$$$ ($$$1 \le h$$$, $$$w \le 500$$$) — the height and width of the picture. The $$$i$$$-th of the next $$$h$$$ lines contains string $$$s_{i}$$$ of length $$$w$$$ consisting "." and "*" where "." denotes the empty space and "*" denotes the non-empty space. | ["YES", "NO", "NO", "NO", "NO", "NO"] | #include<stdio.h>
#include<math.h>
int main()
{
int w, h, i, j, a=0, cnt=0, c=0, d=0;
scanf("%d %d", &h, &w);
getchar();
char str[h+1][w+1];
for (i=0; i<h; i++)
gets(str[i]);
for (i=0; i<h; i++)
for (j=0; j<w; j++)
if ( str[i][j]=='*' )
cnt++;
if ... | |
You have a given picture with size $$$w \times h$$$. Determine if the given picture has a single "+" shape or not. A "+" shape is described below: A "+" shape has one center nonempty cell. There should be some (at least one) consecutive non-empty cells in each direction (left, right, up, down) from the center. In oth... | If the given picture satisfies all conditions, print "YES". Otherwise, print "NO". You can output each letter in any case (upper or lower). | C | 6405161be280fea943201fa00ef6f448 | 9a652b338e3d7247ec223b1fe6e7a2fa | GNU C11 | standard output | 256 megabytes | train_001.jsonl | [
"implementation",
"dfs and similar",
"strings"
] | 1560258300 | ["5 6\n......\n..*...\n.****.\n..*...\n..*...", "3 5\n..*..\n****.\n.*...", "7 7\n.......\n...*...\n..****.\n...*...\n...*...\n.......\n.*.....", "5 6\n..**..\n..**..\n******\n..**..\n..**..", "3 7\n.*...*.\n***.***\n.*...*.", "5 10\n..........\n..*.......\n.*.******.\n..*.......\n.........."] | NoteIn the first example, the given picture contains one "+".In the second example, two vertical branches are located in a different column.In the third example, there is a dot outside of the shape.In the fourth example, the width of the two vertical branches is $$$2$$$.In the fifth example, there are two shapes.In the... | PASSED | 1,300 | standard input | 1 second | The first line contains two integers $$$h$$$ and $$$w$$$ ($$$1 \le h$$$, $$$w \le 500$$$) — the height and width of the picture. The $$$i$$$-th of the next $$$h$$$ lines contains string $$$s_{i}$$$ of length $$$w$$$ consisting "." and "*" where "." denotes the empty space and "*" denotes the non-empty space. | ["YES", "NO", "NO", "NO", "NO", "NO"] | #include <stdio.h>
void abort() {
printf("NO");
exit(0);
}
int main() {
int w, h, x = -1, y, u, d, l, r, i, j;
char p[500][500];
scanf("%d %d", &w, &h);
for(i = 0; i < w; i++)
for(j = 0; j < h; j++)
scanf(" %c", &p[i][j]);
for(i = 1; i < w - 1; i++) {
for(j = 1; j < h - 1; j++) {
if(p[i][j] == '*' && p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.