結果
| 問題 | No.3455 N-beatsu |
| コンテスト | |
| ユーザー |
Tehom
|
| 提出日時 | 2026-03-01 18:13:13 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 909 bytes |
| 記録 | |
| コンパイル時間 | 3,025 ms |
| コンパイル使用メモリ | 277,144 KB |
| 実行使用メモリ | 7,972 KB |
| 最終ジャッジ日時 | 2026-03-01 18:13:18 |
| 合計ジャッジ時間 | 4,409 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 1 RE * 9 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define ll long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define repl(i,a,b) for(ll i=(a);i<(b);i++)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
template <typename T> bool chmin(T &a,T b){if(a>b){a=b;return true;} return false;}
template <typename T> bool chmax(T &a,T b){if(a<b){a=b;return true;} return false;}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n,q; cin >> n >> q;
string s=to_string(n);
while(q--){
int x; cin >> x;
if(x%n == 0){
cout << "Yes" << '\n';
continue;
}
string t=to_string(x);
bool can=false;
rep(i,0,t.size()-s.size()+1){
string tt;
rep(j,i,i+s.size()) tt+=t[j];
if(s == tt) can=true;
}
if(can) cout << "Yes" << '\n';
else cout << "No" << '\n';
}
}
Tehom