結果

問題 No.694 square1001 and Permutation 3
ユーザー ekidenpekidenp
提出日時 2018-06-08 22:54:05
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 545 bytes
コンパイル時間 4,369 ms
コンパイル使用メモリ 94,216 KB
実行使用メモリ 30,304 KB
最終ジャッジ日時 2023-09-13 00:05:39
合計ジャッジ時間 8,580 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string str = Console.ReadLine();
		int N = int.Parse(str);
		int[] A = new int[N];
		for(var i=0;i<N;i++){
			string str2 = Console.ReadLine();
			A[i] = int.Parse(str2);
		}
		int cnt = 0;
		int[] C = new int[N];
		for(var i=0;i<N;i++){
			for(var j=i+1;j<N;j++){
				if(A[i] > A[j]){
					cnt += 1;
				}
			}
		}
		Console.WriteLine(cnt);
		for(var i=1;i<N;i++){
			cnt = cnt - (A[i-1]-1) + (N - A[i-1]);
			Console.WriteLine(cnt);
		}
	}
}
0