Submission #65654443
Source Code Expand
#include<bits/stdc++.h>
using namespace std;
const int mod=998244353;
int qpow(int a,int b){
int c=1;
for(;b;b>>=1){
if(b&1)c=1ll*a*c%mod;
a=1ll*a*a%mod;
}
return c;
}
const int N=5e6;
int jc[5001000],ij[5001000];
int C(int a,int b){
return 1ll*jc[a]*ij[b]%mod*ij[a-b]%mod;
}
int main(){
jc[0]=1;
for(int i=1;i<=N;i++)jc[i]=1ll*i*jc[i-1]%mod;
ij[N]=qpow(jc[N],mod-2);
for(int i=N;i;i--)ij[i-1]=1ll*i*ij[i]%mod;
int a,b,c,d;
scanf("%d%d%d%d",&a,&b,&c,&d);
int ans=0;
for(int i=1;i<=c+1;i++){
int t1=C(c+d-i,d-1);
t1=1ll*t1*C(a+i-1+b,b)%mod;
(ans+=t1)%=mod;
}
printf("%d\n",ans);
return 0;
}
Submission Info
Submission Time
2025-05-10 21:15:11+0900
Task
E - Fruit Lineup
User
grass8cow
Language
C++ 20 (gcc 12.2)
Score
475
Code Size
724 Byte
Status
AC
Exec Time
63 ms
Memory
43016 KiB
Compile Error
Main.cpp: In function ‘int main()’:
Main.cpp:23:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
23 | scanf("%d%d%d%d",&a,&b,&c,&d);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
Judge Result
Set Name
Sample
All
Score / Max Score
0 / 0
475 / 475
Status
Set Name
Test Cases
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_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 02_max_00.txt, 02_max_01.txt, 02_max_02.txt, 02_max_03.txt
Case Name
Status
Exec Time
Memory
00_sample_00.txt
AC
57 ms
42768 KiB
00_sample_01.txt
AC
57 ms
42888 KiB
00_sample_02.txt
AC
60 ms
42944 KiB
01_random_00.txt
AC
63 ms
42768 KiB
01_random_01.txt
AC
58 ms
42876 KiB
01_random_02.txt
AC
59 ms
42816 KiB
01_random_03.txt
AC
58 ms
42728 KiB
01_random_04.txt
AC
62 ms
42764 KiB
01_random_05.txt
AC
61 ms
42880 KiB
01_random_06.txt
AC
59 ms
42832 KiB
01_random_07.txt
AC
58 ms
42944 KiB
01_random_08.txt
AC
58 ms
43016 KiB
01_random_09.txt
AC
58 ms
42780 KiB
02_max_00.txt
AC
63 ms
42944 KiB
02_max_01.txt
AC
63 ms
42792 KiB
02_max_02.txt
AC
63 ms
42744 KiB
02_max_03.txt
AC
63 ms
42876 KiB