Submission #00098


ソースコード

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
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m,o,a;
int b[101];
double p[101];
double ma = 0;
cin >> n >> m >> o;
fill(b,b+101,m);
for(int i=0;i<o;i++){
cin >> a;
b[a]--;
}
for(int i=0;i<=n;i++){
int fr = b[i];
int se = (n+1)*m-o;
if(se == 0) p[i] = 0;
else p[i] = (double)fr/se;
int one = (int)(p[i]*(double)100);
p[i] = (double)one/100;
if(ma < p[i]) ma = p[i];
}
for(int i=0;i<=n;i++){
if(ma == p[i]){
printf("%d %.0f%% %.2f\n",i,p[i]*100,p[i]);
}
}
return (0);
}

ステータス

項目 データ
問題 0003 - 確率ゲー
ユーザー名 ピッツァ
投稿日時 2017-08-01 11:03:18
言語 C++11
状態 Wrong Answer
得点 0
ソースコード長 604 Byte
最大実行時間 15 ms
最大メモリ使用量 640 KB

セット

セット 得点 Cases
1 ALL 0 / 30 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
Input00.txt WA 15 ms 480 KB
1
Input01.txt AC 12 ms 456 KB
1
Input02.txt WA 10 ms 436 KB
1
Input03.txt WA 11 ms 540 KB
1
Input04.txt WA 13 ms 640 KB
1
Input05.txt WA 10 ms 484 KB
1
Input06.txt WA 13 ms 456 KB
1
Input07.txt AC 14 ms 432 KB
1