Submission #36104941


Source Code Expand

#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<map>
#include<vector>
#define ll long long
#define ull unsigned long long
#define mem(x,y) memset(x,y,sizeof(x))
//#define int long long

inline ll read()
{
	ll x=0,f=1;char ch=getchar();
	while (ch<'0'||ch>'9'){if (ch=='-') f=-1;ch=getchar();}
	while (ch>='0'&&ch<='9'){x=x*10+ch-48;ch=getchar();}
	return x*f;
}

using namespace std;
const int maxm=2e5+5,inf=0x3f3f3f3f,mod=998244353;

void solve(){
	ll a,b,c,d,e,f,ans;
	cin>>a>>b>>c>>d>>e>>f;
	a%=mod;
	b%=mod;
	c%=mod;
	d%=mod;
	e%=mod;
	f%=mod;
	ll x,y;
	x=((a*b)%mod*c)%mod;
	y=((d*e)%mod*f)%mod;
	while(x<y) x+=mod;
	ans=(x-y)%mod;
	cout<<ans%mod<<endl;
	return ;
}

signed main(){
//	ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	int _=1;
//	cin>>_;
	while(_--){
		solve();
	}
	return 0;
}

Submission Info

Submission Time
Task B - ABC-DEF
User qiansui
Language C++ (GCC 9.2.1)
Score 200
Code Size 921 Byte
Status AC
Exec Time 6 ms
Memory 3608 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 6 ms 3536 KiB
example_01.txt AC 2 ms 3512 KiB
example_02.txt AC 3 ms 3608 KiB
hand_00.txt AC 2 ms 3604 KiB
hand_01.txt AC 2 ms 3564 KiB
hand_02.txt AC 2 ms 3436 KiB
hand_03.txt AC 2 ms 3428 KiB
hand_04.txt AC 3 ms 3504 KiB
hand_05.txt AC 2 ms 3504 KiB
hand_06.txt AC 3 ms 3372 KiB
hand_07.txt AC 2 ms 3608 KiB
hand_08.txt AC 2 ms 3604 KiB
hand_09.txt AC 2 ms 3428 KiB
hand_10.txt AC 2 ms 3504 KiB
hand_11.txt AC 2 ms 3400 KiB
hand_12.txt AC 2 ms 3604 KiB
hand_13.txt AC 1 ms 3508 KiB
hand_14.txt AC 2 ms 3540 KiB
random_00.txt AC 2 ms 3540 KiB
random_01.txt AC 2 ms 3536 KiB
random_02.txt AC 2 ms 3580 KiB
random_03.txt AC 2 ms 3432 KiB
random_04.txt AC 2 ms 3556 KiB
random_05.txt AC 2 ms 3560 KiB
random_06.txt AC 2 ms 3532 KiB
random_07.txt AC 2 ms 3396 KiB
random_08.txt AC 2 ms 3540 KiB
random_09.txt AC 2 ms 3508 KiB
random_10.txt AC 2 ms 3560 KiB
random_11.txt AC 2 ms 3536 KiB