結果

問題 No.1115 二つの数列 / Two Sequences
ユーザー hoshiika
提出日時 2020-07-17 22:37:03
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 980 bytes
コンパイル時間 2,093 ms
コンパイル使用メモリ 104,832 KB
実行使用メモリ 57,616 KB
最終ジャッジ日時 2024-11-30 01:31:11
合計ジャッジ時間 59,973 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 17 TLE * 18
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using static System.Console;
using static System.Math;
using System.Numerics;
using System.Collections.Generic;
using System.Linq;


namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var n = int.Parse(ReadLine());
            //var s = Conasole.ReadLine().Split(' ')
            var a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var b = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var list = new List<int>();
            for (int i = 0; i < n; i++)
            {
                list.Add(a[i]);
            }
            var ans = 0;
            for (int i = 0; i < n; i++)
            {
                int b_value = b[i];
                ans += list.IndexOf(b_value) - i;
                list.Remove(b_value);
                list.Insert(0, 0);
            }


            WriteLine(ans);
            Out.Flush();
        }




    }



}
0