Submission #2544615
Source Code Expand
import strutils import sequtils import math var s = stdin.readLine var index = -1 var total: int var answer: seq[char] var count = int(pow(2.0, 4.0)) var tmp: int var op: int var stock: int for i in 0 ..< count: total = 0 tmp = i stock = s[0..0].parseInt for c in 1 ..< s.len: op = tmp mod 2 tmp = tmp div 2 if op == 0: total += stock stock = 0 stock += s[c..c].parseInt else: total += stock stock = 0 stock -= s[c..c].parseInt total += stock if total == 7: index = i break tmp = index for i in 0 ..< 4: stdout.write(s[i]) op = tmp mod 2 tmp = tmp div 2 if i == 3: echo("=7") break if op == 0: stdout.write('+') else: stdout.write('-')
Submission Info
Submission Time | |
---|---|
Task | C - Train Ticket |
User | shinn1r0 |
Language | Nim (0.13.0) |
Score | 300 |
Code Size | 786 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Compile Error
Hint: system [Processing] Hint: Main [Processing] Hint: strutils [Processing] Hint: parseutils [Processing] Hint: sequtils [Processing] Hint: math [Processing] Hint: times [Processing] Main.nim(9, 5) Hint: 'answer' is declared but not used [XDeclaredButNotUsed] Hint: [Link] Hint: operation successful (14846 lines compiled; 1.807 sec total; 15.153MB; Release Build) [SuccessX]
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.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, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 1 ms | 256 KB |
02.txt | AC | 1 ms | 256 KB |
03.txt | AC | 1 ms | 256 KB |
04.txt | AC | 1 ms | 256 KB |
05.txt | AC | 1 ms | 256 KB |
06.txt | AC | 1 ms | 256 KB |
07.txt | AC | 1 ms | 256 KB |
08.txt | AC | 1 ms | 256 KB |
09.txt | AC | 1 ms | 256 KB |
10.txt | AC | 1 ms | 256 KB |
11.txt | AC | 1 ms | 256 KB |
12.txt | AC | 1 ms | 256 KB |
13.txt | AC | 1 ms | 256 KB |
14.txt | AC | 1 ms | 256 KB |
15.txt | AC | 1 ms | 256 KB |
16.txt | AC | 1 ms | 256 KB |
sample_01.txt | AC | 1 ms | 256 KB |
sample_02.txt | AC | 1 ms | 256 KB |
sample_03.txt | AC | 1 ms | 256 KB |