結果

問題 No.2032 Let's Write Multiples!!
ユーザー 👑 ygussanyygussany
提出日時 2022-07-24 15:46:09
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 432 bytes
コンパイル時間 236 ms
コンパイル使用メモリ 28,080 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-20 15:13:30
合計ジャッジ時間 15,494 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 21 ms
4,376 KB
testcase_03 AC 20 ms
4,380 KB
testcase_04 AC 28 ms
4,380 KB
testcase_05 TLE -
testcase_06 WA -
testcase_07 AC 24 ms
4,380 KB
testcase_08 WA -
testcase_09 AC 24 ms
4,380 KB
testcase_10 WA -
testcase_11 TLE -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 29 ms
4,376 KB
testcase_18 TLE -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 24 ms
4,376 KB
testcase_22 AC 24 ms
4,380 KB
testcase_23 AC 24 ms
4,380 KB
testcase_24 AC 24 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int solve_enumerate(int L, int R, int K, int C)
{
	int X, Y, ans = 0;
	for (X = (L + K - 1) / K * K; X <= R; X += K) for (Y = X; Y > 0; Y /= 10) if (Y % 10 == C) ans++;
	return ans;
}

int main()
{
	int T, L, R, K, C;
	scanf("%d", &T);
	while (T--) {
		scanf("%d %d %d %d", &L, &R, &K, &C);
		if ((R - L) / K <= 30000) printf("%d\n", solve_enumerate(L, R, K, C)); // 32000 -> TLE
	}
	fflush(stdout);
	return 0;
}
0