結果
| 問題 |
No.2246 1333-like Number
|
| コンテスト | |
| ユーザー |
kcvlex
|
| 提出日時 | 2023-03-17 21:27:14 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 478 bytes |
| コンパイル時間 | 3,104 ms |
| コンパイル使用メモリ | 148,988 KB |
| 最終ジャッジ日時 | 2025-02-11 12:33:27 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
#include <iostream>
#include <vector>
#include <atcoder/all>
#define ALL(V) std::begin(V), std::end(V)
int main() {
int N;
std::cin >> N;
int len = (N - 1) / 36 + 1;
int rem = (N - 1) % 36;
int a = 1, b = 2;
for (int i = 1; i <= rem; i++) {
if (b == 9) {
a++;
b = a + 1;
} else {
b++;
}
}
std::cout << a;
while (len--) std::cout << b;
std::cout << std::endl;
return 0;
}
kcvlex