Submission #3790641


Source Code Expand

#include<cstdio>
int main(void){
int n,x,y,ans;
  scanf("%d",&n);
  ans=0;
  for(int i=0;i<n;i++){
   scanf("%d",&y);
    if(i>0){
     if(x==y){
      ans++;
       y=0;
     }
    }
    x=y;
  }
  printf("%d\n",ans);
  return 0;
}

Submission Info

Submission Time
Task A - Colorful Slimes 2
User MPL
Language C++14 (GCC 5.4.1)
Score 200
Code Size 249 Byte
Status AC
Exec Time 1 ms
Memory 128 KB

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:4:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&n);
                 ^
./Main.cpp:7:18: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
    scanf("%d",&y);
                  ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 4
AC × 13
Set Name Test Cases
Sample example_0, example_1, example_2, example_3
All example_0, example_1, example_2, example_3, handmade_0, handmade_1, rand_0, rand_1, smallcolor_0, smallcolor_1, smallcolor_2, smallcolor_3, smallcolor_4
Case Name Status Exec Time Memory
example_0 AC 1 ms 128 KB
example_1 AC 1 ms 128 KB
example_2 AC 1 ms 128 KB
example_3 AC 1 ms 128 KB
handmade_0 AC 1 ms 128 KB
handmade_1 AC 1 ms 128 KB
rand_0 AC 1 ms 128 KB
rand_1 AC 1 ms 128 KB
smallcolor_0 AC 1 ms 128 KB
smallcolor_1 AC 1 ms 128 KB
smallcolor_2 AC 1 ms 128 KB
smallcolor_3 AC 1 ms 128 KB
smallcolor_4 AC 1 ms 128 KB