Submission #16199965
Source Code Expand
Copy
-- https://github.com/minoki/my-atcoder-solutionsimportData.CharisSpaceimportData.IntIntimportData.ListunfoldrimportqualifiedData.ByteString.CharasBSnaive::Integer->Integer->Integer->Integernaive x k d = minimum $ map abs $ dolet loop 0 t = pure tloop i t = dou <- oneStep tloop (i - 1) uloop k xwhereoneStep::Integer->IntegeroneStep t = [t - d, t + d]main = do[x,k,d] <- map fromInteger . unfoldr (BS.readInteger . BS.dropWhile isSpace) <$> BS.getLineprint $ naive x k d
-- 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 KB |
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 KB |
02.txt | AC | 7 ms | 3592 KB |
03.txt | TLE | 2239 ms | 1052852 KB |
04.txt | TLE | 2239 ms | 1052816 KB |
05.txt | TLE | 2239 ms | 1084616 KB |
06.txt | TLE | 2239 ms | 1081400 KB |
07.txt | TLE | 2239 ms | 1052992 KB |
08.txt | TLE | 2239 ms | 1054372 KB |
09.txt | TLE | 2238 ms | 1050976 KB |
10.txt | TLE | 2239 ms | 1052596 KB |
11.txt | TLE | 2238 ms | 1053236 KB |
12.txt | TLE | 2238 ms | 1054056 KB |
13.txt | AC | 8 ms | 3480 KB |
14.txt | AC | 2 ms | 3476 KB |
15.txt | TLE | 2239 ms | 1054528 KB |
16.txt | TLE | 2239 ms | 1052076 KB |
17.txt | TLE | 2239 ms | 1051720 KB |
18.txt | TLE | 2239 ms | 1053228 KB |
19.txt | TLE | 2238 ms | 1053012 KB |
20.txt | TLE | 2238 ms | 1052092 KB |
21.txt | TLE | 2239 ms | 1052768 KB |
22.txt | TLE | 2239 ms | 1052200 KB |
23.txt | AC | 7 ms | 3568 KB |
24.txt | AC | 2 ms | 3380 KB |
25.txt | TLE | 2239 ms | 1054460 KB |
26.txt | TLE | 2239 ms | 1051544 KB |
27.txt | TLE | 2239 ms | 1051304 KB |
s1.txt | AC | 6 ms | 3480 KB |
s2.txt | AC | 3 ms | 3576 KB |
s3.txt | AC | 2 ms | 3484 KB |
s4.txt | TLE | 2239 ms | 1052328 KB |