結果

問題 No.1915 Addition
ユーザー atjh16atjh16
提出日時 2022-08-12 18:31:00
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 306 bytes
コンパイル時間 2,223 ms
コンパイル使用メモリ 200,560 KB
実行使用メモリ 7,832 KB
最終ジャッジ日時 2023-10-24 04:25:53
合計ジャッジ時間 7,060 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int t, n;

int main()
{
	cin >> t;

	for (int i = 0; i < t; i++) {
		cin >> n;

		for (int j = 1; ; j++) {
			int a = n + j;
			int b = 1;

			while (b <= j)
				b *= 10;

			b = n * b + j;

			if (b % a == 0) {
				cout << j << endl;
				break;
			}
		}
	}
}
0