結果
問題 | No.369 足し間違い |
ユーザー | daradara_sanma |
提出日時 | 2017-07-14 20:35:50 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 258 bytes |
コンパイル時間 | 419 ms |
コンパイル使用メモリ | 53,208 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-04-16 19:52:37 |
合計ジャッジ時間 | 870 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,376 KB |
testcase_02 | AC | 2 ms
5,376 KB |
testcase_03 | AC | 2 ms
5,376 KB |
testcase_04 | AC | 3 ms
5,376 KB |
testcase_05 | AC | 2 ms
5,376 KB |
testcase_06 | AC | 3 ms
5,376 KB |
testcase_07 | AC | 3 ms
5,376 KB |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d", &n); | ~~~~~^~~~~~~~~~ main.cpp:12:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 12 | scanf("%d", &A); | ~~~~~^~~~~~~~~~ main.cpp:15:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 15 | scanf("%d", &v); | ~~~~~^~~~~~~~~~
ソースコード
#include<iostream> #include<cstdio> #include<string> using namespace std; int main() { int n, v, sum = 0; scanf("%d", &n); for (int i = 0; i < n; i++) { int A; scanf("%d", &A); sum += A; } scanf("%d", &v); printf("%d\n", sum - v); return 0; }