Submission #2823588


Source Code Expand

import strutils, sequtils

type
  seqStr = seq[string]
var
  S = stdin.readLine.split
  T = newSeq[string]()

proc judgeC(S: seqStr, n: int): bool =
  for i in 0 ..< n:
    if S[i] != "not":
      return
  return true

proc judgeB(S: seqStr, n: int): bool =
  if S.len == n:
    return judgeC(S, n)

proc judgeA(S: seqStr, n: int): bool =
  if S.len >= n:
    return judgeC(S, n)

while S.len != 0:
  if judgeB(S, 3) or judgeB(S, 2):
    break
  if judgeA(S, 3) or not judgeA(S, 2):
    T.add S[0]
    S.delete 0
  elif judgeA(S, 2):
    S.delete 0, 1

(T & S).join(" ").echo

Submission Info

Submission Time
Task A - 二重否定除去法則
User ToshiroYanagi
Language Nim (0.13.0)
Score 0
Code Size 608 Byte
Status WA
Exec Time 3 ms
Memory 384 KB

Compile Error

Hint: system [Processing]
Hint: Main [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: sequtils [Processing]
Hint:  [Link]
Hint: operation successful (12960 lines compiled; 1.884 sec total; 14.143MB; Release Build) [SuccessX]

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 16
WA × 3
Set Name Test Cases
All scrambled_00.txt, scrambled_01.txt, scrambled_02.txt, scrambled_03.txt, scrambled_04.txt, scrambled_05.txt, scrambled_06.txt, scrambled_07.txt, scrambled_08.txt, scrambled_09.txt, scrambled_10.txt, scrambled_11.txt, scrambled_12.txt, scrambled_13.txt, scrambled_14.txt, scrambled_15.txt, scrambled_16.txt, scrambled_17.txt, scrambled_18.txt
Case Name Status Exec Time Memory
scrambled_00.txt AC 1 ms 256 KB
scrambled_01.txt AC 1 ms 256 KB
scrambled_02.txt AC 1 ms 256 KB
scrambled_03.txt AC 1 ms 256 KB
scrambled_04.txt AC 1 ms 256 KB
scrambled_05.txt WA 3 ms 384 KB
scrambled_06.txt AC 3 ms 384 KB
scrambled_07.txt WA 3 ms 384 KB
scrambled_08.txt WA 3 ms 384 KB
scrambled_09.txt AC 1 ms 384 KB
scrambled_10.txt AC 1 ms 384 KB
scrambled_11.txt AC 1 ms 384 KB
scrambled_12.txt AC 1 ms 384 KB
scrambled_13.txt AC 1 ms 384 KB
scrambled_14.txt AC 1 ms 384 KB
scrambled_15.txt AC 1 ms 384 KB
scrambled_16.txt AC 1 ms 384 KB
scrambled_17.txt AC 1 ms 384 KB
scrambled_18.txt AC 1 ms 384 KB