結果
| 問題 | No.3535 $E\times - Otogibanashi$ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-23 04:14:25 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 714 ms / 2,000 ms |
| + 689µs | |
| コード長 | 507 bytes |
| 記録 | |
| コンパイル時間 | 3,090 ms |
| コンパイル使用メモリ | 186,136 KB |
| 実行使用メモリ | 91,828 KB |
| 最終ジャッジ日時 | 2026-09-23 04:14:41 |
| 合計ジャッジ時間 | 9,545 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 21 |
ソースコード
#include<iostream>
#include<vector>
#include<unordered_set>
#include<algorithm>
using namespace std;
using ll = long long;
int main(void){
ll n, p; cin >> n >> p;
ll ans=0;
unordered_set<int> used;
for(int i=1; i<10; i++)for(int j=0; j<10; j++)for(int k=0; k<10; k++){
ll now=i*110000+j*1001+k*110;
ll x=now;
while(x<=n){
if(used.count(x)){x+=now; continue;}
ans+=-x, ans%=p; ans=(ans+p)%p;
used.insert(x);
x+=now;
}
}
cout << ans << endl;
return 0;
}