Submission #36057913


Source Code Expand

#include <bits/stdc++.h>
using namespace std;

int main() {
    long long a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;

    long long aa = a % 998244353;
    long long ba = b % 998244353;
    long long ca = c % 998244353;
    long long da = d % 998244353;
    long long ea = e % 998244353;
    long long fa = f % 998244353;

    long long aa_ba = aa * ba;
    long long aa_ba_a = aa_ba % 998244353;
    long long aa_ba_a_ca = aa_ba_a * ca;
    long long p = aa_ba_a_ca % 998244353;

    long long da_ea = da * ea;
    long long da_ea_a = da_ea % 998244353;
    long long da_ea_a_fa = da_ea_a * fa;
    long long q = da_ea_a_fa % 998244353;

    long long ans;
    if (p >= q) ans = p - q;
    else ans = p - q + 998244353;

    cout << ans << endl;
}

Submission Info

Submission Time
Task B - ABC-DEF
User Awes
Language C++ (GCC 9.2.1)
Score 200
Code Size 791 Byte
Status AC
Exec Time 8 ms
Memory 3632 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 30
Set Name Test Cases
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, hand_12.txt, hand_13.txt, hand_14.txt, random_00.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
Case Name Status Exec Time Memory
example_00.txt AC 8 ms 3564 KiB
example_01.txt AC 2 ms 3604 KiB
example_02.txt AC 3 ms 3588 KiB
hand_00.txt AC 2 ms 3628 KiB
hand_01.txt AC 2 ms 3592 KiB
hand_02.txt AC 4 ms 3432 KiB
hand_03.txt AC 2 ms 3448 KiB
hand_04.txt AC 2 ms 3520 KiB
hand_05.txt AC 2 ms 3384 KiB
hand_06.txt AC 2 ms 3588 KiB
hand_07.txt AC 2 ms 3520 KiB
hand_08.txt AC 2 ms 3516 KiB
hand_09.txt AC 2 ms 3584 KiB
hand_10.txt AC 2 ms 3564 KiB
hand_11.txt AC 2 ms 3436 KiB
hand_12.txt AC 3 ms 3620 KiB
hand_13.txt AC 2 ms 3592 KiB
hand_14.txt AC 3 ms 3520 KiB
random_00.txt AC 2 ms 3540 KiB
random_01.txt AC 2 ms 3560 KiB
random_02.txt AC 3 ms 3440 KiB
random_03.txt AC 2 ms 3592 KiB
random_04.txt AC 2 ms 3616 KiB
random_05.txt AC 3 ms 3444 KiB
random_06.txt AC 3 ms 3432 KiB
random_07.txt AC 3 ms 3564 KiB
random_08.txt AC 3 ms 3632 KiB
random_09.txt AC 2 ms 3560 KiB
random_10.txt AC 3 ms 3616 KiB
random_11.txt AC 2 ms 3560 KiB