結果
| 問題 | No.3548 SigMax Digits (Construction ver.) |
| コンテスト | |
| ユーザー |
沙耶花
|
| 提出日時 | 2026-05-22 23:10:20 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 136 ms / 2,000 ms |
| コード長 | 781 bytes |
| 記録 | |
| コンパイル時間 | 3,041 ms |
| コンパイル使用メモリ | 273,284 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-22 23:10:35 |
| 合計ジャッジ時間 | 6,546 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
| 純コード判定待ち |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 7 |
ソースコード
#include <stdio.h>
#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
using mint = modint998244353;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf32 1000000001
#define Inf64 4000000000000000001LL
int main(){
int _t;
cin>>_t;
rep(_,_t){
long long n;
cin>>n;
if(n<=9){
cout<<n<<' '<<n<<endl;
continue;
}
if(n>=1000){
long long L = 888888888888888888;
long long R = L;
while(true){
n -= 8;
if(n%9==0)break;
L--;
}
R += n/9;
cout<<L<<' '<<R<<endl;
continue;
}
long long L = 1;
rep(i,17)L *= 10;
long long R = L;
L -= n/9;
n %= 9;
if(n==0)R--;
if(n>1){
long long t = R;
rep(i,n-1){
L += t;
R += t;
}
}
cout<<L<<' '<<R<<endl;
}
return 0;
}
沙耶花