Submission #979566
Source Code Expand
import java.util.*; import java.math.*; public class Main { private static final int BASE = 30000; private static final int MAX_N = 20000; public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = s.nextInt(); int[] p = new int[n]; for (int i = 0; i < n; i++) { p[i] = s.nextInt(); } int[] a = new int[n]; int[] b = new int[n]; for (int i = 0; i < n; i++) { a[i] = 1 + BASE * i; b[i] = BASE * (n - i); } for (int i = 0; i < n; i++) { a[p[i]-1] += i; } System.out.print(a[0]); for (int i = 1; i < n; i++) { System.out.print(" "); System.out.print(a[i]); } System.out.println(); System.out.print(b[0]); for (int i = 1; i < n; i++) { System.out.print(" "); System.out.print(b[i]); } System.out.println(); } }
Submission Info
Submission Time | |
---|---|
Task | B - Construct Sequences |
User | toshihoge |
Language | Java8 (OpenJDK 1.8.0) |
Score | 400 |
Code Size | 908 Byte |
Status | AC |
Exec Time | 784 ms |
Memory | 30608 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 400 / 400 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example0.txt, example1.txt, example2.txt |
All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, example0.txt, example1.txt, example2.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
000.txt | AC | 278 ms | 15160 KB |
001.txt | AC | 235 ms | 14308 KB |
002.txt | AC | 237 ms | 14064 KB |
003.txt | AC | 203 ms | 13176 KB |
004.txt | AC | 241 ms | 13676 KB |
005.txt | AC | 754 ms | 29388 KB |
006.txt | AC | 354 ms | 18704 KB |
007.txt | AC | 711 ms | 29644 KB |
008.txt | AC | 525 ms | 23944 KB |
009.txt | AC | 746 ms | 30608 KB |
010.txt | AC | 753 ms | 30532 KB |
011.txt | AC | 758 ms | 29420 KB |
012.txt | AC | 748 ms | 29660 KB |
013.txt | AC | 762 ms | 30128 KB |
014.txt | AC | 754 ms | 30092 KB |
015.txt | AC | 732 ms | 30576 KB |
016.txt | AC | 739 ms | 29784 KB |
017.txt | AC | 784 ms | 30308 KB |
018.txt | AC | 763 ms | 30212 KB |
example0.txt | AC | 124 ms | 9548 KB |
example1.txt | AC | 124 ms | 9684 KB |
example2.txt | AC | 123 ms | 9680 KB |