結果

問題 No.586 ダブルブッキング
ユーザー じゃがりこじゃがりこ
提出日時 2018-08-10 21:04:18
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 281 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 28,640 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-24 13:33:24
合計ジャッジ時間 651 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>

int main(){
    int P1, P2, N, R, M = 0, c = 0, i;

    scanf("%d%d", &P1, &P2);
    scanf("%d", &N);
    for (i = 0; i < N; i++) {
    	scanf("%d", &R);
    	if (R == M) {
    		c++;
    	}
    	else {
    		M = R;
    	}
    }
    printf("%d", c*(P1 + P2));
}
0