Submission #1307783
Source Code Expand
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); int win = 0; int lose = 0; for(int i = 0; i < s.length(); i++) { if(s.charAt(i) == 'g') { if(i % 2 == 1) win++; } else { if(i % 2 == 0) lose++; } } System.out.println(win - lose); } }
Submission Info
Submission Time | |
---|---|
Task | D - AtCoDeer and Rock-Paper |
User | takeya |
Language | Java8 (OpenJDK 1.8.0) |
Score | 300 |
Code Size | 407 Byte |
Status | AC |
Exec Time | 161 ms |
Memory | 24904 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt |
All | 0_000.txt, 0_001.txt, 1_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt, 1_018.txt, 1_019.txt, 1_020.txt, 1_021.txt, 1_022.txt, 1_023.txt, 1_024.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | AC | 89 ms | 21716 KB |
0_001.txt | AC | 91 ms | 19156 KB |
1_002.txt | AC | 143 ms | 22592 KB |
1_003.txt | AC | 129 ms | 22356 KB |
1_004.txt | AC | 142 ms | 21804 KB |
1_005.txt | AC | 118 ms | 21588 KB |
1_006.txt | AC | 136 ms | 23908 KB |
1_007.txt | AC | 109 ms | 20692 KB |
1_008.txt | AC | 141 ms | 23792 KB |
1_009.txt | AC | 161 ms | 24904 KB |
1_010.txt | AC | 145 ms | 23892 KB |
1_011.txt | AC | 132 ms | 22356 KB |
1_012.txt | AC | 145 ms | 24404 KB |
1_013.txt | AC | 114 ms | 21844 KB |
1_014.txt | AC | 143 ms | 23380 KB |
1_015.txt | AC | 138 ms | 23636 KB |
1_016.txt | AC | 151 ms | 23768 KB |
1_017.txt | AC | 141 ms | 23656 KB |
1_018.txt | AC | 147 ms | 21864 KB |
1_019.txt | AC | 106 ms | 19412 KB |
1_020.txt | AC | 144 ms | 23124 KB |
1_021.txt | AC | 138 ms | 21196 KB |
1_022.txt | AC | 144 ms | 24732 KB |
1_023.txt | AC | 144 ms | 24192 KB |
1_024.txt | AC | 143 ms | 21076 KB |