結果

問題 No.586 ダブルブッキング
ユーザー kazuki794kazuki794
提出日時 2017-12-24 14:40:55
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 489 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 27,976 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-08-22 18:00:26
合計ジャッジ時間 846 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 0 ms
4,380 KB
testcase_03 AC 0 ms
4,380 KB
testcase_04 AC 0 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 0 ms
4,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main(void) {
  int P1,P2,N;
  int R[100];
  do {
    scanf("%d", &P1);
  } while (P1<1 && P1>100000);

  do {
    scanf("%d", &P2);
  } while(P2<1 && P2>100000);

  do {
    scanf("%d", &N);
  } while(N<1 && N>100);

  int i,j;
  int cnt = 0;
  for(i=0;i<=N-1;i++) {

    do {
      scanf("%d", &R[i]);
    } while(R[i]<1 && R[i]>999);

    for(j=0;j<=i-1;j++){
      if(R[i] == R[j]){
	cnt++;
	break;
      }
    }
  }
  printf("%d\n", (P1+P2)*cnt);

  return 0;
}
0