| Task: | Bittijono |
| Sender: | y2k_16 |
| Submission time: | 2016-10-16 02:46:17 +0300 |
| Language: | Java |
| Status: | READY |
| Result: | 10 |
| group | verdict | score |
|---|---|---|
| #1 | ACCEPTED | 10 |
| #2 | RUNTIME ERROR | 0 |
| #3 | RUNTIME ERROR | 0 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | ACCEPTED | 0.15 s | 1 | details |
| #2 | RUNTIME ERROR | 0.12 s | 2 | details |
| #3 | RUNTIME ERROR | 0.14 s | 3 | details |
Code
import java.util.Scanner;
public class bittijono {
public static void main (String[] args){
String bitti = "01101001100101101001011001101001100101100110100101101001100101101001011001101001011010011001011001101001100101101001011001101001";
Scanner syote = new Scanner(System.in);
int maara = 0;
int luvut[] = new int[100];
String tulos[] = new String[100];
maara = syote.nextInt();
for (int a = 0; a < maara; a++){
luvut[a] = syote.nextInt();
tulos[a] = bitti.substring(luvut[a]-1,luvut[a]);
}
for (int a = 0; a < maara; a++){
System.out.print(tulos[a]);
}
}
}Test details
Test 1
Group: 1
Verdict: ACCEPTED
| input |
|---|
| 100 62 9 12 73 ... |
| correct output |
|---|
| 1 1 1 0 1 ... |
| user output |
|---|
| 111010101011101001111011110110... |
Test 2
Group: 2
Verdict: RUNTIME ERROR
| 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: 565433 at java.lang.String.substring(String.java:1963) at bittijono.main(bittijono.java:14)
Test 3
Group: 3
Verdict: RUNTIME ERROR
| 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 bittijono.main(bittijono.java:13)
