結果
| 問題 | No.369 足し間違い |
| コンテスト | |
| ユーザー |
kpinkcat
|
| 提出日時 | 2023-08-01 13:21:56 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 393 bytes |
| 記録 | |
| コンパイル時間 | 624 ms |
| コンパイル使用メモリ | 128,112 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-07-01 22:34:53 |
| 合計ジャッジ時間 | 1,333 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 5 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:19:14: warning: 'sum1' may be used uninitialized [-Wmaybe-uninitialized]
19 | sum1 += temp;
| ~~~~~^~~~~~~
main.cpp:14:18: note: 'sum1' was declared here
14 | int n, temp, sum1, y;
| ^~~~
ソースコード
#include<iostream>
#include<string>
#include<algorithm>
#include<cctype>
#include<set>
#include<bitset>
#include<math.h>
#include<map>
#include<queue>
#include<iomanip>
using namespace std;
int main(){
int n, temp, sum1, y;
cin >> n;
vector<int> v(n);
for (int i = 0; i < n; i++){
cin >> temp;
sum1 += temp;
}
cin >> y;
cout << sum1 - y << endl;
}
kpinkcat