提出 #20885363


ソースコード 拡げる

#include<bits/stdc++.h>
using namespace std;
long long stoll(const std::wstring& str,
                  std::size_t* idx = nullptr,
                  long long base = 10); 
int main(){
    string a;
    cin>>a;
    int y = a.size();
    long long x = stoll(a);
    if(y <= 3)
    {
        cout <<"0"<< endl;
    }
    if(y >= 4&& y <= 6)
    {
        cout << x - 999 << endl;
    }
    
    long long ans;
    if(y >=7 && y <=9)
    {
        ans = (999999 - 999)+((x-999999)*2);
        
    cout<< ans <<endl;
    }
    if(y >= 10 && y<=12)
    {
        ans = (999999 - 999)+((999999999-999999)*2)+((x-999999999)*3);
        
    cout<< ans <<endl;
    }
    
    if(y >= 13 && y<=15)
    {
        ans = (999999 - 999)+((999999999-999999)*2)+((999999999999-999999999)*3)+((x-999999999999)*4);
        
    cout<< ans <<endl;
    }
    if(y == 16)
    {
        ans = (999999 - 999)+((999999999-999999)*2)+((999999999999-999999999)*3)+((999999999999999-999999999999)*4)+((x-999999999999999)*5);
        cout << ans << endl;
    }
}

提出情報

提出日時
問題 C - Comma
ユーザ Rey564219
言語 C++ (GCC 9.2.1)
得点 300
コード長 1084 Byte
結果 AC
実行時間 6 ms
メモリ 3632 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 2
AC × 20
セット名 テストケース
Sample sample_01.txt, sample_02.txt
All hand_01.txt, hand_02.txt, hand_03.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, sample_01.txt, sample_02.txt
ケース名 結果 実行時間 メモリ
hand_01.txt AC 3 ms 3576 KiB
hand_02.txt AC 6 ms 3584 KiB
hand_03.txt AC 4 ms 3500 KiB
random_01.txt AC 2 ms 3616 KiB
random_02.txt AC 2 ms 3416 KiB
random_03.txt AC 3 ms 3632 KiB
random_04.txt AC 2 ms 3600 KiB
random_05.txt AC 2 ms 3600 KiB
random_06.txt AC 2 ms 3420 KiB
random_07.txt AC 2 ms 3468 KiB
random_08.txt AC 2 ms 3492 KiB
random_09.txt AC 2 ms 3496 KiB
random_10.txt AC 2 ms 3600 KiB
random_11.txt AC 2 ms 3420 KiB
random_12.txt AC 2 ms 3468 KiB
random_13.txt AC 5 ms 3580 KiB
random_14.txt AC 2 ms 3520 KiB
random_15.txt AC 2 ms 3632 KiB
sample_01.txt AC 3 ms 3616 KiB
sample_02.txt AC 2 ms 3596 KiB