AtCoder Regular Contest 038
解説
AtCoder株式会社
2015/5/2 1
i eo i d[
i ]u d e
r
+ n
0 81
G e
3
s 5 h 5 uc
d h ] ac
a h u i ye
eo i y [ Re e
i y rh
C C
N N
d ~∼ i uk
ac iR uc ioiA
h [c
         n
d s
c R rk i ~∼d[ R
r
+ n
0 81
0, (
g
6
-‐‑‒
B1k uC d k j
C y k j WC j
C d d d k ^ k
k C j y g W
y c k
g kh d
H H
O 1 O
 
O 1 O
ge
 
y
6    g
g y ksRj g j un
judge(i,)j):)#)(i,j)に駒がある状態から開始したときの勝敗)
))if)(i,j))が盤外)or)障害物:)return)勝ち)
))if)judge(i+1,j))==)負け:)return)勝ち)
))if)judge(i+1,j+1))==)負け:)return)勝ち)
))if)judge(i,j+1))==)負け:)return)勝ち)
))return)負け
  0 3
2 k   
k a C
uj oC
k j R
O 1 O
W
j
mem[1000][1000])を「未定」で初期化)
judge(i,)j):)#)(i,j)に駒がある状態から開始したときの勝敗)
))if)(i,j))が盤外)or)障害物:)return)勝ち)
))if)mem[i][j])!=)未定:)return)mem[i][j])
))result)=)負け)
))if)judge(i+1,j))==)負け:)result)=)勝ち)
))if)judge(i+1,j+1))==)負け:)result)=)勝ち)
))if)judge(i,j+1))==)負け:)result)=)勝ち)
))return)mem[i][j])=)result
0 3
k y 1   g W
1   g uC j R
C d k rR
x
A y o
3 8 4 y d
G G k e sRj n
C j e k xk k C
x g R gj e n
051 1
C
3 ic O 1 i h d
0 i x d
] { O h y { ns dk
h 1 } h
~∼ k xu l
} i yhR
3 8)
0 8,
4   
3
0
d
4   
= C
-‐‑‒
= C
te {O o o
c h { l
= C d
-‐‑‒
i y l
1 2 1 2 4 3
= C 0 0 0 0 0 0 0
[ ] ^ a
-‐‑‒
[ y ic = C
im { du O
-‐‑‒
G [ {O
m = C
1 2 1 2 4 3
= C 0 0 0 0 0 0
[ ] ^ a
y ic = C
h [ s u O
-‐‑‒
G {O
m = C 4
-‐‑‒
1 2 1 2 4 3
= C 4 0 0 0 0 0
[ ] ^ a
] y ic = C
]h [ s u O
-‐‑‒ 4
G ] {O
m = C
-‐‑‒
1 2 1 2 4 3
= C 4 0 0 0 0
[ ] ^ a
^ y ic = C
^h ] s u O
-‐‑‒
G [ {O
m = C
-‐‑‒
1 2 1 2 4 3
= C 4 0 0 0
[ ] ^ a
y ic = C
h ] ^ s u O
-‐‑‒
G {O
m = C 4
-‐‑‒
1 2 1 2 4 3
= C 4 4 0 0
[ ] ^ a
y ic = C
h ] ^ s u O
-‐‑‒ 4
G ^ {O
m = C 6
-‐‑‒
1 2 1 2 4 3
= C 4 4 6 0
[ ] ^ a
a y ic = C
ah ^ s u O
-‐‑‒ 4 6
G ] {O
m = C
-‐‑‒
1 2 1 2 4 3
= C 4 4 6
[ ] ^ a
m e o = C m i{
-‐‑‒
1 2 1 2 4 3
= C 4 4 6
[ ] ^ a
i]y c }e dd{o eh
-‐‑‒
1 2 1 2 4 3
= C 4 4 6
[ ] ^ a
}g dl O
= C m i{
ohoO t e m o k
-‐‑‒
1 2 1 2 4 3
= C 4 4 6
[ ] ^ a
y ic = C 4
^ y ic = C
a y ic = C
m im = C x d
y O4 6im = C {
-‐‑‒
1 2 1 2 4 3
= C 4 4 6
[ ] ^ a
-‐‑‒
= C i od {o ehR
= C i[{ d h O

N r= C i[ {
= C i[ h O

N= C i[ { d
de h Oc = C i
[{ d
[
dem i {
4   
y ic = C
N h 3 { O
yd = C
m i[{ d {O[
4   
y ic = C =
= O
= 1 = d [
ic
[i h i h
~∼ dl 38    { m i{
i h ~∼
G } d m {O 3 A = 3   3   {
4   
= 38    hlu O
~∼ = 38   
uO { 9 0    3    {O
= C 9 0    3  
Om { d
 
3
0 8,
diO d
 
O
~∼ = 38   
{ d{ iO
= C 9 0    3  
{ d s
 
o O
de ic
O {O ,, ,, {
 
= C O
x d
0 ) O
= = = = =
de o d iOm O
= = = O
=
{
m e ]yry ns m
 
y O0 i} e {c e O
0 oh d {
 
= C O
0 i {c e = l {
3   { dm O
m d
3 8)
0 8,
d
l g l {
= x l s
= O
= 1 = d [
{ou
= = A i ~∼ e
de xu =G oyy= dk
yd O u y
m =G { em O

A = 3   { = m i{
3 A = 3   O d
1 O]y {o eh
h
2 C
9 yl
-‐‑‒ () 0
F C
0
3 x a[
B y 89B a r
M X M s r
s
ag M a * hn s
R a hMlx x[ r
a R x
a h ] hM a h
] M R x y d
  -‐‑‒
3
a g
 
R a * s * s y
R a d dr M M

au s h e
] M R y R ss
R x y 9 a[ 9 s M
i ] yM ]
xs a
 
9 R 9 a[ 9 ] ^rM
l m x x
a x yM x x x]o M
a x yM x x x]o
]
S BF s
  3
a R   
a R   
r n M y 3     M
x sy ]
-‐‑‒
3
a
N x o

N x o
] R x s n
a ge g u a o dM
a e u a o d n M
x s as
N x o

N x o
] R yM
r a x d M
r a x d n ^ M
N s x o

N s x o
] R
N s x o

N s x o
] R x s d n
a 9 x[ 9 x ^
x
2
3
1
4
1先
2先
3先
4先
2後
1後
4後
3後
x x
O Rx o
O
O Rx e
h
1先
2先
3先
4先
2後
1後
4後
3後
h ysu^ l
S l u c
1先
2先
3先
4先
2後
1後
4後
3後
M
N a[
N a r
] R l rM
ehr
1先
2先
3先
4先
2後
1後
4後
3後
M
N a[
N a r
] R l rM
ehr
1先
2先
3先
4先
2後
1後
4後
3後
M
N a[
N a r
] R l rM
ehr
1先
2先
3先
4先
2後
1後
4後
3後
M
N a[
N a r
] R l rM
ehr
1先
2先
3先
4先
2後
1後
4後
3後
x R s r n M
x O o
x O e
x O e
S x x y
1先
2先
3先
4先
2後
1後
4後
3後
x y ^ x ] s r
x x as r M
R s k
1先
2先
3先
4先
2後
1後
4後
3後
x sy R a[ xsM
eS R y h ^ a[
n M Ry
x R xsM x R a[
M e R yM
e R hr ] s
h y M 1 ^ l
c u ^ M
c ^ u l
X c u u i^
h y l
n l
x e yx u^ l
3
yM s
3   DG 8    
0 yMX x sh ]
N
N2 F
N AG e

More Related Content

PDF
AtCoder Beginner Contest 025 解説
PPTX
CODE FESTIVAL 2014 本選 解説
PDF
AtCoder Beginner Contest 007 解説
PDF
AtCoder Regular Contest 023 解説
PDF
AtCoder Beginner Contest 011 解説
PDF
AtCoder Beginner Contest 010 解説
PPTX
AtCoder Beginner Contest 012 解説
PDF
AtCoder Beginner Contest 022 解説
AtCoder Beginner Contest 025 解説
CODE FESTIVAL 2014 本選 解説
AtCoder Beginner Contest 007 解説
AtCoder Regular Contest 023 解説
AtCoder Beginner Contest 011 解説
AtCoder Beginner Contest 010 解説
AtCoder Beginner Contest 012 解説
AtCoder Beginner Contest 022 解説

What's hot (20)

PDF
DDPC 2016 予選 解説
PDF
AtCoder Regular Contest 031 解説
PDF
AtCoder Beginner Contest 017 解説
PDF
AtCoder Beginner Contest 013 解説
PDF
AtCoder Beginner Contest 005 解説
PPTX
AtCoder Beginner Contest 014 解説
PPTX
AtCoder Beginner Contest 004 解説
PDF
AtCoder Regular Contest 039 解説
PDF
abc027
PDF
abc031
PDF
AtCoder Beginner Contest 006 解説
PDF
AtCoder Regular Contest 021 解説
PPTX
AtCoder Regular Contest 016 解説
PDF
AtCoder Regular Contest 028 解説
PDF
AtCoder Beginner Contest 028 解説
PDF
abc032
PPTX
AtCoder Beginner Contest 003 解説
PDF
Abc009
PDF
AtCoder Beginner Contest 020 解説
PPTX
AtCoder Regular Contest 002
DDPC 2016 予選 解説
AtCoder Regular Contest 031 解説
AtCoder Beginner Contest 017 解説
AtCoder Beginner Contest 013 解説
AtCoder Beginner Contest 005 解説
AtCoder Beginner Contest 014 解説
AtCoder Beginner Contest 004 解説
AtCoder Regular Contest 039 解説
abc027
abc031
AtCoder Beginner Contest 006 解説
AtCoder Regular Contest 021 解説
AtCoder Regular Contest 016 解説
AtCoder Regular Contest 028 解説
AtCoder Beginner Contest 028 解説
abc032
AtCoder Beginner Contest 003 解説
Abc009
AtCoder Beginner Contest 020 解説
AtCoder Regular Contest 002
Ad

Viewers also liked (8)

PDF
AtCoder Regular Contest 037 解説
PDF
AtCoder Regular Contest 036 解説
PDF
AtCoder Regular Contest 040 解説
PDF
Arc041
PPTX
AtCoder Regular Contest 029 解説
PDF
AtCoder Regular Contest 043 解説
PDF
RUPC2017:全体の講評
PDF
AtCoder Beginner Contest 021 解説
AtCoder Regular Contest 037 解説
AtCoder Regular Contest 036 解説
AtCoder Regular Contest 040 解説
Arc041
AtCoder Regular Contest 029 解説
AtCoder Regular Contest 043 解説
RUPC2017:全体の講評
AtCoder Beginner Contest 021 解説
Ad

Similar to AtCoder Regular Contest 038 解説 (20)

PDF
katagaitai CTF workshop #10 AESに対する相関電力解析
PDF
Solutions manual for digital logic and microprocessor design with interfacing...
PDF
AUTOSAR OS 学習プログラムを始めてみよう
PDF
Methylcloride hess23 (1)
DOCX
Methylcloride hess23
PDF
ICT Letter - season 1 -
PDF
[DL Hacks 実装]Attention is All You Need
PDF
Kubernetes ネットワーキングのすべて
PDF
Prelude to halide_public
PDF
ChineseGardensfdfdfdfdfdfdfsfsdfsdfsdffdf
PDF
Kidsmags
PDF
ΠΛΗ31 ΜΑΘΗΜΑ 1.3 (ΕΚΤΥΠΩΣΗ)
PDF
データ社会を生きる技術 〜人工知能のHopeとHype〜
PDF
Doc1.doc nobel[1]3
PDF
Doc1.doc nobel[1]2
PDF
Doc1.doc nobel[1]1[1]
PDF
20190225 DIY伝送装置
PDF
Radix-3 Algorithm for Realization of Discrete Fourier Transform
PDF
A research paper introduction of Universal transformers
PDF
Solo edo hasta 20
katagaitai CTF workshop #10 AESに対する相関電力解析
Solutions manual for digital logic and microprocessor design with interfacing...
AUTOSAR OS 学習プログラムを始めてみよう
Methylcloride hess23 (1)
Methylcloride hess23
ICT Letter - season 1 -
[DL Hacks 実装]Attention is All You Need
Kubernetes ネットワーキングのすべて
Prelude to halide_public
ChineseGardensfdfdfdfdfdfdfsfsdfsdfsdffdf
Kidsmags
ΠΛΗ31 ΜΑΘΗΜΑ 1.3 (ΕΚΤΥΠΩΣΗ)
データ社会を生きる技術 〜人工知能のHopeとHype〜
Doc1.doc nobel[1]3
Doc1.doc nobel[1]2
Doc1.doc nobel[1]1[1]
20190225 DIY伝送装置
Radix-3 Algorithm for Realization of Discrete Fourier Transform
A research paper introduction of Universal transformers
Solo edo hasta 20

More from AtCoder Inc. (20)

PPTX
TCO2017R1
PPTX
AtCoderに毎回参加したくなる仕組み
PDF
Square869120 contest #2
PDF
AtCoder Beginner Contest 035 解説
PDF
Disco Presents ディスカバリーチャンネルプログラミングコンテスト2016 本選 解説
PDF
Chokudai Contest 001
PDF
AtCoder Regular Contest 049 解説
PPTX
AtCoder Beginner Contest 034 解説
PDF
AtCoder Regular Contest 048
PDF
MUJINプログラミングチャレンジ2016 解説
PDF
AtCoder Beginner Contest 033 解説
PDF
arc047
PDF
CODE FESTIVAL 2015 沖縄ツアー 解説
PDF
AtCoder Regular Contest 046
PDF
CODE FESTIVAL 2015 解説
PDF
CODE FESTIVAL 2015 予選B 解説
PDF
AtCoder Beginner Contest 030 解説
PDF
AtCoder Regular Contest 045 解説
PDF
CODE FESTIVAL 2015 予選A 解説
PDF
AtCoder Beginner Contest 029 解説
TCO2017R1
AtCoderに毎回参加したくなる仕組み
Square869120 contest #2
AtCoder Beginner Contest 035 解説
Disco Presents ディスカバリーチャンネルプログラミングコンテスト2016 本選 解説
Chokudai Contest 001
AtCoder Regular Contest 049 解説
AtCoder Beginner Contest 034 解説
AtCoder Regular Contest 048
MUJINプログラミングチャレンジ2016 解説
AtCoder Beginner Contest 033 解説
arc047
CODE FESTIVAL 2015 沖縄ツアー 解説
AtCoder Regular Contest 046
CODE FESTIVAL 2015 解説
CODE FESTIVAL 2015 予選B 解説
AtCoder Beginner Contest 030 解説
AtCoder Regular Contest 045 解説
CODE FESTIVAL 2015 予選A 解説
AtCoder Beginner Contest 029 解説

Recently uploaded (20)

PPTX
Cite It Right: A Compact Illustration of APA 7th Edition.pptx
PDF
0520_Scheme_of_Work_(for_examination_from_2021).pdf
PDF
Diabetes Mellitus , types , clinical picture, investigation and managment
PDF
Everyday Spelling and Grammar by Kathi Wyldeck
PPTX
pharmaceutics-1unit-1-221214121936-550b56aa.pptx
PPTX
Integrated Management of Neonatal and Childhood Illnesses (IMNCI) – Unit IV |...
PPTX
4. Diagnosis and treatment planning in RPD.pptx
PPTX
Power Point PR B.Inggris 12 Ed. 2019.pptx
PDF
Nurlina - Urban Planner Portfolio (english ver)
PPTX
Diploma pharmaceutics notes..helps diploma students
PPTX
Key-Features-of-the-SHS-Program-v4-Slides (3) PPT2.pptx
PDF
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
PPTX
UNIT_2-__LIPIDS[1].pptx.................
PDF
Journal of Dental Science - UDMY (2022).pdf
PDF
Journal of Dental Science - UDMY (2020).pdf
PPTX
2025 High Blood Pressure Guideline Slide Set.pptx
PDF
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
PDF
Hospital Case Study .architecture design
PDF
Lecture on Viruses: Structure, Classification, Replication, Effects on Cells,...
PPTX
Macbeth play - analysis .pptx english lit
Cite It Right: A Compact Illustration of APA 7th Edition.pptx
0520_Scheme_of_Work_(for_examination_from_2021).pdf
Diabetes Mellitus , types , clinical picture, investigation and managment
Everyday Spelling and Grammar by Kathi Wyldeck
pharmaceutics-1unit-1-221214121936-550b56aa.pptx
Integrated Management of Neonatal and Childhood Illnesses (IMNCI) – Unit IV |...
4. Diagnosis and treatment planning in RPD.pptx
Power Point PR B.Inggris 12 Ed. 2019.pptx
Nurlina - Urban Planner Portfolio (english ver)
Diploma pharmaceutics notes..helps diploma students
Key-Features-of-the-SHS-Program-v4-Slides (3) PPT2.pptx
LIFE & LIVING TRILOGY- PART (1) WHO ARE WE.pdf
UNIT_2-__LIPIDS[1].pptx.................
Journal of Dental Science - UDMY (2022).pdf
Journal of Dental Science - UDMY (2020).pdf
2025 High Blood Pressure Guideline Slide Set.pptx
LIFE & LIVING TRILOGY - PART - (2) THE PURPOSE OF LIFE.pdf
Hospital Case Study .architecture design
Lecture on Viruses: Structure, Classification, Replication, Effects on Cells,...
Macbeth play - analysis .pptx english lit

AtCoder Regular Contest 038 解説