Submission #16199965
Source Code Expand
-- https://github.com/minoki/my-atcoder-solutions
import Data.Char (isSpace)
import Data.Int (Int64)
import Data.List (unfoldr)
import qualified Data.ByteString.Char8 as BS
naive :: Integer -> Integer -> Integer -> Integer
naive x k d = minimum $ map abs $ do
let loop 0 t = pure t
loop i t = do
u <- oneStep t
loop (i - 1) u
loop k x
where
oneStep :: Integer -> [Integer]
oneStep t = [t - d, t + d]
main = do
[x,k,d] <- map fromInteger . unfoldr (BS.readInteger . BS.dropWhile isSpace) <$> BS.getLine
print $ naive x k d
Submission Info
| Submission Time | |
|---|---|
| Task | C - Walking Takahashi |
| User | mod_poppo |
| Language | Haskell (GHC 8.8.3) |
| Score | 0 |
| Code Size | 584 Byte |
| Status | TLE |
| Exec Time | 2239 ms |
| Memory | 1084616 KiB |
Compile Error
Loaded package environment from /home/contestant/.ghc/x86_64-linux-8.8.3/environments/default
Judge Result
| Set Name | Sample | All | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 300 | ||||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | s1.txt, s2.txt, s3.txt, s4.txt |
| All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, 26.txt, 27.txt, s1.txt, s2.txt, s3.txt, s4.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01.txt | TLE | 2205 ms | 5128 KiB |
| 02.txt | AC | 7 ms | 3592 KiB |
| 03.txt | TLE | 2239 ms | 1052852 KiB |
| 04.txt | TLE | 2239 ms | 1052816 KiB |
| 05.txt | TLE | 2239 ms | 1084616 KiB |
| 06.txt | TLE | 2239 ms | 1081400 KiB |
| 07.txt | TLE | 2239 ms | 1052992 KiB |
| 08.txt | TLE | 2239 ms | 1054372 KiB |
| 09.txt | TLE | 2238 ms | 1050976 KiB |
| 10.txt | TLE | 2239 ms | 1052596 KiB |
| 11.txt | TLE | 2238 ms | 1053236 KiB |
| 12.txt | TLE | 2238 ms | 1054056 KiB |
| 13.txt | AC | 8 ms | 3480 KiB |
| 14.txt | AC | 2 ms | 3476 KiB |
| 15.txt | TLE | 2239 ms | 1054528 KiB |
| 16.txt | TLE | 2239 ms | 1052076 KiB |
| 17.txt | TLE | 2239 ms | 1051720 KiB |
| 18.txt | TLE | 2239 ms | 1053228 KiB |
| 19.txt | TLE | 2238 ms | 1053012 KiB |
| 20.txt | TLE | 2238 ms | 1052092 KiB |
| 21.txt | TLE | 2239 ms | 1052768 KiB |
| 22.txt | TLE | 2239 ms | 1052200 KiB |
| 23.txt | AC | 7 ms | 3568 KiB |
| 24.txt | AC | 2 ms | 3380 KiB |
| 25.txt | TLE | 2239 ms | 1054460 KiB |
| 26.txt | TLE | 2239 ms | 1051544 KiB |
| 27.txt | TLE | 2239 ms | 1051304 KiB |
| s1.txt | AC | 6 ms | 3480 KiB |
| s2.txt | AC | 3 ms | 3576 KiB |
| s3.txt | AC | 2 ms | 3484 KiB |
| s4.txt | TLE | 2239 ms | 1052328 KiB |