結果

問題 No.87 Advent Calendar Problem
ユーザー tottoripapertottoripaper
提出日時 2015-03-16 04:43:17
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 846 bytes
コンパイル時間 235 ms
コンパイル使用メモリ 39,428 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-11 08:28:35
合計ジャッジ時間 1,733 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

// YukiCoderたんイェイ〜

#include <cstdio>
#include <vector>

std::vector<int> v{3, 8, 14, 25, 31, 36, 42, 53, 59, 64, 70, 81, 87, 92, 98, 104, 110, 121, 127, 132, 138, 149, 155, 160, 166, 177, 183, 188, 194, 200, 206, 217, 223, 228, 234, 245, 251, 256, 262, 273, 279, 284, 290, 302, 313, 319, 324, 330, 341, 347, 352, 358, 369, 375, 380, 386, 397};

bool isSame[400];

int main(){
    long long N;
    scanf("%lld", &N);

    for(int i : v){isSame[i] = true;}
    
    long long res = 0ll;

    if(N < 2400){
        for(int y=2015;y<=N;y++){
            res += isSame[y%400];
        }
    }else{
        for(int y=2015;y<2400;y++){
            res += isSame[y%400];
        }
        res += (N-2400) / 400 * v.size();
        for(N=(N-2400)%400;N>=0;N--){
            res += isSame[N%400];
        }
    }

    printf("%lld\n", res);
}
0