結果

問題 No.1915 Addition
ユーザー nystnyst
提出日時 2022-04-29 22:24:00
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 616 bytes
コンパイル時間 750 ms
コンパイル使用メモリ 95,416 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-09-11 13:44:33
合計ジャッジ時間 4,611 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 TLE -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <fstream>
#include <cmath>
#include <stack>
#include <queue>
#include <iomanip>
#include <bitset>
using namespace std;

int main(){

    int t;cin>>t;
    for(int cas =0;cas<t;cas++){
        int n; cin>>n;
        string pr = to_string(n);
        long long i = 1;
        while(1){
            string br = to_string(i);  
            long long a = stoll(pr+br);
            if(a%(n+i)==0) {
                cout << i<<endl;
                break;
            }
            i++;
        }   
    }
}
0