Submission #980067


Source Code Expand

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AGC007
{
    public class B
    {
        private void Run()
        {
            var N = int.Parse(Console.ReadLine().Trim());
            var P = Console.ReadLine().Trim().Split().Select(int.Parse).ToArray();

            var dx = new int[N];

            for (int i = 0; i < P.Length; i++)
            {
                dx[P[i] - 1] = i;
            }
            var A = new int[N];
            var B = new int[N];
            for (int i = 0; i < N; i++)
            {
                A[i] = 1 + N * i + dx[i];
                B[i] = 1000000000 - N * i;
            }
            Console.WriteLine(string.Join(" ", A));
            Console.WriteLine(string.Join(" ", B));
        }

        public static void Main()
        {
            var old = Console.Out;
            using (var writer = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false })
            {
                Console.SetOut(writer);
                new B().Run();
                Console.Out.Flush();
                Console.SetOut(old);
            }
        }
    }
}

Submission Info

Submission Time
Task B - Construct Sequences
User Tan90909090
Language C# (Mono 4.6.2.0)
Score 400
Code Size 1211 Byte
Status AC
Exec Time 50 ms
Memory 9432 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 22
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 27 ms 3672 KB
001.txt AC 25 ms 3160 KB
002.txt AC 24 ms 3288 KB
003.txt AC 24 ms 3032 KB
004.txt AC 25 ms 3416 KB
005.txt AC 49 ms 9304 KB
006.txt AC 28 ms 4184 KB
007.txt AC 46 ms 8664 KB
008.txt AC 36 ms 6232 KB
009.txt AC 49 ms 9048 KB
010.txt AC 50 ms 9432 KB
011.txt AC 50 ms 9432 KB
012.txt AC 49 ms 9432 KB
013.txt AC 50 ms 9432 KB
014.txt AC 50 ms 9432 KB
015.txt AC 50 ms 9432 KB
016.txt AC 49 ms 9432 KB
017.txt AC 50 ms 9432 KB
018.txt AC 49 ms 9432 KB
example0.txt AC 23 ms 2904 KB
example1.txt AC 23 ms 2904 KB
example2.txt AC 23 ms 2904 KB