Submission #880866
Source Code Expand
#coding: utf-8 a=gets().chomp() n=0 w=0 s=0 e=0 i=0 flg=0 while(i<a.length()) if(a[i]=="S") s+=1 elsif(a[i]=="W") w+=1 elsif(a[i]=="N") n+=1 elsif(a[i]=="E") e+=1 end i+=1 end if((s!=0&&n==0)||(s==0&&n!=0)) flg=1 end if((e==0&&w!=0)||(e!=0&&w==0)) flg=1 end puts(flg==0?"Yes":"No")
Submission Info
| Submission Time | |
|---|---|
| Task | A - Wanna go back home |
| User | misaka666 |
| Language | Ruby (2.3.3) |
| Score | 200 |
| Code Size | 327 Byte |
| Status | AC |
| Exec Time | 20 ms |
| Memory | 1788 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | s1.txt, s2.txt, s3.txt, s4.txt |
| All | 01.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 13.txt, 15.txt, s1.txt, s2.txt, s3.txt, s4.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01.txt | AC | 18 ms | 1788 KiB |
| 04.txt | AC | 20 ms | 1788 KiB |
| 05.txt | AC | 19 ms | 1788 KiB |
| 06.txt | AC | 18 ms | 1788 KiB |
| 07.txt | AC | 20 ms | 1788 KiB |
| 08.txt | AC | 20 ms | 1788 KiB |
| 09.txt | AC | 19 ms | 1788 KiB |
| 10.txt | AC | 20 ms | 1788 KiB |
| 11.txt | AC | 19 ms | 1788 KiB |
| 13.txt | AC | 20 ms | 1788 KiB |
| 15.txt | AC | 20 ms | 1788 KiB |
| s1.txt | AC | 18 ms | 1788 KiB |
| s2.txt | AC | 18 ms | 1788 KiB |
| s3.txt | AC | 18 ms | 1788 KiB |
| s4.txt | AC | 18 ms | 1788 KiB |