Submission #00008
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | #include <bits/stdc++.h> using namespace std; signed main() { int n, m; while (cin >> n >> m, n) { vector< int > a(n); int d =m/n; int sum = 0; for ( int i = 0; i < n; i++) { cin >>a[i]; sum += min(d, a[i]); } cout << sum << endl; } return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0002 - 割り勘 |
ユーザー名 | ei1821 |
投稿日時 | 2020-03-27 09:09:25 |
言語 | C++14 |
状態 | Accepted |
得点 | 8 |
ソースコード長 | 302 Byte |
最大実行時間 | 27 ms |
最大メモリ使用量 | 548 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | A1 | 2 / 2 | A1 |
2 | A2 | 2 / 2 | A2 |
3 | A3 | 2 / 2 | A3 |
4 | A4 | 2 / 2 | A4 |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # | |||
---|---|---|---|---|---|---|---|
A1 | AC | 26 ms | 476 KB |
1
|
|||
A2 | AC | 26 ms | 444 KB |
2
|
|||
A3 | AC | 23 ms | 548 KB |
3
|
|||
A4 | AC | 27 ms | 520 KB |
4
|