hiho week 228 register

Ended

Participants:231

Verdict:Time Limit Exceeded
Score:80 / 100
Submitted:2018-11-17 19:36:39

Lang:Java

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import java.util.*;
/*
public class main {  // 
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        Stack<Character> stack = new Stack<Character>(); //<>   
        Stack<Integer> index = new Stack<Integer>();
        if(s.length() > 1 ) {
            stack.push(s.charAt(0));
            index.push(1);
        }
        for(int i = 1;i < s.length();i++){
            if(stack.size() >= 1 && ( stack.peek() == '(' && s.charAt(i) == ')')){
                stack.pop();
                System.out.println(index.peek()+" " + (i + 1));
                index.pop();
            }else{
               index.push(i + 1);
                stack.push(s.charAt(i));
            }
        }
    }
}
*/
public class Main {
    public static void main(String[] args){ //   index
                                            //TLE 80
                                            //1:   80 WA
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX