結果
問題 |
No.143 豆
|
ユーザー |
![]() |
提出日時 | 2023-08-03 15:31:46 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 421 bytes |
コンパイル時間 | 681 ms |
コンパイル使用メモリ | 103,832 KB |
最終ジャッジ日時 | 2025-02-15 21:48:56 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 WA * 14 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:19:14: warning: ‘sum1’ may be used uninitialized [-Wmaybe-uninitialized] 19 | sum1 += t; | ~~~~~^~~~ main.cpp:14:18: note: ‘sum1’ was declared here 14 | int k, n, f, sum1; | ^~~~
ソースコード
#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 k, n, f, sum1; cin >> k >> n >> f; for (int i = 0; i < f; i++){ int t; cin >> t; sum1 += t; } if (k*n >= sum1) cout << k*n - sum1 << endl; else cout << -1 << endl; }