Submission #50622337
Source Code Expand
#include <bits/stdc++.h> #include <atcoder/modint> const int MOD=998244353; using mint = atcoder::static_modint<MOD>; using namespace std; typedef long long ll; #define rep(i,a,n) for (ll i=a;i<(ll)(n);i++) ll read(){ll r;scanf("%lld",&r);return r;} mint I[200010]; int main(){ I[1]=1; rep(i,2,200000+1) I[i]=(MOD-MOD/i)*I[MOD%i]; int n=read(); int m=read(); int a=read(); int b=read(); int c=read(); int d=read(); if(a>c) swap(a,c); if(b>d) swap(b,d); int e=c-a+d-b; mint ans=1; for(int u:{a-1,n-c,b-1,m-d})rep(i,1,u+1)ans+=I[i+e]; printf("%d\n",ans.val()); }
Submission Info
Submission Time | |
---|---|
Task | E - Paper Cutting 2 |
User | cromarmot |
Language | C++ 20 (gcc 12.2) |
Score | 700 |
Code Size | 589 Byte |
Status | AC |
Exec Time | 3 ms |
Memory | 4656 KiB |
Compile Error
Main.cpp: In function ‘ll read()’: Main.cpp:8:21: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | ll read(){ll r;scanf("%lld",&r);return r;} | ~~~~~^~~~~~~~~~~
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 700 / 700 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt, s3.txt, s4.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, s1.txt, s2.txt, s3.txt, s4.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 3 ms | 4436 KiB |
02.txt | AC | 3 ms | 4376 KiB |
03.txt | AC | 3 ms | 4544 KiB |
04.txt | AC | 3 ms | 4608 KiB |
05.txt | AC | 3 ms | 4544 KiB |
06.txt | AC | 2 ms | 4520 KiB |
07.txt | AC | 2 ms | 4348 KiB |
08.txt | AC | 3 ms | 4548 KiB |
09.txt | AC | 3 ms | 4472 KiB |
10.txt | AC | 3 ms | 4524 KiB |
11.txt | AC | 3 ms | 4352 KiB |
12.txt | AC | 3 ms | 4444 KiB |
13.txt | AC | 3 ms | 4396 KiB |
14.txt | AC | 3 ms | 4524 KiB |
15.txt | AC | 3 ms | 4344 KiB |
16.txt | AC | 3 ms | 4656 KiB |
17.txt | AC | 2 ms | 4520 KiB |
s1.txt | AC | 2 ms | 4572 KiB |
s2.txt | AC | 3 ms | 4348 KiB |
s3.txt | AC | 3 ms | 4608 KiB |
s4.txt | AC | 2 ms | 4528 KiB |