답안 #1112379

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1112379 2024-11-14T07:00:12 Z vjudge1 Baloni (COCI15_baloni) C++17
0 / 100
58 ms 3664 KB
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int a = 0,ok = 1;
    scanf("%d",&a);
    int ar[a];
    for(int i = 0;i < a;++i){
        scanf("%d",&ar[i]);
        if(i > 0 && ar[i] != ar[i-1] - 1){
            ok++;
        }
    }
    printf("%d",ok);
    return 0;
}

Compilation message

baloni.cpp: In function 'int main()':
baloni.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |     scanf("%d",&a);
      |     ~~~~~^~~~~~~~~
baloni.cpp:10:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |         scanf("%d",&ar[i]);
      |         ~~~~~^~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Incorrect 1 ms 336 KB Output isn't correct
3 Incorrect 2 ms 336 KB Output isn't correct
4 Incorrect 1 ms 448 KB Output isn't correct
5 Incorrect 58 ms 3408 KB Output isn't correct
6 Incorrect 52 ms 3664 KB Output isn't correct
7 Incorrect 41 ms 3152 KB Output isn't correct
8 Incorrect 44 ms 3152 KB Output isn't correct
9 Incorrect 51 ms 3408 KB Output isn't correct
10 Incorrect 56 ms 3408 KB Output isn't correct