結果
| 問題 | No.3455 N-beatsu |
| コンテスト | |
| ユーザー |
tau1235
|
| 提出日時 | 2026-02-28 15:52:31 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 97 ms / 2,000 ms |
| コード長 | 328 bytes |
| 記録 | |
| コンパイル時間 | 3,593 ms |
| コンパイル使用メモリ | 338,152 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-02-28 15:53:06 |
| 合計ジャッジ時間 | 4,631 ms |
|
ジャッジサーバーID (参考情報) |
judge7 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 10 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,q;
cin>>n>>q;
while (q--){
string x;
cin>>x;
bool ans=stoi(x)%n==0;
int k=x.size();
for (int i=0;i<k;i++) for (int j=i+1;j<=k;j++){
string t=x.substr(i,j-i);
if (to_string(n)==t) ans=true;
}
if (ans) cout<<"Yes\n";
else cout<<"No\n";
}
}
tau1235