結果
問題 | No.2032 Let's Write Multiples!! |
ユーザー |
![]() |
提出日時 | 2022-08-06 00:21:22 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 452 ms / 3,000 ms |
コード長 | 644 bytes |
コンパイル時間 | 4,096 ms |
コンパイル使用メモリ | 250,136 KB |
最終ジャッジ日時 | 2025-01-30 18:55:09 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 24 |
ソースコード
#include <stdio.h>#include <atcoder/all>#include <bits/stdc++.h>using namespace std;using namespace atcoder;using mint = modint998244353;#define rep(i,n) for (int i = 0; i < (n); ++i)#define Inf 1000000000long long get(long long N,long long K,long long C){long long cur = 1;long long ret = 0;rep(i,9){long long a = 0;a -= cur * C;ret += floor_sum(N/K+1,cur*10,K,a);a -= cur;ret -= floor_sum(N/K+1,cur*10,K,a);cur *= 10;//break;}return ret;}int main() {int _t;cin>>_t;rep(_,_t){long long L,R,K,C;cin>>L>>R>>K>>C;cout<<get(R,K,C) - get(L-1,K,C)<<endl;}return 0;}