結果

問題 No.1915 Addition
ユーザー zezerozezero
提出日時 2022-04-29 21:54:42
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 727 bytes
コンパイル時間 3,164 ms
コンパイル使用メモリ 157,228 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-11 12:58:46
合計ジャッジ時間 5,634 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <iomanip>
#include <cstring>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < int(n);i++)

int main(){
  int tt;
  cin >> tt;
  while(tt--){
    int n;
    cin >> n;
    int m = n;
    while(true){
      //printf("(n,m) = (%d,%d)\n",n,m);
      int x = m;
      int sn = n;
      while(x > 0){
        x/=10;
        sn *= 10;
      }
      if ((sn+m)%(n+m) == 0){
        //printf("(n,m) = (%d,%d)\n",n,m);
        cout << m << endl;
        break;
      }
      m += n;
    }
  }
  return 0;
}
0