Submission #65074240
Source Code Expand
A=int(input())
S=input()
x=0
y=0
chk=0
for i in range(A):
if S[i]=="S":
if chk==0:
x+=1
elif chk==1:
y-=1
elif chk==2:
x-=1
else:
y+=1
else:
chk+=1
if chk==4:
chk=0
print(x,y)
Submission Info
| Submission Time | |
|---|---|
| Task | B - Go Straight and Turn Right |
| User | watacco |
| Language | Python (PyPy 3.10-v7.3.12) |
| Score | 200 |
| Code Size | 256 Byte |
| Status | AC |
| Exec Time | 71 ms |
| Memory | 81160 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example0.txt, example1.txt |
| All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, 022.txt, example0.txt, example1.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 000.txt | AC | 62 ms | 76096 KiB |
| 001.txt | AC | 62 ms | 76492 KiB |
| 002.txt | AC | 62 ms | 76184 KiB |
| 003.txt | AC | 61 ms | 76264 KiB |
| 004.txt | AC | 62 ms | 76228 KiB |
| 005.txt | AC | 62 ms | 76244 KiB |
| 006.txt | AC | 64 ms | 80444 KiB |
| 007.txt | AC | 64 ms | 80800 KiB |
| 008.txt | AC | 65 ms | 80456 KiB |
| 009.txt | AC | 66 ms | 80840 KiB |
| 010.txt | AC | 65 ms | 80796 KiB |
| 011.txt | AC | 66 ms | 80540 KiB |
| 012.txt | AC | 71 ms | 81080 KiB |
| 013.txt | AC | 70 ms | 81004 KiB |
| 014.txt | AC | 71 ms | 81160 KiB |
| 015.txt | AC | 70 ms | 81156 KiB |
| 016.txt | AC | 70 ms | 80672 KiB |
| 017.txt | AC | 70 ms | 81116 KiB |
| 018.txt | AC | 71 ms | 80872 KiB |
| 019.txt | AC | 69 ms | 80596 KiB |
| 020.txt | AC | 69 ms | 80740 KiB |
| 021.txt | AC | 69 ms | 81032 KiB |
| 022.txt | AC | 68 ms | 81100 KiB |
| example0.txt | AC | 62 ms | 76280 KiB |
| example1.txt | AC | 62 ms | 76088 KiB |