結果
| 問題 | No.1115 二つの数列 / Two Sequences |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-07-17 22:37:03 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 980 bytes |
| 記録 | |
| コンパイル時間 | 938 ms |
| コンパイル使用メモリ | 105,728 KB |
| 実行使用メモリ | 42,368 KB |
| 最終ジャッジ日時 | 2026-05-23 18:20:13 |
| 合計ジャッジ時間 | 5,904 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 5 |
| other | AC * 3 TLE * 1 -- * 31 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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();
}
}
}