結果

問題 No.2607 Add One Digit
ユーザー vjudge1
提出日時 2025-09-04 22:21:29
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 406 bytes
コンパイル時間 1,916 ms
コンパイル使用メモリ 194,352 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-09-04 22:21:33
合計ジャッジ時間 3,267 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

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

    long long N;
    if (!(cin >> N)) return 0;

    // ??m s? ch? s? L c?a N m khng dng xu
    int L = 0;
    long long x = N;
    do {
        ++L;
        x /= 10;
    } while (x > 0);

    long long ans = 9LL * (L + 1);
    cout << ans << '\n';
    return 0;
}
0