제출 #732899

#제출 시각아이디문제언어결과실행 시간메모리
732899wenqi지구 온난화 (NOI13_gw)C++17
0 / 40
184 ms296 KiB
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N, h, p;
    long long total;
    
    scanf("%d", &N);
    scanf("%d", &p);
    total = p;
    for (int i = 1; i < N; ++i) {
        scanf("%d", &h);
        if (h > p) {
            total += min(1, h - p);
        }
        p = h;
    }
    printf("%lld", total);
}

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

gw.cpp: In function 'int main()':
gw.cpp:8:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |     scanf("%d", &N);
      |     ~~~~~^~~~~~~~~~
gw.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |     scanf("%d", &p);
      |     ~~~~~^~~~~~~~~~
gw.cpp:12:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |         scanf("%d", &h);
      |         ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...