CSES - Datatähti 2017 alku - Results
Submission details
Task:Bittijono
Sender:sp
Submission time:2016-10-09 01:49:22 +0300
Language:Java
Status:READY
Result:10
Feedback
groupverdictscore
#1ACCEPTED10
#20
#30
Test results
testverdicttimegroup
#1ACCEPTED0.17 s1details
#20.55 s2details
#30.15 s3details

Code

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


import java.util.Scanner;

/**
 *
 * @author Miro Petsalo
 */
public class Sandbox {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
               Scanner s = new Scanner(System.in);
        String p = "01101001100101101001011001101001100101100110100101101001100101101001011001101001011010011001011001101001100101101001011001101001";
   
       int amount = s.nextInt();
       int[] n = new int[10000000];
       
    
       int x = 0;
       while(amount>0){
           
     n[x] = s.nextInt()-1;
          
     x++;
           amount=amount-1;
       }
       int c = 0;
       int c1=0;
      
       while(x>0){
          
            int cm = 0;
           
    
       
          System.out.println(p.charAt(n[c])); 
        x--;
        c++;
          
       }
      // se toinen juttu
        
        
    }
    
}

Test details

Test 1

Group: 1

Verdict: ACCEPTED

input
100
62
9
12
73
...

correct output
1
1
1
0
1
...

user output
1
1
1
0
1
...

Test 2

Group: 2

Verdict:

input
100000
565433
141881
120108
825392
...

correct output
1
1
0
0
1
...

user output
(empty)

Error:
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 565432
	at java.lang.String.charAt(String.java:658)
	at Sandbox.main(Sandbox.java:44)

Test 3

Group: 3

Verdict:

input
100000
374768524402011755
937067109466254318
389256426086302899
932585725667010169
...

correct output
0
1
1
1
1
...

user output
(empty)

Error:
Exception in thread "main" java.util.InputMismatchException: For input string: "374768524402011755"
	at java.util.Scanner.nextInt(Scanner.java:2123)
	at java.util.Scanner.nextInt(Scanner.java:2076)
	at Sandbox.main(Sandbox.java:30)