結果

問題 No.742 にゃんにゃんにゃん 猫の挨拶
ユーザー suikameron1suikameron1
提出日時 2018-11-10 11:50:30
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 2,195 ms / 2,500 ms
コード長 550 bytes
コンパイル時間 1,034 ms
コンパイル使用メモリ 67,264 KB
実行使用メモリ 22,732 KB
最終ジャッジ日時 2023-08-15 17:21:43
合計ジャッジ時間 5,881 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
20,668 KB
testcase_01 AC 55 ms
20,820 KB
testcase_02 AC 55 ms
20,676 KB
testcase_03 AC 55 ms
22,668 KB
testcase_04 AC 54 ms
18,624 KB
testcase_05 AC 55 ms
20,668 KB
testcase_06 AC 56 ms
20,680 KB
testcase_07 AC 58 ms
22,676 KB
testcase_08 AC 66 ms
22,732 KB
testcase_09 AC 55 ms
20,744 KB
testcase_10 AC 55 ms
22,636 KB
testcase_11 AC 2,195 ms
20,748 KB
testcase_12 AC 747 ms
22,648 KB
testcase_13 AC 56 ms
20,700 KB
testcase_14 AC 55 ms
20,656 KB
testcase_15 AC 56 ms
22,724 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using System.Linq;//リストの使用
using System.Collections.Generic;
using System.Text;//テキストの高速出力に必要
class Program
{
	static void Main()
	{
		long n = long.Parse(Console.ReadLine());//long.Parseはstringをlongに変換。
    long answer = 0;
    long[] positions = new long[n];
		for(int i = 0; i < n; i++)
    {
      positions[i] = long.Parse(Console.ReadLine());
      for(int j = 0; j < i; j++)
      {
        if(positions[j] >= positions[i]) answer++;
      }
    }
		Console.WriteLine(answer);
	}
}
0