tco15 algorithm round 2c 解説

56
TopCoder Open 2015 Round 2C in Tokyo AtCoder & 国立情報学研究所 秋葉 拓哉 | [[iwi]]

Upload: takuya-akiba

Post on 10-Aug-2015

1.081 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: TCO15 Algorithm Round 2C 解説

TopCoder Open 2015 Round 2C in TokyoAtCoder & 国立情報学研究所

秋葉拓哉 | [[iwi]]

Page 2: TCO15 Algorithm Round 2C 解説

1. FixPalindrome

2. ManhattanConstruction

3. YetAnotherCardGame

4. LongSeat

5. PopcountRobot

Spectator

R2CParallel

Page 3: TCO15 Algorithm Round 2C 解説

1. FixPalindrome

2. ManhattanConstruction

3. YetAnotherCardGame

4. LongSeat

5. PopcountRobot

[[iwi]]

rng_58

Page 4: TCO15 Algorithm Round 2C 解説

【問題①】

FixPalindrome

Page 5: TCO15 Algorithm Round 2C 解説

COBOL

Page 6: TCO15 Algorithm Round 2C 解説

COBOL

COBOC

Page 7: TCO15 Algorithm Round 2C 解説

COBOL

COBOC

Page 8: TCO15 Algorithm Round 2C 解説

COBOL

COBOC

Page 9: TCO15 Algorithm Round 2C 解説

COBOL COBOC

Page 10: TCO15 Algorithm Round 2C 解説

COBOL COBOC

Page 11: TCO15 Algorithm Round 2C 解説

COBOL COBOC

Page 12: TCO15 Algorithm Round 2C 解説

COBOL

Page 13: TCO15 Algorithm Round 2C 解説

COBOL

Page 14: TCO15 Algorithm Round 2C 解説

COBOC

Page 15: TCO15 Algorithm Round 2C 解説

COBOC

Page 16: TCO15 Algorithm Round 2C 解説

【問題②】

ManhattanConstruction

Page 17: TCO15 Algorithm Round 2C 解説
Page 18: TCO15 Algorithm Round 2C 解説
Page 20: TCO15 Algorithm Round 2C 解説
Page 21: TCO15 Algorithm Round 2C 解説
Page 22: TCO15 Algorithm Round 2C 解説
Page 23: TCO15 Algorithm Round 2C 解説
Page 24: TCO15 Algorithm Round 2C 解説

1 1 1 1

1

1

1

Page 25: TCO15 Algorithm Round 2C 解説

1 1 1 1

1 2

1

1

Page 26: TCO15 Algorithm Round 2C 解説

1 1 1 1

1 2 3

1

1

Page 27: TCO15 Algorithm Round 2C 解説

1 1 1 1

1 2 4

1

1

3

Page 28: TCO15 Algorithm Round 2C 解説

1 1 1 1

1 2 3 4

1 0

1

Page 29: TCO15 Algorithm Round 2C 解説

1 1 1 1

1 2 3 4

1 0 3 3

1 1 4 7

Page 30: TCO15 Algorithm Round 2C 解説

【問題③】

YetAnotherCardGame

Page 31: TCO15 Algorithm Round 2C 解説

①④⑥⑦③

①⑦①⑤⑦

Petr

Snuke

Page 32: TCO15 Algorithm Round 2C 解説

①④⑥⑦③

①⑦①⑤⑦

Petr

Snuke

Page 33: TCO15 Algorithm Round 2C 解説

①④⑥⑦③

①⑦①⑤⑦①Petr

Snuke

Page 34: TCO15 Algorithm Round 2C 解説

④⑥⑦③

①⑦①⑤⑦①Petr

Snuke

Page 35: TCO15 Algorithm Round 2C 解説

④⑥⑦③

①⑦①⑤⑦①Petr

Snuke

Page 36: TCO15 Algorithm Round 2C 解説

④⑥⑦③

①⑦①⑤⑦①Petr

Snuke

Page 37: TCO15 Algorithm Round 2C 解説

④⑥⑦③

⑦①⑤⑦①Petr

Snuke

Page 38: TCO15 Algorithm Round 2C 解説

④⑥⑦③

⑦①⑤⑦①Petr

Snuke

Page 39: TCO15 Algorithm Round 2C 解説

④⑥⑦

⑦①⑤⑦

③Petr

Snuke

Page 40: TCO15 Algorithm Round 2C 解説

④⑥⑦

⑦①⑤⑦

③Petr

Snuke

Page 41: TCO15 Algorithm Round 2C 解説

④⑥⑦③

⑦①⑤⑦①Petr

Snuke

出しても食べてもカードは 1 枚減る

Page 42: TCO15 Algorithm Round 2C 解説

④⑥⑦③

⑦①⑤⑦①Petr

Snuke

Page 43: TCO15 Algorithm Round 2C 解説

④⑥⑦③

⑦①⑤⑦①Petr

Snuke

1枚ずつ減る

1枚ずつ減る

Page 44: TCO15 Algorithm Round 2C 解説

④⑥⑦③

①⑦①⑤⑦①Petr

Snuke ?

Page 45: TCO15 Algorithm Round 2C 解説

④⑥⑦③

①⑦①⑤⑦①Petr

Snuke ?

Page 46: TCO15 Algorithm Round 2C 解説

①⑦①

①③④⑤⑥

⑦Petr

Snuke

Page 47: TCO15 Algorithm Round 2C 解説

①⑦①

①③④⑤⑥

⑦Petr

Snuke

Page 48: TCO15 Algorithm Round 2C 解説

①⑦①

①③④⑤⑥

⑦Petr

Snuke

Page 49: TCO15 Algorithm Round 2C 解説
Page 50: TCO15 Algorithm Round 2C 解説
Page 51: TCO15 Algorithm Round 2C 解説
Page 52: TCO15 Algorithm Round 2C 解説
Page 53: TCO15 Algorithm Round 2C 解説
Page 54: TCO15 Algorithm Round 2C 解説
Page 55: TCO15 Algorithm Round 2C 解説
Page 56: TCO15 Algorithm Round 2C 解説