結果
問題 |
No.369 足し間違い
|
ユーザー |
![]() |
提出日時 | 2025-03-27 11:11:53 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 288 bytes |
コンパイル時間 | 505 ms |
コンパイル使用メモリ | 27,136 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-03-27 11:11:55 |
合計ジャッジ時間 | 1,519 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 5 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d",&val); | ~~~~~^~~~~~~~~~~ main.cpp:11:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | scanf("%d",&tmp); | ~~~~~^~~~~~~~~~~ main.cpp:17:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 17 | scanf("%lld",&yukians); | ~~~~~^~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(){ // 項数 int val = 0; scanf("%d",&val); // 合計値 int sum = 0; for(int i = 0;i < val;i ++){ int tmp = 0; scanf("%d",&tmp); sum += tmp; } // ゆきの解 long long yukians = 0; scanf("%lld",&yukians); printf("%lld",yukians - sum); }