結果

問題 No.191 供託金
ユーザー cowgirl
提出日時 2018-09-28 09:02:31
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 343 bytes
コンパイル時間 1,777 ms
コンパイル使用メモリ 168,200 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-12 04:45:46
合計ジャッジ時間 2,452 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:17:13: warning: 'rel' may be used uninitialized [-Wmaybe-uninitialized]
   17 |     cout << rel << endl;
      |             ^~~
main.cpp:13:9: note: 'rel' was declared here
   13 |     int rel;
      |         ^~~

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
    int N; cin >> N;
    std::vector<int> cn;
    int c,sum=0;
    for(int i=0; i<N; i++){
        cin >> c;
        cn.push_back(c);
        sum += c;
    } 
    sum /= 10;
    int rel;
    for(int i=0; i < N; i++){
        if(cn[i] <= sum) rel += 30;
    }
    cout << rel << endl;
}
0