結果
| 問題 | No.3455 N-beatsu |
| コンテスト | |
| ユーザー |
forest3
|
| 提出日時 | 2026-04-23 15:13:17 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 509 bytes |
| 記録 | |
| コンパイル時間 | 976 ms |
| コンパイル使用メモリ | 182,716 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-23 15:13:21 |
| 合計ジャッジ時間 | 2,247 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 2 WA * 8 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = a; i < b; i++)
using ll = long long;
int main(){
int n, q;;
cin >> n >> q;
string s = to_string(n);
int sz = s.size();
rep(qi, 0, q) {
int x;
cin >> x;
string ans = "No";
if(x % n == 0) ans = "Yes";
else {
string xs = to_string(x);
int xsz = xs.size();
rep(i, 0, xsz) {
if(i + sz >= xsz) break;
if(xs.substr(i, sz) == s) {
ans = "Yes";
break;
}
}
}
cout << ans << endl;
}
}
forest3