Submission #1112370

# Submission time Handle Problem Language Result Execution time Memory
1112370 2024-11-14T06:50:08 Z vjudge1 Baloni (COCI15_baloni) C++17
0 / 100
55 ms 3664 KB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int a;
    int b;
   
    long long int toplam=0;
    scanf("%d",&a);
     vector<int> c(a);
    for(int i=0;i<a;i++){
        scanf("%d",&c[i]);
        
    }
     int sayac=a;

     for(int i=1;i<a;i++){
    if(c[i-1]-c[i]==1){
        sayac=sayac-1;
    }
        
    }
  
    printf("%d",sayac);

    return 0;
}

Compilation message

baloni.cpp: In function 'int main()':
baloni.cpp:8:9: warning: unused variable 'b' [-Wunused-variable]
    8 |     int b;
      |         ^
baloni.cpp:10:19: warning: unused variable 'toplam' [-Wunused-variable]
   10 |     long long int toplam=0;
      |                   ^~~~~~
baloni.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     scanf("%d",&a);
      |     ~~~~~^~~~~~~~~
baloni.cpp:14:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |         scanf("%d",&c[i]);
      |         ~~~~~^~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Incorrect 1 ms 336 KB Output isn't correct
3 Incorrect 1 ms 336 KB Output isn't correct
4 Incorrect 1 ms 336 KB Output isn't correct
5 Incorrect 49 ms 3528 KB Output isn't correct
6 Incorrect 49 ms 3664 KB Output isn't correct
7 Incorrect 44 ms 3152 KB Output isn't correct
8 Incorrect 39 ms 3152 KB Output isn't correct
9 Incorrect 45 ms 3408 KB Output isn't correct
10 Incorrect 55 ms 3408 KB Output isn't correct