Submission #1536240


Source Code Expand

import sequtils,strutils,math
var
    N,Q : int
    a,b,s,t : int
(N, Q) = stdin.readline.split.map(parseInt)

for q in 1..Q:
    (a, b, s, t) = stdin.readline.split.map(parseInt)
    var ans : int
    if a > b:
        (a, b) = (b, a)
    if s > t:
        (s, t) = (t, s)
    ans = min(max(0, a - s), t - s) + min(max(0, t - b), t - s)
    ans *= 100
    echo ans

Submission Info

Submission Time
Task D - 定期券
User s496t
Language Nim (0.13.0)
Score 100
Code Size 380 Byte
Status AC
Exec Time 263 ms
Memory 1532 KB

Compile Error

Hint: system [Processing]
Hint: Main [Processing]
Hint: sequtils [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: math [Processing]
Hint: times [Processing]
Hint:  [Link]
Hint: operation successful (14815 lines compiled; 1.918 sec total; 15.158MB; Release Build) [SuccessX]

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 16
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All large_01.txt, large_02.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, sample_01.txt, sample_02.txt, small_01.txt, small_02.txt
Case Name Status Exec Time Memory
large_01.txt AC 127 ms 1020 KB
large_02.txt AC 255 ms 1532 KB
random_01.txt AC 258 ms 1404 KB
random_02.txt AC 260 ms 1276 KB
random_03.txt AC 256 ms 1276 KB
random_04.txt AC 258 ms 1276 KB
random_05.txt AC 256 ms 1276 KB
random_06.txt AC 256 ms 1404 KB
random_07.txt AC 263 ms 1404 KB
random_08.txt AC 255 ms 1404 KB
random_09.txt AC 260 ms 1404 KB
random_10.txt AC 253 ms 1404 KB
sample_01.txt AC 1 ms 256 KB
sample_02.txt AC 1 ms 256 KB
small_01.txt AC 1 ms 256 KB
small_02.txt AC 1 ms 256 KB