結果
問題 |
No.2032 Let's Write Multiples!!
|
ユーザー |
👑 |
提出日時 | 2022-07-24 15:46:09 |
言語 | C (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 432 bytes |
コンパイル時間 | 313 ms |
コンパイル使用メモリ | 29,312 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-06 10:20:52 |
合計ジャッジ時間 | 12,183 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | AC * 10 WA * 13 TLE * 1 |
ソースコード
#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; }