結果
| 問題 | No.2562 数字探しゲーム(緑以下コンver.) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-01-12 15:21:34 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 25 ms / 2,000 ms |
| コード長 | 448 bytes |
| 記録 | |
| コンパイル時間 | 2,089 ms |
| コンパイル使用メモリ | 191,448 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2025-01-12 15:21:38 |
| 合計ジャッジ時間 | 3,446 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 10 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
void solve(){
ll x=0;
ll M;
cin>>M;
for(int i=0;i<9;i++){
int d;
cin>>d;
while(d--){
x=(x*10+i+1);
}
}
x*=ll(1e9);
if(M!=ll(1e9))
x+=(M-(x%M));
if(x==0)x=M;
cout<<x<<endl;
}
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
ll T;
cin>>T;
while(T--)
solve();
}