제출 #1112370

#제출 시각아이디문제언어결과실행 시간메모리
1112370vjudge1Baloni (COCI15_baloni)C++17
0 / 100
55 ms3664 KiB
#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;
}

컴파일 시 표준 에러 (stderr) 메시지

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 timeMemoryGrader output
Fetching results...