結果
問題 |
No.1915 Addition
|
ユーザー |
|
提出日時 | 2022-04-29 21:56:04 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 723 bytes |
コンパイル時間 | 3,903 ms |
コンパイル使用メモリ | 157,844 KB |
最終ジャッジ日時 | 2025-01-28 22:49:21 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 1 TLE * 9 |
ソースコード
#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--){ ll n; cin >> n; ll m = n; while(true){ //printf("(n,m) = (%d,%d)\n",n,m); ll x = m; ll 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; }