結果

問題 No.191 供託金
ユーザー nao109nao109
提出日時 2021-08-28 02:19:19
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 415 bytes
コンパイル時間 1,853 ms
コンパイル使用メモリ 157,608 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-21 10:04:39
合計ジャッジ時間 2,532 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main(){
    long long n,allc=0; cin >> n; long long c[n];
    for(int i=0; i<n; i++){
        cin >> c[i];
        allc+=c[i];
    }
    long long ans=0;
    for(int i=0; i<n; i++){
        if(c[i]==0) ans+=30;
        else{
            double ch=allc/c[i];
            //cout << ch << endl;
            if(ch>=10) ans+=30;
        }
    }
    cout << ans << endl;
}
0