Submission #1496531
Source Code Expand
import java.util.Scanner; public class Main { public static void main(String[] args) { new Main().solve(); } void solve(){ Scanner sc=new Scanner(System.in); String x=sc.next(); StringBuffer sb=new StringBuffer(x); int i=0; while(i<sb.length()-1){ if(sb.substring(i, i+2).equals("ST")){ sb=sb.delete(i, i+2); i=0; continue; } i++; } System.out.println(sb.length()); } }
Submission Info
Submission Time | |
---|---|
Task | A - STring |
User | kwkm0429 |
Language | Java8 (OpenJDK 1.8.0) |
Score | 200 |
Code Size | 443 Byte |
Status | TLE |
Exec Time | 1062 ms |
Memory | 149492 KB |
Judge Result
Set Name | Sample | Subtask1 | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | 0 / 100 | ||||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
Sample | example0, example1, example2 |
Subtask1 | example0, example1, example2, sub_corner0, sub_corner1, sub_corner2, sub_rand0, handmade0, handmade1 |
All | corner0, corner1, corner2, example0, example1, example2, handmade0, handmade1, maxrand0, sub_corner0, sub_corner1, sub_corner2, sub_rand0 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
corner0 | TLE | 1062 ms | 149492 KB |
corner1 | TLE | 1062 ms | 143968 KB |
corner2 | TLE | 1062 ms | 149052 KB |
example0 | AC | 90 ms | 21844 KB |
example1 | AC | 91 ms | 23124 KB |
example2 | AC | 93 ms | 21204 KB |
handmade0 | AC | 90 ms | 23124 KB |
handmade1 | AC | 90 ms | 21332 KB |
maxrand0 | TLE | 1057 ms | 46380 KB |
sub_corner0 | AC | 104 ms | 18640 KB |
sub_corner1 | AC | 90 ms | 18644 KB |
sub_corner2 | AC | 94 ms | 19668 KB |
sub_rand0 | AC | 103 ms | 19924 KB |