結果

問題 No.210 探し物はどこですか?
ユーザー autotaker1984autotaker1984
提出日時 2015-04-08 12:20:05
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 1,500 ms / 2,000 ms
コード長 616 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 25,772 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-17 16:06:53
合計ジャッジ時間 22,818 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
4,376 KB
testcase_01 AC 374 ms
4,376 KB
testcase_02 AC 1,499 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,504 KB
testcase_13 AC 16 ms
4,376 KB
testcase_14 AC 16 ms
4,380 KB
testcase_15 AC 16 ms
4,376 KB
testcase_16 AC 16 ms
4,376 KB
testcase_17 AC 15 ms
4,376 KB
testcase_18 AC 16 ms
4,376 KB
testcase_19 AC 16 ms
4,380 KB
testcase_20 AC 16 ms
4,376 KB
testcase_21 AC 16 ms
4,376 KB
testcase_22 AC 16 ms
4,380 KB
testcase_23 AC 374 ms
4,380 KB
testcase_24 AC 373 ms
4,376 KB
testcase_25 AC 374 ms
4,376 KB
testcase_26 AC 375 ms
4,380 KB
testcase_27 AC 374 ms
4,376 KB
testcase_28 AC 373 ms
4,376 KB
testcase_29 AC 376 ms
4,380 KB
testcase_30 AC 374 ms
4,376 KB
testcase_31 AC 376 ms
4,380 KB
testcase_32 AC 374 ms
4,376 KB
testcase_33 AC 1,497 ms
4,380 KB
testcase_34 AC 1,496 ms
4,376 KB
testcase_35 AC 1,495 ms
4,376 KB
testcase_36 AC 1,495 ms
4,376 KB
testcase_37 AC 1,496 ms
4,380 KB
testcase_38 AC 1,499 ms
4,380 KB
testcase_39 AC 1,500 ms
4,376 KB
testcase_40 AC 1,495 ms
4,376 KB
testcase_41 AC 1,497 ms
4,376 KB
testcase_42 AC 1,496 ms
4,376 KB
testcase_43 AC 1 ms
4,376 KB
testcase_44 AC 1 ms
4,376 KB
testcase_45 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>

int n;
double p[1001];
double q[1001];
int main(void) {
  int i;
  scanf("%d",&n);
  for( i = 0; i < n; i++ ) {
    int x;
    scanf("%d",&x);
    p[i] = x / 1000.0;
  }
  for( i = 0; i < n; i++ ) {
    int x;
    scanf("%d",&x);
    q[i] = x / 100.0;
  }
  for( i = 0; i < n; i++ )
    p[i] *= q[i];
  double exp = 0;
  int c = 1;
  while( c < 1000 * n) {
    double mp = p[0];
    int mi = 0;
    for( i = 1; i < n; i++ ) {
      if( mp < p[i] ) {
        mi = i;
        mp = p[i];
      }
    }
    exp += c * mp;
    c++;
    p[mi] *= 1 - q[mi];
  }
  printf("%5f\n",exp);
  return 0;
}





0