QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#81726#5574. Julienne the DeckCrysflyAC ✓2ms3552kbC++172.5kb2023-02-26 10:04:362023-02-26 10:06:16

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-26 10:06:16]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3552kb
  • [2023-02-26 10:04:36]
  • 提交

answer

// what is matter? never mind.
#include<bits/stdc++.h>
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b) for(int i=(a);i>=(b);--i)
#define int long long
using namespace std;
inline int read()
{
	char c=getchar();int x=0;bool f=0;
	for(;!isdigit(c);c=getchar())f^=!(c^45);
	for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+(c^48);
	if(f)x=-x;return x;
}

#define mod 998244353
struct modint{
	int x;
	modint(int o=0){x=o;}
	modint &operator = (int o){return x=o,*this;}
	modint &operator +=(modint o){return x=x+o.x>=mod?x+o.x-mod:x+o.x,*this;}
	modint &operator -=(modint o){return x=x-o.x<0?x-o.x+mod:x-o.x,*this;}
	modint &operator *=(modint o){return x=1ll*x*o.x%mod,*this;}
	modint &operator ^=(int b){
		modint a=*this,c=1;
		for(;b;b>>=1,a*=a)if(b&1)c*=a;
		return x=c.x,*this;
	}
	modint &operator /=(modint o){return *this *=o^=mod-2;}
	friend modint operator +(modint a,modint b){return a+=b;}
	friend modint operator -(modint a,modint b){return a-=b;}
	friend modint operator *(modint a,modint b){return a*=b;}
	friend modint operator /(modint a,modint b){return a/=b;}
	friend modint operator ^(modint a,int b){return a^=b;}
	friend bool operator ==(modint a,int b){return a.x==b;}
	friend bool operator !=(modint a,int b){return a.x!=b;}
	bool operator ! () {return !x;}
	modint operator - () {return x?mod-x:0;}
	bool operator <(const modint&b)const{return x<b.x;}
};
inline modint qpow(modint x,int y){return x^y;}

vector<modint> fac,ifac,iv;
inline void initC(int n)
{
	if(iv.empty())fac=ifac=iv=vector<modint>(2,1);
	int m=iv.size(); ++n;
	if(m>=n)return;
	iv.resize(n),fac.resize(n),ifac.resize(n);
	For(i,m,n-1){
		iv[i]=iv[mod%i]*(mod-mod/i);
		fac[i]=fac[i-1]*i,ifac[i]=ifac[i-1]*iv[i];
	}
}
inline modint C(int n,int m){
	if(m<0||n<m)return 0;
	return initC(n),fac[n]*ifac[m]*ifac[n-m];
}
inline modint sign(int n){return (n&1)?(mod-1):(1);}

#define fi first
#define se second
#define pb push_back
#define mkp make_pair
typedef pair<int,int>pii;
typedef vector<int>vi;

#define maxn 2000005
#define inf 0x3f3f3f3f



signed main()
{
	int n=read();
	if(n>2)cout<<(n*2%mod);
	else puts("1");
//	vi p(n);
//	iota(p.begin(),p.end(),1);
//	set<vi>s;
//	s.insert(p);
//	queue<vi>q;
//	q.push(p);
//	while(q.size()){
//		auto it=q.front();q.pop();
//		For(i,1,n-1){
//			auto o=it;
//			reverse(o.begin(),o.begin()+i);
//			reverse(o.begin()+i,o.end());
//			if(!s.count(o))s.insert(o),q.push(o);
//		}
//	} 
//	cout<<s.size();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3376kb

input:

1

output:

1

result:

ok 1 number(s): "1"

Test #2:

score: 0
Accepted
time: 1ms
memory: 3548kb

input:

1000000000000

output:

516560941

result:

ok 1 number(s): "516560941"

Test #3:

score: 0
Accepted
time: 0ms
memory: 3384kb

input:

3

output:

6

result:

ok 1 number(s): "6"

Test #4:

score: 0
Accepted
time: 0ms
memory: 3320kb

input:

4

output:

8

result:

ok 1 number(s): "8"

Test #5:

score: 0
Accepted
time: 2ms
memory: 3260kb

input:

2

output:

1

result:

ok 1 number(s): "1"

Test #6:

score: 0
Accepted
time: 0ms
memory: 3320kb

input:

5

output:

10

result:

ok 1 number(s): "10"

Test #7:

score: 0
Accepted
time: 1ms
memory: 3392kb

input:

6

output:

12

result:

ok 1 number(s): "12"

Test #8:

score: 0
Accepted
time: 1ms
memory: 3388kb

input:

7

output:

14

result:

ok 1 number(s): "14"

Test #9:

score: 0
Accepted
time: 2ms
memory: 3516kb

input:

8

output:

16

result:

ok 1 number(s): "16"

Test #10:

score: 0
Accepted
time: 2ms
memory: 3312kb

input:

9

output:

18

result:

ok 1 number(s): "18"

Test #11:

score: 0
Accepted
time: 1ms
memory: 3248kb

input:

10

output:

20

result:

ok 1 number(s): "20"

Test #12:

score: 0
Accepted
time: 0ms
memory: 3360kb

input:

11

output:

22

result:

ok 1 number(s): "22"

Test #13:

score: 0
Accepted
time: 1ms
memory: 3404kb

input:

12

output:

24

result:

ok 1 number(s): "24"

Test #14:

score: 0
Accepted
time: 2ms
memory: 3484kb

input:

13

output:

26

result:

ok 1 number(s): "26"

Test #15:

score: 0
Accepted
time: 1ms
memory: 3320kb

input:

14

output:

28

result:

ok 1 number(s): "28"

Test #16:

score: 0
Accepted
time: 0ms
memory: 3256kb

input:

15

output:

30

result:

ok 1 number(s): "30"

Test #17:

score: 0
Accepted
time: 2ms
memory: 3320kb

input:

16

output:

32

result:

ok 1 number(s): "32"

Test #18:

score: 0
Accepted
time: 0ms
memory: 3388kb

input:

17

output:

34

result:

ok 1 number(s): "34"

Test #19:

score: 0
Accepted
time: 2ms
memory: 3384kb

input:

18

output:

36

result:

ok 1 number(s): "36"

Test #20:

score: 0
Accepted
time: 2ms
memory: 3364kb

input:

19

output:

38

result:

ok 1 number(s): "38"

Test #21:

score: 0
Accepted
time: 0ms
memory: 3356kb

input:

20

output:

40

result:

ok 1 number(s): "40"

Test #22:

score: 0
Accepted
time: 0ms
memory: 3480kb

input:

999999999950

output:

516560841

result:

ok 1 number(s): "516560841"

Test #23:

score: 0
Accepted
time: 2ms
memory: 3316kb

input:

999999999951

output:

516560843

result:

ok 1 number(s): "516560843"

Test #24:

score: 0
Accepted
time: 2ms
memory: 3376kb

input:

999999999952

output:

516560845

result:

ok 1 number(s): "516560845"

Test #25:

score: 0
Accepted
time: 2ms
memory: 3516kb

input:

999999999953

output:

516560847

result:

ok 1 number(s): "516560847"

Test #26:

score: 0
Accepted
time: 2ms
memory: 3544kb

input:

999999999954

output:

516560849

result:

ok 1 number(s): "516560849"

Test #27:

score: 0
Accepted
time: 1ms
memory: 3428kb

input:

999999999955

output:

516560851

result:

ok 1 number(s): "516560851"

Test #28:

score: 0
Accepted
time: 1ms
memory: 3464kb

input:

999999999956

output:

516560853

result:

ok 1 number(s): "516560853"

Test #29:

score: 0
Accepted
time: 0ms
memory: 3400kb

input:

999999999957

output:

516560855

result:

ok 1 number(s): "516560855"

Test #30:

score: 0
Accepted
time: 2ms
memory: 3320kb

input:

999999999958

output:

516560857

result:

ok 1 number(s): "516560857"

Test #31:

score: 0
Accepted
time: 1ms
memory: 3484kb

input:

999999999959

output:

516560859

result:

ok 1 number(s): "516560859"

Test #32:

score: 0
Accepted
time: 2ms
memory: 3520kb

input:

999999999960

output:

516560861

result:

ok 1 number(s): "516560861"

Test #33:

score: 0
Accepted
time: 2ms
memory: 3548kb

input:

999999999961

output:

516560863

result:

ok 1 number(s): "516560863"

Test #34:

score: 0
Accepted
time: 2ms
memory: 3320kb

input:

999999999962

output:

516560865

result:

ok 1 number(s): "516560865"

Test #35:

score: 0
Accepted
time: 2ms
memory: 3360kb

input:

999999999963

output:

516560867

result:

ok 1 number(s): "516560867"

Test #36:

score: 0
Accepted
time: 0ms
memory: 3372kb

input:

999999999964

output:

516560869

result:

ok 1 number(s): "516560869"

Test #37:

score: 0
Accepted
time: 2ms
memory: 3320kb

input:

999999999965

output:

516560871

result:

ok 1 number(s): "516560871"

Test #38:

score: 0
Accepted
time: 2ms
memory: 3364kb

input:

999999999966

output:

516560873

result:

ok 1 number(s): "516560873"

Test #39:

score: 0
Accepted
time: 0ms
memory: 3488kb

input:

999999999967

output:

516560875

result:

ok 1 number(s): "516560875"

Test #40:

score: 0
Accepted
time: 1ms
memory: 3360kb

input:

999999999968

output:

516560877

result:

ok 1 number(s): "516560877"

Test #41:

score: 0
Accepted
time: 1ms
memory: 3320kb

input:

999999999969

output:

516560879

result:

ok 1 number(s): "516560879"

Test #42:

score: 0
Accepted
time: 0ms
memory: 3396kb

input:

999999999970

output:

516560881

result:

ok 1 number(s): "516560881"

Test #43:

score: 0
Accepted
time: 1ms
memory: 3400kb

input:

999999999971

output:

516560883

result:

ok 1 number(s): "516560883"

Test #44:

score: 0
Accepted
time: 2ms
memory: 3364kb

input:

999999999972

output:

516560885

result:

ok 1 number(s): "516560885"

Test #45:

score: 0
Accepted
time: 2ms
memory: 3396kb

input:

999999999973

output:

516560887

result:

ok 1 number(s): "516560887"

Test #46:

score: 0
Accepted
time: 2ms
memory: 3312kb

input:

999999999974

output:

516560889

result:

ok 1 number(s): "516560889"

Test #47:

score: 0
Accepted
time: 2ms
memory: 3344kb

input:

999999999975

output:

516560891

result:

ok 1 number(s): "516560891"

Test #48:

score: 0
Accepted
time: 2ms
memory: 3488kb

input:

999999999976

output:

516560893

result:

ok 1 number(s): "516560893"

Test #49:

score: 0
Accepted
time: 2ms
memory: 3316kb

input:

999999999977

output:

516560895

result:

ok 1 number(s): "516560895"

Test #50:

score: 0
Accepted
time: 1ms
memory: 3308kb

input:

999999999978

output:

516560897

result:

ok 1 number(s): "516560897"

Test #51:

score: 0
Accepted
time: 2ms
memory: 3484kb

input:

999999999979

output:

516560899

result:

ok 1 number(s): "516560899"

Test #52:

score: 0
Accepted
time: 1ms
memory: 3316kb

input:

999999999980

output:

516560901

result:

ok 1 number(s): "516560901"

Test #53:

score: 0
Accepted
time: 0ms
memory: 3316kb

input:

999999999981

output:

516560903

result:

ok 1 number(s): "516560903"

Test #54:

score: 0
Accepted
time: 2ms
memory: 3396kb

input:

999999999982

output:

516560905

result:

ok 1 number(s): "516560905"

Test #55:

score: 0
Accepted
time: 2ms
memory: 3300kb

input:

999999999983

output:

516560907

result:

ok 1 number(s): "516560907"

Test #56:

score: 0
Accepted
time: 0ms
memory: 3488kb

input:

999999999984

output:

516560909

result:

ok 1 number(s): "516560909"

Test #57:

score: 0
Accepted
time: 2ms
memory: 3316kb

input:

999999999985

output:

516560911

result:

ok 1 number(s): "516560911"

Test #58:

score: 0
Accepted
time: 2ms
memory: 3360kb

input:

999999999986

output:

516560913

result:

ok 1 number(s): "516560913"

Test #59:

score: 0
Accepted
time: 0ms
memory: 3324kb

input:

999999999987

output:

516560915

result:

ok 1 number(s): "516560915"

Test #60:

score: 0
Accepted
time: 2ms
memory: 3376kb

input:

999999999988

output:

516560917

result:

ok 1 number(s): "516560917"

Test #61:

score: 0
Accepted
time: 2ms
memory: 3424kb

input:

999999999989

output:

516560919

result:

ok 1 number(s): "516560919"

Test #62:

score: 0
Accepted
time: 2ms
memory: 3316kb

input:

999999999990

output:

516560921

result:

ok 1 number(s): "516560921"

Test #63:

score: 0
Accepted
time: 0ms
memory: 3544kb

input:

999999999991

output:

516560923

result:

ok 1 number(s): "516560923"

Test #64:

score: 0
Accepted
time: 2ms
memory: 3484kb

input:

999999999992

output:

516560925

result:

ok 1 number(s): "516560925"

Test #65:

score: 0
Accepted
time: 2ms
memory: 3548kb

input:

999999999993

output:

516560927

result:

ok 1 number(s): "516560927"

Test #66:

score: 0
Accepted
time: 1ms
memory: 3360kb

input:

999999999994

output:

516560929

result:

ok 1 number(s): "516560929"

Test #67:

score: 0
Accepted
time: 2ms
memory: 3396kb

input:

999999999995

output:

516560931

result:

ok 1 number(s): "516560931"

Test #68:

score: 0
Accepted
time: 0ms
memory: 3252kb

input:

999999999996

output:

516560933

result:

ok 1 number(s): "516560933"

Test #69:

score: 0
Accepted
time: 2ms
memory: 3320kb

input:

999999999997

output:

516560935

result:

ok 1 number(s): "516560935"

Test #70:

score: 0
Accepted
time: 0ms
memory: 3420kb

input:

999999999998

output:

516560937

result:

ok 1 number(s): "516560937"

Test #71:

score: 0
Accepted
time: 2ms
memory: 3388kb

input:

999999999999

output:

516560939

result:

ok 1 number(s): "516560939"

Test #72:

score: 0
Accepted
time: 1ms
memory: 3396kb

input:

426789517863

output:

80113911

result:

ok 1 number(s): "80113911"

Test #73:

score: 0
Accepted
time: 0ms
memory: 3360kb

input:

863617123873

output:

271517056

result:

ok 1 number(s): "271517056"

Test #74:

score: 0
Accepted
time: 2ms
memory: 3260kb

input:

300438990906

output:

933125659

result:

ok 1 number(s): "933125659"

Test #75:

score: 0
Accepted
time: 2ms
memory: 3356kb

input:

741550086256

output:

707308307

result:

ok 1 number(s): "707308307"

Test #76:

score: 0
Accepted
time: 2ms
memory: 3512kb

input:

215252144633

output:

260973123

result:

ok 1 number(s): "260973123"

Test #77:

score: 0
Accepted
time: 0ms
memory: 3396kb

input:

652066018104

output:

424911190

result:

ok 1 number(s): "424911190"

Test #78:

score: 0
Accepted
time: 0ms
memory: 3396kb

input:

88874152603

output:

60810372

result:

ok 1 number(s): "60810372"

Test #79:

score: 0
Accepted
time: 1ms
memory: 3548kb

input:

566890854827

output:

774368999

result:

ok 1 number(s): "774368999"

Test #80:

score: 0
Accepted
time: 2ms
memory: 3488kb

input:

3696734746

output:

405759021

result:

ok 1 number(s): "405759021"

Test #81:

score: 0
Accepted
time: 2ms
memory: 3404kb

input:

526368807958

output:

588067854

result:

ok 1 number(s): "588067854"

Test #82:

score: 0
Accepted
time: 2ms
memory: 3552kb

input:

110521428

output:

221042856

result:

ok 1 number(s): "221042856"

Test #83:

score: 0
Accepted
time: 2ms
memory: 3364kb

input:

441203677050

output:

957590401

result:

ok 1 number(s): "957590401"

Test #84:

score: 0
Accepted
time: 2ms
memory: 3400kb

input:

877996126398

output:

80435869

result:

ok 1 number(s): "80435869"

Test #85:

score: 0
Accepted
time: 2ms
memory: 3372kb

input:

351757516426

output:

751008340

result:

ok 1 number(s): "751008340"

Test #86:

score: 0
Accepted
time: 2ms
memory: 3360kb

input:

788547711191

output:

867588995

result:

ok 1 number(s): "867588995"

Test #87:

score: 0
Accepted
time: 2ms
memory: 3320kb

input:

225332166993

output:

456130783

result:

ok 1 number(s): "456130783"

Test #88:

score: 0
Accepted
time: 2ms
memory: 3548kb

input:

666405851100

output:

155490945

result:

ok 1 number(s): "155490945"

Test #89:

score: 0
Accepted
time: 0ms
memory: 3544kb

input:

140190402081

output:

872385322

result:

ok 1 number(s): "872385322"

Test #90:

score: 0
Accepted
time: 0ms
memory: 3400kb

input:

576966864308

output:

961500901

result:

ok 1 number(s): "961500901"

Test #91:

score: 0
Accepted
time: 2ms
memory: 3320kb

input:

641038605112

output:

331460972

result:

ok 1 number(s): "331460972"

Test #92:

score: 0
Accepted
time: 0ms
memory: 3312kb

input:

114842730137

output:

89259084

result:

ok 1 number(s): "89259084"

Test #93:

score: 0
Accepted
time: 2ms
memory: 3548kb

input:

551611096290

output:

162182515

result:

ok 1 number(s): "162182515"

Test #94:

score: 0
Accepted
time: 2ms
memory: 3316kb

input:

988373723464

output:

223627988

result:

ok 1 number(s): "223627988"

Test #95:

score: 0
Accepted
time: 0ms
memory: 3392kb

input:

462197525047

output:

20779216

result:

ok 1 number(s): "20779216"

Test #96:

score: 0
Accepted
time: 2ms
memory: 3260kb

input:

903252864935

output:

681695293

result:

ok 1 number(s): "681695293"

Test #97:

score: 0
Accepted
time: 2ms
memory: 3544kb

input:

344302465869

output:

814572521

result:

ok 1 number(s): "814572521"

Test #98:

score: 0
Accepted
time: 2ms
memory: 3356kb

input:

818145943985

output:

169393403

result:

ok 1 number(s): "169393403"

Test #99:

score: 0
Accepted
time: 1ms
memory: 3552kb

input:

254898323042

output:

692026054

result:

ok 1 number(s): "692026054"

Test #100:

score: 0
Accepted
time: 2ms
memory: 3396kb

input:

691644963096

output:

721497287

result:

ok 1 number(s): "721497287"

Test #101:

score: 0
Accepted
time: 2ms
memory: 3400kb

input:

792808110182

output:

404187800

result:

ok 1 number(s): "404187800"

Test #102:

score: 0
Accepted
time: 2ms
memory: 3516kb

input:

229552393167

output:

910628307

result:

ok 1 number(s): "910628307"

Test #103:

score: 0
Accepted
time: 2ms
memory: 3320kb

input:

666290937145

output:

923907388

result:

ok 1 number(s): "923907388"

Test #104:

score: 0
Accepted
time: 0ms
memory: 3388kb

input:

103023742178

output:

409147638

result:

ok 1 number(s): "409147638"

Test #105:

score: 0
Accepted
time: 2ms
memory: 3552kb

input:

576909955285

output:

847682855

result:

ok 1 number(s): "847682855"

Test #106:

score: 0
Accepted
time: 2ms
memory: 3320kb

input:

17935473032

output:

932393709

result:

ok 1 number(s): "932393709"

Test #107:

score: 0
Accepted
time: 1ms
memory: 3396kb

input:

454660284472

output:

918207714

result:

ok 1 number(s): "918207714"

Test #108:

score: 0
Accepted
time: 2ms
memory: 3360kb

input:

928566174135

output:

397851690

result:

ok 1 number(s): "397851690"

Test #109:

score: 0
Accepted
time: 0ms
memory: 3320kb

input:

369583698324

output:

466575428

result:

ok 1 number(s): "466575428"

Test #110:

score: 0
Accepted
time: 2ms
memory: 3372kb

input:

806300516203

output:

436402311

result:

ok 1 number(s): "436402311"

Test #111:

score: 0
Accepted
time: 2ms
memory: 3360kb

input:

903230082399

output:

636130221

result:

ok 1 number(s): "636130221"