結果

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

ソースコード

diff #

#include <iostream>
using namespace std;
int main() {
    long long n;
    cin >> n;
    int a = 0;
    if (n >= 1){
        for (int i = 1; i <= n; i++)
        {

            if (n / 10 != 0)
                a++;
            else if (n / 10 == 0)
                break;
            n /= 10;
        }
    cout << (a + 2) * 9;
}
    return 0;
}
0