結果

問題 No.756 チャンパーノウン定数 (1)
ユーザー eyeSharp
提出日時 2019-10-16 21:49:47
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 484 bytes
コンパイル時間 1,454 ms
コンパイル使用メモリ 159,588 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-23 04:26:23
合計ジャッジ時間 2,104 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

/*
    No.756 チャンパーノウン定数 (1)
    https://yukicoder.me/problems/no/756
*/
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    int d;
    cin >> d;

    int cnt = 1;
    while (true) {
        string s = to_string(cnt++);
        for (size_t j = 0; j < s.size(); j++) {
            d--;
            if (d == 0) {
                cout << s[j] << endl;
                return 0;
            }
        }
    }
}
0