제출 #201663

#제출 시각아이디문제언어결과실행 시간메모리
201663SamAndTuna (COCI17_tuna)C++17
50 / 50
5 ms376 KiB
#include <bits/stdc++.h> using namespace std; int qq; int x; int main() { scanf("%d%d", &qq, &x); int ans = 0; while (qq--) { int a, b; scanf("%d%d", &a, &b); if (a > b) swap(a, b); if ((b - a) <= x) ans += b; else { int c; scanf("%d", &c); ans += c; } } printf("%d\n", ans); return 0; }

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

tuna.cpp: In function 'int main()':
tuna.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d", &qq, &x);
     ~~~~~^~~~~~~~~~~~~~~~~
tuna.cpp:14:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d", &a, &b);
         ~~~~~^~~~~~~~~~~~~~~~
tuna.cpp:22:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%d", &c);
             ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...