Submission #00100


ソースコード

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
29
30
31
32
33
34
35
36
#include<cstdio>
#include<algorithm>
#include<iostream>
using namespace std;
int main(){
int n,a,b;
int ca[111]={0};
int ans=0;
int cal=0;
scanf("%d",&n);
scanf("%d %d",&a,&b);
scanf("%d",&cal);
ans=cal/a;
for(int i=0;i<n;i++){
scanf("%d",&ca[i]);
}
sort(ca,ca+n,greater<int>());
for(int i=0;i<n;i++){
cal+=ca[i];
if(ans < cal/(a+(i+1)*b) ){
ans = cal/(a+(i+1)*b);
}
else break;
}
printf("%d\n",ans);
return 0;
}

ステータス

項目 データ
問題 0003 - 最高のピザ(Best Pizza)
ユーザー名 ei1410
投稿日時 2015-11-12 18:20:26
言語 C++11
状態 Wrong Answer
得点 40
ソースコード長 518 Byte
最大実行時間 19 ms
最大メモリ使用量 552 KB

セット

セット 得点 Cases
1 in1 20 / 20 in1.txt
2 in2 20 / 20 in2.txt
3 in3 0 / 20 in3.txt
4 in4 0 / 20 in4.txt
5 in5 0 / 20 in5.txt

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in1.txt AC 19 ms 472 KB
1
in2.txt AC 11 ms 452 KB
2
in3.txt WA 14 ms 552 KB
3
in4.txt WA 10 ms 532 KB
4
in5.txt WA 11 ms 512 KB
5