{"type":"rich","categories":["TopCoder","XOR","SRMDIV1Easy","DP","\u30b7\u30fc\u30b1\u30f3\u30b7\u30e3\u30ebDP","DP\u5024\u3092\u5229\u7528\u3057\u3066\u72b6\u614b\u5fa9\u5143"],"image_url":"https://cdn.user.blog.st-hatena.com/default_entry_og_image/80936665/1687765056723440","provider_url":"https://hatena.blog","author_url":"https://blog.hatena.ne.jp/drken1215/","url":"https://drken1215.hatenablog.com/entry/20160710/1468114487","provider_name":"Hatena Blog","version":"1.0","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdrken1215.hatenablog.com%2Fentry%2F20160710%2F1468114487\" title=\"TopCoder SRM 694 DIV1 Easy - TryShell - \u3051\u3093\u3061\u3087\u3093\u306e\u7af6\u30d7\u30ed\u7cbe\u9032\u8a18\u9332\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_url":"https://drken1215.hatenablog.com/","width":"100%","author_name":"drken1215","description":"\u3044\u3044\u554f\u984c\u3060\u3063\u305f\u3002 \u554f\u984c\u6982\u8981 0 \u4ee5\u4e0a 255 \u4ee5\u4e0b\u306e\u6574\u6570\u304c n \u500b\u4e0e\u3048\u3089\u308c\u308b\u3002 \u3053\u306e n \u500b\u306e\u6574\u6570\u3092 3 \u7d44\u306b\u5206\u3051\u308b\u65b9\u6cd5\u306e\u3046\u3061\u3001\u5404\u7d44\u306e xor \u548c\u306e\u7dcf\u548c\u304c\u6700\u5927\u3068\u306a\u308b\u3082\u306e\u3092\u6c42\u3081\u3088\u3002(\u5236\u7d04) \u30fb3 \u89e3\u6cd5 dp[ i+1 ][ j ][ k ] := i \u756a\u76ee\u307e\u3067\u307f\u305f\u3068\u304d\u3001\u4e8c\u7d44\u306e\u548c\u304c\u305d\u308c\u305e\u308c j, k \u306e\u3068\u304d\u306e\u6b8b\u308a\u306e\u4e00\u7d44\u306e\u5024\u306e\u3068\u308a\u3046\u308b\u6700\u5927\u5024 \u3068\u3057\u3066\u89e3\u3044\u305f\u3002 \u3053\u308c\u306a\u3089\u3001\u4ee5\u4e0b\u306b\u793a\u3059 xor \u7279\u6709\u306e\u69cb\u9020\u306b\u6c17\u3065\u304b\u306a\u304f\u3066\u3082\u89e3\u3051\u308b\u3002\u3067\u3082\u3001\u4e09\u7d44\u306e xor \u548c\u3092\u305d\u308c\u305e\u308c a, b, c \u3068\u3057\u3001 n \u500b\u5168\u90e8\u306e\u6574\u6570\u306e xor \u3092 sum \u3068\u3057\u305f\u3068\u304d\u3001 a ^ b ^ c = sum \u306a\u306e\u3067\u3001 (a ^ b) ^ a ^\u2026","blog_title":"\u3051\u3093\u3061\u3087\u3093\u306e\u7af6\u30d7\u30ed\u7cbe\u9032\u8a18\u9332","height":"190","title":"TopCoder SRM 694 DIV1 Easy - TryShell","published":"2002-07-01 11:34:00"}