結果

問題 No.1915 Addition
ユーザー nystnyst
提出日時 2022-04-29 22:22:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 605 bytes
コンパイル時間 1,049 ms
コンパイル使用メモリ 95,216 KB
実行使用メモリ 8,768 KB
最終ジャッジ日時 2023-09-11 13:42:54
合計ジャッジ時間 4,810 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
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 << a << " " << n+i <<" "<<  n << " " << i<<endl;
            break;
        }
        i++;
    }   
    }
}
0