結果

問題 No.319 happy b1rthday 2 me
ユーザー chocoruskchocorusk
提出日時 2019-07-12 00:05:28
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 916 bytes
コンパイル時間 800 ms
コンパイル使用メモリ 98,908 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-26 07:32:31
合計ジャッジ時間 1,796 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 1 ms
6,944 KB
testcase_08 AC 1 ms
6,944 KB
testcase_09 AC 1 ms
6,940 KB
testcase_10 AC 1 ms
6,944 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 1 ms
6,940 KB
testcase_15 AC 1 ms
6,940 KB
testcase_16 AC 2 ms
6,944 KB
testcase_17 AC 1 ms
6,944 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 1 ms
6,944 KB
testcase_21 AC 1 ms
6,944 KB
testcase_22 AC 2 ms
6,944 KB
testcase_23 AC 2 ms
6,940 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 1 ms
6,940 KB
testcase_27 AC 2 ms
6,940 KB
testcase_28 AC 1 ms
6,944 KB
testcase_29 AC 2 ms
6,944 KB
testcase_30 AC 2 ms
6,940 KB
testcase_31 AC 1 ms
6,940 KB
testcase_32 AC 1 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
ll count(ll a, int t){
    if(a==0) return 0;
    ll ret=0;
    ll p=1;
    for(int i=0; i<15; i++){
        ret+=(a/p+87)/100*p;
        if(a/p%100==12) ret+=(a%p+1);
        p*=10;
    }
    if(t) a--;
    p=10;
    for(int i=0; i<15; i++){
        if(a<=2*p) break;
        if(a>=3*p) ret+=p/10;
        else ret+=(a-2*p+9)/10;
        p*=10;
    }
    return ret;
}
int main()
{
    ll a, b;
    cin>>a>>b;
    cout<<count(b, 1)-count(a-1, 0)<<endl;
    return 0;
}
0