提出 #73341014
ソースコード 拡げる
\endlinechar=-1\relax
\catcode`\@=11\relax
\countdef\i200
\countdef\j201
\countdef\score202
\countdef\W203
\countdef\nx204
\countdef\ny205
\countdef\idx206
\countdef\val207
\countdef\curV208
\countdef\curO209
\countdef\curL210
\countdef\N211
\countdef\M212
\countdef\T213
\countdef\U214
\countdef\bestX215
\countdef\bestY216
\countdef\bestScore217
\countdef\temp218
\countdef\curX219
\countdef\curY220
\def\toIdx#1#2{\idx=#1\relax\multiply\idx10\relax\advance\idx#2\relax}
\def\setV#1#2#3{\toIdx{#1}{#2}\global\count\idx#3\relax}
\def\getV#1#2{\toIdx{#1}{#2}\val\count\idx}
\def\getO#1#2{\toIdx{#1}{#2}\advance\idx100\relax\val\count\idx\relax\divide\val16\relax\advance\val-1\relax}
\def\getL#1#2{\toIdx{#1}{#2}\advance\idx100\relax\val\count\idx\relax\temp\count\idx\relax\divide\temp16\relax%
\multiply\temp16\relax\advance\val-\temp\relax\ifnum\val<0\relax\advance\val16\relax\fi}
\def\setO#1#2#3{\toIdx{#1}{#2}\advance\idx100\relax\getL{#1}{#2}\temp#3\relax\multiply\temp16\relax\advance\temp\val%
\global\count\idx\temp\relax}
\def\setL#1#2#3{\toIdx{#1}{#2}\advance\idx100\relax\getL{#1}{#2}\advance\count\idx-\val\relax\global\advance\count\idx#3\relax}
\def\getScore#1#2{%
\getV{#1}{#2}
\curV\val
\getO{#1}{#2}
\curO\val
\getL{#1}{#2}
\curL\val
\W0\relax
\ifnum\curO=-1\relax
\W=100\relax
\else
\ifnum\curO=0
\ifnum\curL=\U
\relax\W=0\relax
\else
\W=100\relax
\fi
\else
\ifnum\curL=\U\relax
\W=200\relax
\else
\W=150\relax
\fi
\fi
\fi
\score\curV\relax
\global\multiply\score\W
}
\def\tryMove#1#2{%
\nx=\curX\relax
\ny=\curY\relax
\advance\nx#1\relax
\advance\ny#2\relax
\ifnum0\ifnum\nx<0 1\fi\ifnum\ny<0 1\fi\ifnum\nx>9 1\fi\ifnum\ny>9 1\fi=0
\getScore{\the\nx}{\the\ny}
\ifnum\score>\bestScore
\global\bestScore\score
\global\bestX\nx
\global\bestY\ny
\fi\fi
}
\i0\relax\j0\relax
\loop
{
\j0\relax
\loop
\setL{\the\i}{\the\j}{0}
\setO{\the\i}{\the\j}{-1}
\advance\j1\relax
\ifnum\j<10\relax
\repeat
}
\advance\i1\relax
\ifnum\i<10\relax
\repeat
\def\parse#1 #2 #3 #4;{%
\N#1\relax%
\M#2\relax%
\T#3\relax%
\U#4\relax%
}
\read-1to\NMTU
\expandafter\parse\NMTU;
\ifnum0\ifnum\N=10 1\fi\ifnum\T=100 1\fi=11
\def\splitt#1 #2;{
\setV{\the\i}{8}{#1}
\setV{\the\i}{9}{#2}
}
\def\split#1 #2 #3 #4 #5 #6 #7 #8 #9;{
\setV{\the\i}{0}{#1}
\setV{\the\i}{1}{#2}
\setV{\the\i}{2}{#3}
\setV{\the\i}{3}{#4}
\setV{\the\i}{4}{#5}
\setV{\the\i}{5}{#6}
\setV{\the\i}{6}{#7}
\setV{\the\i}{7}{#8}
\splitt#9;
}
\i0
\loop
\read-1to\V
\expandafter\split\V;
\advance\i1\relax
\ifnum\i<10
\repeat
\i0\relax
\def\split#1 #2;{%
\ifnum\i=0\relax
\curX#1\relax
\curY#2\relax
\fi
\setL{#1}{#2}{1}
\setO{#1}{#2}{\the\i}
}
\loop
\read-1to\s
\expandafter\split\s;
\advance\i1\relax
\ifnum\i<\M
\repeat
\fi
\j0\relax
\def\split#1 #2;{
\ifnum\i=0\relax
\global\curX#1\relax
\global\curY#2\relax
\fi
}
\def\splitB#1 #2;{
\setO{\the\i}{8}{#1}
\setO{\the\i}{9}{#2}
}
\def\splitA#1 #2 #3 #4 #5 #6 #7 #8 #9;{
\setO{\the\i}{0}{#1}
\setO{\the\i}{1}{#2}
\setO{\the\i}{2}{#3}
\setO{\the\i}{3}{#4}
\setO{\the\i}{4}{#5}
\setO{\the\i}{5}{#6}
\setO{\the\i}{6}{#7}
\setO{\the\i}{7}{#8}
\splitB#9;
}\def\splitD#1 #2;{
\setL{\the\i}{8}{#1}
\setL{\the\i}{9}{#2}
}
\def\splitC#1 #2 #3 #4 #5 #6 #7 #8 #9;{
\setL{\the\i}{0}{#1}
\setL{\the\i}{1}{#2}
\setL{\the\i}{2}{#3}
\setL{\the\i}{3}{#4}
\setL{\the\i}{4}{#5}
\setL{\the\i}{5}{#6}
\setL{\the\i}{6}{#7}
\setL{\the\i}{7}{#8}
\splitD#9;
}
\bestScore=-1
\tryMove{0}{0}
\tryMove{-1}{0}
\tryMove{1}{0}
\tryMove{0}{-1}
\tryMove{0}{1}
\loop
\immediate\write16{\the\bestX\space\the\bestY}
{\i0\relax\loop
\read-1to\temp
\advance\i1\relax
\ifnum\i<\M\relax
\repeat}
{\i0\relax\loop
\read-1to\pos
\expandafter\split\pos;
\advance\i1\relax
\ifnum\i<\M\relax
\repeat}
{\i0\relax\loop
\read-1to\own
\expandafter\splitA\own;
\advance\i1\relax
\ifnum\i<10\relax
\repeat}
{\i0\relax\loop
\read-1to\lev
\expandafter\splitC\lev;
\advance\i1\relax
\ifnum\i<10\relax
\repeat}
\advance\j1\relax
\ifnum\j<\T\relax
\bestScore=-1
\tryMove{0}{0}
\tryMove{-1}{0}
\tryMove{1}{0}
\tryMove{0}{-1}
\tryMove{0}{1}
\repeat
\end
提出情報
| 提出日時 | |
|---|---|
| 問題 | A - Multi-Player Territory Game |
| ユーザ | maybeSuima |
| 言語 | TeX (tex 3.141592653) |
| 得点 | 0 |
| コード長 | 4445 Byte |
| 結果 | TLE |
| 実行時間 | > 2000 ms |
| メモリ | 13752 KiB |
ジャッジ結果
| セット名 | test_ALL | ||
|---|---|---|---|
| 得点 / 配点 | 0 / 100000000000 | ||
| 結果 |
|
| セット名 | テストケース |
|---|---|
| test_ALL | test_0000.txt, test_0001.txt, test_0002.txt, test_0003.txt, test_0004.txt, test_0005.txt, test_0006.txt, test_0007.txt, test_0008.txt, test_0009.txt, test_0010.txt, test_0011.txt, test_0012.txt, test_0013.txt, test_0014.txt, test_0015.txt, test_0016.txt, test_0017.txt, test_0018.txt, test_0019.txt, test_0020.txt, test_0021.txt, test_0022.txt, test_0023.txt, test_0024.txt, test_0025.txt, test_0026.txt, test_0027.txt, test_0028.txt, test_0029.txt, test_0030.txt, test_0031.txt, test_0032.txt, test_0033.txt, test_0034.txt, test_0035.txt, test_0036.txt, test_0037.txt, test_0038.txt, test_0039.txt, test_0040.txt, test_0041.txt, test_0042.txt, test_0043.txt, test_0044.txt, test_0045.txt, test_0046.txt, test_0047.txt, test_0048.txt, test_0049.txt, test_0050.txt, test_0051.txt, test_0052.txt, test_0053.txt, test_0054.txt, test_0055.txt, test_0056.txt, test_0057.txt, test_0058.txt, test_0059.txt, test_0060.txt, test_0061.txt, test_0062.txt, test_0063.txt, test_0064.txt, test_0065.txt, test_0066.txt, test_0067.txt, test_0068.txt, test_0069.txt, test_0070.txt, test_0071.txt, test_0072.txt, test_0073.txt, test_0074.txt, test_0075.txt, test_0076.txt, test_0077.txt, test_0078.txt, test_0079.txt, test_0080.txt, test_0081.txt, test_0082.txt, test_0083.txt, test_0084.txt, test_0085.txt, test_0086.txt, test_0087.txt, test_0088.txt, test_0089.txt, test_0090.txt, test_0091.txt, test_0092.txt, test_0093.txt, test_0094.txt, test_0095.txt, test_0096.txt, test_0097.txt, test_0098.txt, test_0099.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| test_0000.txt | TLE | > 2000 ms | 13704 KiB |
| test_0001.txt | TLE | > 2000 ms | 13672 KiB |
| test_0002.txt | TLE | > 2000 ms | 13620 KiB |
| test_0003.txt | TLE | > 2000 ms | 13652 KiB |
| test_0004.txt | TLE | > 2000 ms | 13624 KiB |
| test_0005.txt | TLE | > 2000 ms | 13608 KiB |
| test_0006.txt | TLE | > 2000 ms | 13588 KiB |
| test_0007.txt | TLE | > 2000 ms | 13624 KiB |
| test_0008.txt | TLE | > 2000 ms | 13716 KiB |
| test_0009.txt | TLE | > 2000 ms | 13748 KiB |
| test_0010.txt | TLE | > 2000 ms | 13712 KiB |
| test_0011.txt | TLE | > 2000 ms | 13720 KiB |
| test_0012.txt | TLE | > 2000 ms | 13628 KiB |
| test_0013.txt | TLE | > 2000 ms | 13748 KiB |
| test_0014.txt | TLE | > 2000 ms | 13704 KiB |
| test_0015.txt | TLE | > 2000 ms | 13728 KiB |
| test_0016.txt | TLE | > 2000 ms | 13672 KiB |
| test_0017.txt | TLE | > 2000 ms | 13620 KiB |
| test_0018.txt | TLE | > 2000 ms | 13644 KiB |
| test_0019.txt | TLE | > 2000 ms | 13564 KiB |
| test_0020.txt | TLE | > 2000 ms | 13716 KiB |
| test_0021.txt | TLE | > 2000 ms | 13708 KiB |
| test_0022.txt | TLE | > 2000 ms | 13744 KiB |
| test_0023.txt | TLE | > 2000 ms | 13724 KiB |
| test_0024.txt | TLE | > 2000 ms | 13700 KiB |
| test_0025.txt | TLE | > 2000 ms | 13656 KiB |
| test_0026.txt | TLE | > 2000 ms | 13660 KiB |
| test_0027.txt | TLE | > 2000 ms | 12980 KiB |
| test_0028.txt | TLE | > 2000 ms | 13644 KiB |
| test_0029.txt | TLE | > 2000 ms | 13624 KiB |
| test_0030.txt | TLE | > 2000 ms | 13640 KiB |
| test_0031.txt | TLE | > 2000 ms | 13724 KiB |
| test_0032.txt | TLE | > 2000 ms | 13204 KiB |
| test_0033.txt | TLE | > 2000 ms | 13584 KiB |
| test_0034.txt | TLE | > 2000 ms | 13620 KiB |
| test_0035.txt | TLE | > 2000 ms | 13668 KiB |
| test_0036.txt | TLE | > 2000 ms | 13064 KiB |
| test_0037.txt | TLE | > 2000 ms | 13628 KiB |
| test_0038.txt | TLE | > 2000 ms | 13624 KiB |
| test_0039.txt | TLE | > 2000 ms | 13624 KiB |
| test_0040.txt | TLE | > 2000 ms | 13624 KiB |
| test_0041.txt | TLE | > 2000 ms | 13092 KiB |
| test_0042.txt | TLE | > 2000 ms | 13572 KiB |
| test_0043.txt | TLE | > 2000 ms | 13672 KiB |
| test_0044.txt | TLE | > 2000 ms | 13700 KiB |
| test_0045.txt | TLE | > 2000 ms | 13720 KiB |
| test_0046.txt | TLE | > 2000 ms | 13592 KiB |
| test_0047.txt | TLE | > 2000 ms | 13632 KiB |
| test_0048.txt | TLE | > 2000 ms | 13740 KiB |
| test_0049.txt | TLE | > 2000 ms | 13632 KiB |
| test_0050.txt | TLE | > 2000 ms | 13696 KiB |
| test_0051.txt | TLE | > 2000 ms | 13568 KiB |
| test_0052.txt | TLE | > 2000 ms | 13520 KiB |
| test_0053.txt | TLE | > 2000 ms | 13736 KiB |
| test_0054.txt | TLE | > 2000 ms | 13600 KiB |
| test_0055.txt | TLE | > 2000 ms | 13672 KiB |
| test_0056.txt | TLE | > 2000 ms | 13688 KiB |
| test_0057.txt | TLE | > 2000 ms | 13584 KiB |
| test_0058.txt | TLE | > 2000 ms | 13632 KiB |
| test_0059.txt | TLE | > 2000 ms | 13600 KiB |
| test_0060.txt | TLE | > 2000 ms | 13592 KiB |
| test_0061.txt | TLE | > 2000 ms | 13608 KiB |
| test_0062.txt | TLE | > 2000 ms | 13608 KiB |
| test_0063.txt | TLE | > 2000 ms | 13596 KiB |
| test_0064.txt | TLE | > 2000 ms | 13612 KiB |
| test_0065.txt | TLE | > 2000 ms | 13676 KiB |
| test_0066.txt | TLE | > 2000 ms | 13672 KiB |
| test_0067.txt | TLE | > 2000 ms | 13656 KiB |
| test_0068.txt | TLE | > 2000 ms | 13652 KiB |
| test_0069.txt | TLE | > 2000 ms | 13600 KiB |
| test_0070.txt | TLE | > 2000 ms | 13624 KiB |
| test_0071.txt | TLE | > 2000 ms | 13556 KiB |
| test_0072.txt | TLE | > 2000 ms | 13512 KiB |
| test_0073.txt | TLE | > 2000 ms | 13652 KiB |
| test_0074.txt | TLE | > 2000 ms | 13600 KiB |
| test_0075.txt | TLE | > 2000 ms | 13712 KiB |
| test_0076.txt | TLE | > 2000 ms | 13636 KiB |
| test_0077.txt | TLE | > 2000 ms | 13624 KiB |
| test_0078.txt | TLE | > 2000 ms | 13692 KiB |
| test_0079.txt | TLE | > 2000 ms | 13672 KiB |
| test_0080.txt | TLE | > 2000 ms | 13552 KiB |
| test_0081.txt | TLE | > 2000 ms | 13660 KiB |
| test_0082.txt | TLE | > 2000 ms | 13740 KiB |
| test_0083.txt | TLE | > 2000 ms | 13532 KiB |
| test_0084.txt | TLE | > 2000 ms | 13604 KiB |
| test_0085.txt | TLE | > 2000 ms | 13584 KiB |
| test_0086.txt | TLE | > 2000 ms | 13672 KiB |
| test_0087.txt | TLE | > 2000 ms | 13716 KiB |
| test_0088.txt | TLE | > 2000 ms | 13748 KiB |
| test_0089.txt | TLE | > 2000 ms | 13624 KiB |
| test_0090.txt | TLE | > 2000 ms | 13720 KiB |
| test_0091.txt | TLE | > 2000 ms | 13592 KiB |
| test_0092.txt | TLE | > 2000 ms | 13748 KiB |
| test_0093.txt | TLE | > 2000 ms | 13512 KiB |
| test_0094.txt | TLE | > 2000 ms | 13752 KiB |
| test_0095.txt | TLE | > 2000 ms | 13740 KiB |
| test_0096.txt | TLE | > 2000 ms | 13624 KiB |
| test_0097.txt | TLE | > 2000 ms | 13624 KiB |
| test_0098.txt | TLE | > 2000 ms | 13740 KiB |
| test_0099.txt | TLE | > 2000 ms | 13604 KiB |