Result

AC

Duration

2010ms

Code [DL]

g=takeWhile
h=length
f s t=head$if h x>h y then x else y
 where
 x=g(==s!!0)s
 y=g(==t!!0)t
main=mapM(\_->do{[s,t]<-words<$>getLine;putChar$f t$reverse s})[1..32]

stdin

662 869
322 997
544 334
559 965
332 323
959 658
677 757
425 751
987 338
344 443
611 282
877 377
197 923
651 551
365 571
244 558
788 772
378 877
281 267
188 834
982 653
986 848
689 994
297 173
212 227
112 215
978 992
772 724
366 355
826 221
588 685
122 227

stdout

22492975341775548818269722926282

stderr

strace

10    execve("/bin/sh", ["/bin/sh", "/root/script", "/volume/CODE"], 0x7ffcfe7217d0 /* 7 vars */) = 0
11    execve("/bin/cat", ["cat", "-"], 0x5630e6f2cd30 /* 7 vars */ <unfinished ...>
12    execve("/usr/bin/runghc", ["/usr/bin/runghc", "/volume/CODE"], 0x5630e6f2cd40 /* 7 vars */ <unfinished ...>
11    <... execve resumed>)             = 0
12    <... execve resumed>)             = 0
11    +++ exited with 0 +++
10    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=11, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
12    execve("/usr/lib/ghc-8.8.3/bin/runghc", ["/usr/lib/ghc-8.8.3/bin/runghc", "-f", "/usr/bin/ghc-8.8.3", "/volume/CODE"], 0x55b9e096b168 /* 7 vars */) = 0
12    --- SIGVTALRM {si_signo=SIGVTALRM, si_code=SI_TIMER, si_timerid=0, si_overrun=0, si_value={int=0, ptr=NULL}} ---
12    --- SIGVTALRM {si_signo=SIGVTALRM, si_code=SI_TIMER, si_timerid=0, si_overrun=0, si_value={int=0, ptr=NULL}} ---
12    execve("/usr/bin/ghc-8.8.3", ["/usr/bin/ghc-8.8.3", "-ignore-dot-ghci", "-x", "hs", "-e", ":set prog \"/volume/CODE\"", "-e", ":main []", "/volume/CODE"], 0x7fff566b35b0 /* 7 vars */) = 0
12    execve("/usr/lib/ghc-8.8.3/bin/ghc", ["/usr/lib/ghc-8.8.3/bin/ghc", "-B/usr/lib/ghc-8.8.3", "-ignore-dot-ghci", "-x", "hs", "-e", ":set prog \"/volume/CODE\"", "-e", ":main []", "/volume/CODE"], 0x55f912270200 /* 7 vars */) = 0
17    execve("/bin/gcc", ["gcc", "-DTABLES_NEXT_TO_CODE", "-B/usr/lib/ghc-8.8.3/integer-gmp"..., "--print-file-name", "libgmp.so"], 0x7ffda6aa16a0 /* 7 vars */) = -1 ENOENT (No such file or directory)
17    execve("/usr/local/sbin/gcc", ["gcc", "-DTABLES_NEXT_TO_CODE", "-B/usr/lib/ghc-8.8.3/integer-gmp"..., "--print-file-name", "libgmp.so"], 0x7ffda6aa16a0 /* 7 vars */) = -1 ENOENT (No such file or directory)
17    execve("/usr/local/bin/gcc", ["gcc", "-DTABLES_NEXT_TO_CODE", "-B/usr/lib/ghc-8.8.3/integer-gmp"..., "--print-file-name", "libgmp.so"], 0x7ffda6aa16a0 /* 7 vars */) = -1 ENOENT (No such file or directory)
17    execve("/usr/sbin/gcc", ["gcc", "-DTABLES_NEXT_TO_CODE", "-B/usr/lib/ghc-8.8.3/integer-gmp"..., "--print-file-name", "libgmp.so"], 0x7ffda6aa16a0 /* 7 vars */) = -1 ENOENT (No such file or directory)
17    execve("/usr/bin/gcc", ["gcc", "-DTABLES_NEXT_TO_CODE", "-B/usr/lib/ghc-8.8.3/integer-gmp"..., "--print-file-name", "libgmp.so"], 0x7ffda6aa16a0 /* 7 vars */) = 0
17    +++ exited with 0 +++
14    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=17, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
14    +++ exited with 0 +++
15    +++ exited with 0 +++
16    +++ exited with 0 +++
18    +++ exited with 0 +++
13    +++ exited with 0 +++
12    +++ exited with 0 +++
10    --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=12, si_uid=0, si_status=0, si_utime=27, si_stime=7} ---
10    +++ exited with 0 +++