// No.191 供託金 // https://yukicoder.me/problems/no/191 // #include #include #include using namespace std; int main() { unsigned int N; // 出馬人数 cin >> N; vector ballots(N, 0); // 各候補者の得票数 for (auto i = 0; i < N; i++) cin >> ballots[i]; int total_ballot = accumulate(ballots.begin(), ballots.end(), 0); // 総投票数の計算 int deposit = 0; // 没収された供託金 for (auto b: ballots) { if (b*10 <= total_ballot) // 有効票数の1/10以下の場合は没収 (以下なので=も含む) deposit += 30; } cout << deposit << endl; }