Submission #432575
Source Code Expand
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int a = sc.nextInt(); int b = sc.nextInt(); int now = 0; for(int i = 0; i < n; i++) { String s = sc.next(); int d = sc.nextInt(); if(s.equals("East")) { if(d < a) { now += a; } else if(d > b) { now += b; } else { now += d; } } else { if(d < a) { now -= a; } else if(d > b) { now -= b; } else { now -= d; } } } if(now < 0) { System.out.println("Wast " + -now); } else if(now > 0) { System.out.println("Eest " + now); } else { System.out.println(0); } } }
Submission Info
Submission Time | |
---|---|
Task | B - 双子とスイカ割り |
User | XzA_2123 |
Language | Java (OpenJDK 1.7.0) |
Score | 0 |
Code Size | 800 Byte |
Status | WA |
Exec Time | 495 ms |
Memory | 25264 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 100 | ||||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample-01.txt, sample-02.txt, sample-03.txt |
All | test-01.txt, test-02.txt, test-03.txt, test-04.txt, test-05.txt, test-06.txt, test-07.txt, test-08.txt, test-09.txt, test-10.txt, test-11.txt, test-12.txt, test-13.txt, test-14.txt, test-15.txt, test-16.txt, test-17.txt, test-18.txt, test-19.txt, test-20.txt, test-21.txt, test-22.txt, test-23.txt, test-24.txt, test-25.txt, test-26.txt, test-27.txt, test-28.txt, test-29.txt, test-30.txt, sample-01.txt, sample-02.txt, sample-03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample-01.txt | WA | 416 ms | 24016 KB |
sample-02.txt | AC | 411 ms | 23952 KB |
sample-03.txt | WA | 422 ms | 23944 KB |
test-01.txt | WA | 435 ms | 23824 KB |
test-02.txt | WA | 418 ms | 23824 KB |
test-03.txt | WA | 426 ms | 23944 KB |
test-04.txt | WA | 428 ms | 23856 KB |
test-05.txt | WA | 495 ms | 23996 KB |
test-06.txt | AC | 428 ms | 23856 KB |
test-07.txt | WA | 430 ms | 24112 KB |
test-08.txt | WA | 430 ms | 24480 KB |
test-09.txt | WA | 427 ms | 24564 KB |
test-10.txt | WA | 430 ms | 24608 KB |
test-11.txt | WA | 426 ms | 24708 KB |
test-12.txt | WA | 442 ms | 24840 KB |
test-13.txt | WA | 446 ms | 25240 KB |
test-14.txt | WA | 444 ms | 24820 KB |
test-15.txt | AC | 441 ms | 24712 KB |
test-16.txt | WA | 446 ms | 24760 KB |
test-17.txt | WA | 452 ms | 24712 KB |
test-18.txt | AC | 436 ms | 24960 KB |
test-19.txt | WA | 433 ms | 24712 KB |
test-20.txt | WA | 432 ms | 24848 KB |
test-21.txt | WA | 429 ms | 25000 KB |
test-22.txt | WA | 435 ms | 24632 KB |
test-23.txt | WA | 434 ms | 24692 KB |
test-24.txt | WA | 436 ms | 25020 KB |
test-25.txt | WA | 435 ms | 24720 KB |
test-26.txt | WA | 434 ms | 25264 KB |
test-27.txt | WA | 434 ms | 25264 KB |
test-28.txt | WA | 436 ms | 24728 KB |
test-29.txt | WA | 427 ms | 24728 KB |
test-30.txt | WA | 449 ms | 24792 KB |