結果
問題 |
No.2437 Fragile Multiples of 11
|
ユーザー |
|
提出日時 | 2023-08-12 01:59:16 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 892 bytes |
コンパイル時間 | 1,944 ms |
コンパイル使用メモリ | 195,932 KB |
最終ジャッジ日時 | 2025-02-16 02:37:03 |
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 TLE * 1 -- * 31 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/modint> #define rep(i,s,n) for(int i = int(s); i < int(n); i++) using i64 = std::int64_t; using mint = atcoder::modint998244353; int main() { int n; int x; std::cin >> n >> x; mint ans = 0; rep(i,11,x+1) { if(i % 11 != 0) continue; std::vector<int> p; { int ret = i; while(ret > 0) { p.emplace_back(ret % 10); ret /= 10; } std::reverse(p.begin(), p.end()); } int sz = p.size(); bool is_ok = true; rep(j,0,sz) { int now = 0; rep(k,0,sz) { if(k == j) continue; now = now * 10 + p[k]; now %= 11; } is_ok &= now != 0; } if(is_ok) ans++; } std::cout << ans.val() << '\n'; }