Submission #55229471
Source Code Expand
Copy
textToNat : Text -> NattextToNat t =match Nat.fromText t withOptional.None -> 0Some x -> xmain : '{IO, Exception} ()main _ =line1 = readLine ()line2 = readLine ()line3 = readLine ()a = textToNat line1(bstr, cstr) = break isSpace line2sum = a Nat.+ (textToNat bstr) Nat.+ (textToNat cstr)printLine ((Nat.toText sum) Text.++ " " Text.++ line3)
textToNat : Text -> Nat
textToNat t =
match Nat.fromText t with
Optional.None -> 0
Some x -> x
main : '{IO, Exception} ()
main _ =
line1 = readLine ()
line2 = readLine ()
line3 = readLine ()
a = textToNat line1
(bstr, cstr) = break isSpace line2
sum = a Nat.+ (textToNat bstr) Nat.+ (textToNat cstr)
printLine ((Nat.toText sum) Text.++ " " Text.++ line3)
Submission Info
| Submission Time | |
|---|---|
| Task | PracticeA - Welcome to AtCoder |
| User | mikecat |
| Language | Unison (Unison M5b) |
| Score | 100 |
| Code Size | 402 Byte |
| Status | AC |
| Exec Time | 33 ms |
| Memory | 42772 KB |
Judge Result
| Set Name | All | ||
|---|---|---|---|
| Score / Max Score | 100 / 100 | ||
| Status |
|
| Set Name | Test Cases |
|---|---|
| All | 00_rnd_01.txt, 00_rnd_02.txt, 00_rnd_03.txt, 00_rnd_04.txt, 00_rnd_05.txt, 00_sample_1.txt, 00_sample_2.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_rnd_01.txt | AC | 33 ms | 42752 KB |
| 00_rnd_02.txt | AC | 32 ms | 42732 KB |
| 00_rnd_03.txt | AC | 32 ms | 42540 KB |
| 00_rnd_04.txt | AC | 32 ms | 42540 KB |
| 00_rnd_05.txt | AC | 32 ms | 42752 KB |
| 00_sample_1.txt | AC | 32 ms | 42644 KB |
| 00_sample_2.txt | AC | 32 ms | 42772 KB |