結果
問題 |
No.191 供託金
|
ユーザー |
![]() |
提出日時 | 2025-03-27 15:10:36 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 358 bytes |
コンパイル時間 | 467 ms |
コンパイル使用メモリ | 28,032 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-03-27 15:10:38 |
合計ジャッジ時間 | 1,573 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 21 WA * 2 |
コンパイルメッセージ
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:12:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 12 | scanf("%d",&ballot[i]); | ~~~~~^~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(){ // 立候補人数 int val = 0; scanf("%d",&val); // 有効投票総数 int sum = 0; // 各投票数 int ballot[val]; for(int i = 0;i < val;i ++){ scanf("%d",&ballot[i]); sum += ballot[i]; } sum /= 10; int ans = 0; for(int i = 0;i < val;i ++){ if(sum > ballot[i]){ ans += 30; } } printf("%d",ans); }