結果
問題 | No.1241 Eternal Tours |
ユーザー | 👑 hos.lyric |
提出日時 | 2020-09-06 00:49:05 |
言語 | Ruby (3.3.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 676 bytes |
コンパイル時間 | 339 ms |
コンパイル使用メモリ | 7,552 KB |
実行使用メモリ | 229,024 KB |
最終ジャッジ日時 | 2024-05-06 23:52:06 |
合計ジャッジ時間 | 8,395 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 76 ms
12,288 KB |
testcase_01 | AC | 74 ms
12,160 KB |
testcase_02 | TLE | - |
testcase_03 | AC | 90 ms
12,544 KB |
testcase_04 | AC | 84 ms
12,160 KB |
testcase_05 | AC | 77 ms
12,288 KB |
testcase_06 | AC | 73 ms
12,032 KB |
testcase_07 | AC | 79 ms
12,160 KB |
testcase_08 | AC | 83 ms
12,288 KB |
testcase_09 | AC | 81 ms
12,288 KB |
testcase_10 | AC | 86 ms
12,288 KB |
testcase_11 | AC | 89 ms
12,544 KB |
testcase_12 | AC | 76 ms
12,288 KB |
testcase_13 | AC | 80 ms
12,160 KB |
testcase_14 | AC | 3,913 ms
94,208 KB |
testcase_15 | AC | 79 ms
12,032 KB |
testcase_16 | AC | 974 ms
33,152 KB |
testcase_17 | TLE | - |
testcase_18 | TLE | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
testcase_38 | -- | - |
testcase_39 | -- | - |
testcase_40 | -- | - |
testcase_41 | -- | - |
testcase_42 | -- | - |
testcase_43 | -- | - |
コンパイルメッセージ
Main.rb:21: warning: `+' after local variable or literal is interpreted as binary operator Main.rb:21: warning: even though it seems like unary operator Main.rb:22: warning: `+' after local variable or literal is interpreted as binary operator Main.rb:22: warning: even though it seems like unary operator Main.rb:23: warning: `+' after local variable or literal is interpreted as binary operator Main.rb:23: warning: even though it seems like unary operator Main.rb:24: warning: `+' after local variable or literal is interpreted as binary operator Main.rb:24: warning: even though it seems like unary operator Main.rb:25: warning: `+' after local variable or literal is interpreted as binary operator Main.rb:25: warning: even though it seems like unary operator Syntax OK
ソースコード
MO=998244353 G=3 $<.map{|line| x,y,t,a,b,c,d=line.split.map &:to_i m=1<<(x+1) n=1<<(y+1) gm=[0]*m gn=[0]*n gm[0]=1 gn[0]=1 gm[1]=G.pow((MO-1)/m,MO) gn[1]=G.pow((MO-1)/n,MO) (2...m).map{|i|gm[i]=(gm[i-1]*gm[1])%MO} (2...n).map{|j|gn[j]=(gn[j-1]*gn[1])%MO} z=0 (0...m).map{|i|(0...n).map{|j| f=(0\ +gm[0]*gn[0]\ +gm[i]*gn[0]\ +gm[0]*gn[j]\ +gm[-i]*gn[0]\ +gm[0]*gn[-j]\ ).pow(t,MO) (0...2).map{|s|(0...2).map{|t| ii=((-1)**s*c-a)&(m-1) jj=((-1)**t*d-b)&(n-1) z+=(-1)**(s+t)*gm[(-i*ii)&(m-1)]*gn[(-j*jj)&(n-1)]*f z%=MO }} }} z*=(m*n).pow(MO-2,MO) z=(z%MO+MO)%MO p z }