Submission #1112379

#TimeUsernameProblemLanguageResultExecution timeMemory
1112379vjudge1Baloni (COCI15_baloni)C++17
0 / 100
58 ms3664 KiB
#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 (stderr)

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]);
      |         ~~~~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...