提出 #57466452


ソースコード 拡げる

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ld = long double;
using pl = pair<ll, ll>;
constexpr ll INF = 1e9 + 7;
constexpr ll mod = 1e9 + 7;
constexpr ld eps = 1e-9;
const ld PI = acos(-1);

int main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    auto f1 = [=]mutable -> ll {
        while (a % 4 != 0) {
            ++a;
        }
        if (a >= c)return 0;
        ll times = (c - 1 - a) / 4 + 1;
        ll res = 0;
        if (b % 2)++b, res += times;
        res += times * (3 * ((d - b) / 2) + 2 * ((d - b) % 2));
        return res;
    };
    auto f2 = [=]mutable -> ll {
        while ((a % 4 + 4) % 4 != 1) {
            ++a;
        }
        if (a >= c)return 0;
        ll times = (c - 1 - a) / 4 + 1;
        ll res = 0;
        if (b % 2)++b, res += 2 * times;
        res += times * (3 * ((d - b) / 2) + ((d - b) % 2));
        return res;
    };
    auto f3 = [=]mutable -> ll {
        while ((a % 4 + 4) % 4 != 2) {
            ++a;
        }
        if (a >= c)return 0;
        ll times = (c - 1 - a) / 4 + 1;
        ll res = 0;
        if (b % 2)++b, res += times;
        res += times * ((d - b) / 2);
        return res;
    };
    auto f4 = [=]mutable -> ll {
        while ((a % 4 + 4) % 4 != 3) {
            ++a;
        }
        if (a >= c)return 0;
        ll times = (c - 1 - a) / 4 + 1;
        ll res = 0;
        if (b % 2)++b;
        res += times * ((d - b) / 2 + (d - b) % 2);
        return res;
    };
    ll res = f1() + f2() + f3() + f4();
    cout << res;
}

提出情報

提出日時
問題 D - AtCoder Wallpaper
ユーザ ZergTricky
言語 C++ 20 (gcc 12.2)
得点 450
コード長 1654 Byte
結果 AC
実行時間 8 ms
メモリ 3608 KiB

コンパイルエラー

Main.cpp: In function ‘int main()’:
Main.cpp:17:18: warning: parameter declaration before lambda declaration specifiers only optional with ‘-std=c++2b’ or ‘-std=gnu++2b’ [-Wc++23-extensions]
   17 |     auto f1 = [=]mutable -> ll {
      |                  ^~~~~~~
Main.cpp:28:18: warning: parameter declaration before lambda declaration specifiers only optional with ‘-std=c++2b’ or ‘-std=gnu++2b’ [-Wc++23-extensions]
   28 |     auto f2 = [=]mutable -> ll {
      |                  ^~~~~~~
Main.cpp:39:18: warning: parameter declaration before lambda declaration specifiers only optional with ‘-std=c++2b’ or ‘-std=gnu++2b’ [-Wc++23-extensions]
   39 |     auto f3 = [=]mutable -> ll {
      |                  ^~~~~~~
Main.cpp:50:18: warning: parameter declaration before lambda declaration specifiers only optional with ‘-std=c++2b’ or ‘-std=gnu++2b’ [-Wc++23-extensions]
   50 |     auto f4 = [=]mutable -> ll {
      |                  ^~~~~~~

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 450 / 450
結果
AC × 3
AC × 68
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_hand_00.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 02_random_06.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt, 02_random_10.txt, 02_random_11.txt, 02_random_12.txt, 02_random_13.txt, 02_random_14.txt, 02_random_15.txt, 02_random_16.txt, 02_random_17.txt, 02_random_18.txt, 02_random_19.txt, 02_random_20.txt, 02_random_21.txt, 02_random_22.txt, 02_random_23.txt, 02_random_24.txt, 02_random_25.txt, 02_random_26.txt, 02_random_27.txt, 02_random_28.txt, 02_random_29.txt, 02_random_30.txt, 02_random_31.txt, 02_random_32.txt, 02_random_33.txt, 02_random_34.txt, 02_random_35.txt, 02_random_36.txt, 02_random_37.txt, 02_random_38.txt, 02_random_39.txt, 02_random_40.txt, 02_random_41.txt, 02_random_42.txt, 02_random_43.txt, 02_random_44.txt, 02_random_45.txt, 02_random_46.txt, 02_random_47.txt, 02_random_48.txt, 02_random_49.txt, 02_random_50.txt, 02_random_51.txt, 02_random_52.txt, 02_random_53.txt, 02_random_54.txt, 02_random_55.txt, 02_random_56.txt, 02_random_57.txt, 02_random_58.txt, 02_random_59.txt, 02_random_60.txt, 02_random_61.txt, 02_random_62.txt, 02_random_63.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 8 ms 3376 KiB
00_sample_01.txt AC 1 ms 3400 KiB
00_sample_02.txt AC 1 ms 3484 KiB
01_hand_00.txt AC 1 ms 3464 KiB
02_random_00.txt AC 1 ms 3424 KiB
02_random_01.txt AC 1 ms 3492 KiB
02_random_02.txt AC 1 ms 3484 KiB
02_random_03.txt AC 1 ms 3608 KiB
02_random_04.txt AC 1 ms 3488 KiB
02_random_05.txt AC 1 ms 3484 KiB
02_random_06.txt AC 1 ms 3488 KiB
02_random_07.txt AC 1 ms 3360 KiB
02_random_08.txt AC 1 ms 3464 KiB
02_random_09.txt AC 1 ms 3484 KiB
02_random_10.txt AC 1 ms 3540 KiB
02_random_11.txt AC 1 ms 3496 KiB
02_random_12.txt AC 1 ms 3356 KiB
02_random_13.txt AC 1 ms 3500 KiB
02_random_14.txt AC 1 ms 3360 KiB
02_random_15.txt AC 1 ms 3580 KiB
02_random_16.txt AC 1 ms 3360 KiB
02_random_17.txt AC 1 ms 3484 KiB
02_random_18.txt AC 1 ms 3580 KiB
02_random_19.txt AC 1 ms 3400 KiB
02_random_20.txt AC 1 ms 3420 KiB
02_random_21.txt AC 1 ms 3468 KiB
02_random_22.txt AC 1 ms 3576 KiB
02_random_23.txt AC 1 ms 3420 KiB
02_random_24.txt AC 1 ms 3464 KiB
02_random_25.txt AC 1 ms 3576 KiB
02_random_26.txt AC 1 ms 3488 KiB
02_random_27.txt AC 1 ms 3392 KiB
02_random_28.txt AC 1 ms 3420 KiB
02_random_29.txt AC 1 ms 3484 KiB
02_random_30.txt AC 1 ms 3488 KiB
02_random_31.txt AC 1 ms 3576 KiB
02_random_32.txt AC 1 ms 3608 KiB
02_random_33.txt AC 1 ms 3432 KiB
02_random_34.txt AC 1 ms 3420 KiB
02_random_35.txt AC 1 ms 3464 KiB
02_random_36.txt AC 1 ms 3496 KiB
02_random_37.txt AC 1 ms 3420 KiB
02_random_38.txt AC 1 ms 3464 KiB
02_random_39.txt AC 1 ms 3484 KiB
02_random_40.txt AC 1 ms 3488 KiB
02_random_41.txt AC 1 ms 3468 KiB
02_random_42.txt AC 1 ms 3484 KiB
02_random_43.txt AC 1 ms 3432 KiB
02_random_44.txt AC 1 ms 3396 KiB
02_random_45.txt AC 1 ms 3420 KiB
02_random_46.txt AC 1 ms 3484 KiB
02_random_47.txt AC 1 ms 3604 KiB
02_random_48.txt AC 1 ms 3484 KiB
02_random_49.txt AC 1 ms 3484 KiB
02_random_50.txt AC 1 ms 3420 KiB
02_random_51.txt AC 1 ms 3480 KiB
02_random_52.txt AC 1 ms 3400 KiB
02_random_53.txt AC 1 ms 3396 KiB
02_random_54.txt AC 1 ms 3432 KiB
02_random_55.txt AC 1 ms 3480 KiB
02_random_56.txt AC 1 ms 3364 KiB
02_random_57.txt AC 1 ms 3424 KiB
02_random_58.txt AC 1 ms 3484 KiB
02_random_59.txt AC 1 ms 3540 KiB
02_random_60.txt AC 1 ms 3424 KiB
02_random_61.txt AC 1 ms 3484 KiB
02_random_62.txt AC 1 ms 3604 KiB
02_random_63.txt AC 1 ms 3572 KiB