Submission #00075


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include<bits/stdc++.h>
using namespace std;
int main(){
double a,b,c,x[100],y=0;
while(1){
cin>>a>>b;
if(a==0 ||b==0)
return(0);
c=b/a;
for(int i=0;i<a;i++){
cin>>x[i];
}
for(int i=0;i<a;i++){
if(x[i]<c)
y=y+x[i];
else
y=y+c;
}
cout<<y<<endl;
y=0;
}
return 0;
}

ステータス

項目 データ
問題 0002 - 割り勘
ユーザー名 e1919
投稿日時 2020-03-27 09:54:24
言語 C++
状態 Accepted
得点 8
ソースコード長 362 Byte
最大実行時間 24 ms
最大メモリ使用量 704 KB

セット

セット 得点 Cases
1 A1 2 / 2 A1
2 A2 2 / 2 A2
3 A3 2 / 2 A3
4 A4 2 / 2 A4

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
A1 AC 24 ms 604 KB
1
A2 AC 19 ms 704 KB
2
A3 AC 20 ms 552 KB
3
A4 AC 18 ms 656 KB
4