Submission #00006
ソースコード
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 27 28 | #include<bits/stdc++.h> #define INF 9223372036854775807LL #define inf 1000000007 #define SYOU(x) fixed<<setprecision(x+1) #define abs(x,y) (max(x,y)-min(x,y)) #define lol long long #define mp make_pair #define fi first #define se second using namespace std; lol k[1010]; signed main(){ cin.tie(0); ios::sync_with_stdio( false ); lol n,m,a,b,c,d; while (1){ cin >>n>>m; if (n==0&&m==0) break ; lol sum=0; a=m/n; for ( int i=0;i<n;i++){ cin >>b; sum+=min(a,b); } cout <<sum<< '\n' ; } return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0002 - 割り勘 |
ユーザー名 | ei1923 |
投稿日時 | 2020-03-27 09:08:18 |
言語 | C++14 |
状態 | Accepted |
得点 | 8 |
ソースコード長 | 582 Byte |
最大実行時間 | 23 ms |
最大メモリ使用量 | 604 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | A1 | 2 / 2 | A1 |
2 | A2 | 2 / 2 | A2 |
3 | A3 | 2 / 2 | A3 |
4 | A4 | 2 / 2 | A4 |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # | |||
---|---|---|---|---|---|---|---|
A1 | AC | 23 ms | 604 KB |
1
|
|||
A2 | AC | 21 ms | 424 KB |
2
|
|||
A3 | AC | 17 ms | 504 KB |
3
|
|||
A4 | AC | 22 ms | 584 KB |
4
|