結果
問題 | No.2032 Let's Write Multiples!! |
ユーザー |
👑 ![]() |
提出日時 | 2022-08-05 22:23:16 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 179 ms / 3,000 ms |
コード長 | 593 bytes |
コンパイル時間 | 2,996 ms |
コンパイル使用メモリ | 247,708 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-15 19:29:38 |
合計ジャッジ時間 | 6,616 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 24 |
ソースコード
#include <bits/stdc++.h>#include <atcoder/math>using namespace std;using ll = long long;ll solve(){ll L, R, K, C;cin >> L >> R >> K >> C;R /= K;--L /= K;ll ans = 0;ll pow10 = 1;for(ll d = 0; d < 9; d++){ans += atcoder::floor_sum(R - L, pow10 * 10, K, (L + 1) * K - C * pow10);ans -= atcoder::floor_sum(R - L, pow10 * 10, K, (L + 1) * K - (C + 1) * pow10);pow10 *= 10;}return ans;}int main(){cin.tie(nullptr);ios::sync_with_stdio(false);ll T;cin >> T;while(T--) cout << solve() << '\n';}