結果
| 問題 | No.2562 数字探しゲーム(緑以下コンver.) | 
| コンテスト | |
| ユーザー |  nonon | 
| 提出日時 | 2023-12-02 19:01:45 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                            (最新) 
                                AC
                                 
                            (最初) | 
| 実行時間 | - | 
| コード長 | 747 bytes | 
| コンパイル時間 | 1,878 ms | 
| コンパイル使用メモリ | 193,580 KB | 
| 最終ジャッジ日時 | 2025-02-18 06:12:44 | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 9 WA * 1 | 
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
ll T,M;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin>>T;
    for(;T--;)
    {
        cin>>M;
        vector<int>d(10,0);
        for(int i=1;i<=9;i++)cin>>d[i];
        ll ans=0;
        for(int i=1;i<=9;i++)
        {
            for(int j=0;j<d[i];j++)
            {
                ans*=10;
                ans+=i;
            }
        }
        assert(ans<=1e9);
        ans*=1e9;
        ans+=999999999;
        ans-=ans%M;
        assert(ans<=1e18);
        assert(ans%M==0);
        cout << ans << endl;
        while(ans)
        {
            d[ans%10]--;
            ans/=10;
        }
        for(int i=1;i<=9;i++)assert(d[i]<=0);
    }
}
            
            
            
        