結果
| 問題 | No.3455 N-beatsu |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-02-28 14:01:33 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 96 ms / 2,000 ms |
| コード長 | 537 bytes |
| 記録 | |
| コンパイル時間 | 3,745 ms |
| コンパイル使用メモリ | 337,420 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-02-28 14:01:38 |
| 合計ジャッジ時間 | 4,518 ms |
|
ジャッジサーバーID (参考情報) |
judge7 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 10 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
bool in(ll x, ll y) {
string s = to_string(x);
int n = s.size();
string t = to_string(y);
int m = t.size();
rep(i, n - m + 1) {
if (s.substr(i, m) == t)
return true;
}
return false;
}
int main() {
int n, q;
cin >> n >> q;
while (q--) {
ll x;
cin >> x;
cout << (x % n == 0 || in(x, n) ? "Yes" : "No") << endl;
}
return 0;
}