Task: | Sudoku |
Sender: | |
Submission time: | 2015-08-15 09:15:00 +0300 |
Language: | Java |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 100 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.20 s | details |
#2 | ACCEPTED | 0.19 s | details |
#3 | ACCEPTED | 0.19 s | details |
#4 | ACCEPTED | 0.19 s | details |
#5 | ACCEPTED | 0.18 s | details |
Code
import java.util.*; public class sudoku { public static void main(String[] args) { Scanner input = new Scanner(System.in); String a = input.nextLine(); char[] chars = a.toCharArray(); String b = a.substring(8, 9) + a.substring(0, 8); String c = a.substring(7, 9) + a.substring(0, 7); String[] line = new String[9]; line[1] = a.substring(3, 9) + a.substring(0, 3); line[2] = a.substring(6, 9) + a.substring(0, 6); line[3] = b; line[4] = b.substring(3, 9) + b.substring(0, 3); line[5] = b.substring(6, 9) + b.substring(0, 6); line[6] = c; line[7] = c.substring(3, 9) + c.substring(0, 3); line[8] = c.substring(6, 9) + c.substring(0, 6); System.out.println(a); for (int i = 1; i < 9; i++) { System.out.println(line[i]); } } }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
592836471 |
correct output |
---|
592836471 836471592 471592836 928364715 364715928 ... |
user output |
---|
592836471 836471592 471592836 159283647 283647159 ... |
Test 2
Verdict: ACCEPTED
input |
---|
672935418 |
correct output |
---|
672935418 935418672 418672935 729354186 354186729 ... |
user output |
---|
672935418 935418672 418672935 867293541 293541867 ... |
Test 3
Verdict: ACCEPTED
input |
---|
329174658 |
correct output |
---|
329174658 174658329 658329174 291746583 746583291 ... |
user output |
---|
329174658 174658329 658329174 832917465 917465832 ... |
Test 4
Verdict: ACCEPTED
input |
---|
376958421 |
correct output |
---|
376958421 958421376 421376958 769584213 584213769 ... |
user output |
---|
376958421 958421376 421376958 137695842 695842137 ... |
Test 5
Verdict: ACCEPTED
input |
---|
875694321 |
correct output |
---|
875694321 694321875 321875694 756943218 943218756 ... |
user output |
---|
875694321 694321875 321875694 187569432 569432187 ... |