結果

問題 No.1170 Never Want to Walk
ユーザー 抹茶アイス抹茶アイス
提出日時 2023-07-19 16:38:00
言語 C#
(.NET 8.0.203)
結果
WA  
実行時間 -
コード長 930 bytes
コンパイル時間 14,186 ms
コンパイル使用メモリ 160,744 KB
実行使用メモリ 195,148 KB
最終ジャッジ日時 2023-10-19 19:10:58
合計ジャッジ時間 30,103 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
30,680 KB
testcase_01 AC 57 ms
30,680 KB
testcase_02 AC 57 ms
30,680 KB
testcase_03 AC 57 ms
30,680 KB
testcase_04 WA -
testcase_05 AC 58 ms
30,680 KB
testcase_06 AC 58 ms
30,680 KB
testcase_07 AC 58 ms
30,680 KB
testcase_08 AC 57 ms
30,680 KB
testcase_09 AC 57 ms
30,684 KB
testcase_10 AC 58 ms
30,684 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 1,679 ms
32,288 KB
testcase_23 AC 1,110 ms
32,288 KB
testcase_24 AC 1,705 ms
32,292 KB
testcase_25 AC 1,692 ms
32,280 KB
testcase_26 AC 1,410 ms
32,288 KB
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 RE -
testcase_37 RE -
testcase_38 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (119 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

using System;
public class Program{
    public static void Main(){
        var line = Console.ReadLine().Split(' ');
		var n = int.Parse(line[0]);
		var a = int.Parse(line[1]);
		var b = int.Parse(line[2]);
		line = Console.ReadLine().Split(' ');
		int i,j,k;
		var x = new int[n];
		for(i=0;i<n;i++){
		    x[i] = int.Parse(line[i]);
		}
		var s = new bool[n,n];
		for(i=0;i<n;i++){
		    s[i,i] = true;
		    for(j=0;j<n;j++){
		        k = Math.Abs(x[i]-x[j]);
		        if(k>=a&&k<=b){
		            s[i,j] = true;
		        }
		    }
		}
		for(i=0;i<n;i++){
		    for(j=0;j<n;j++){
		        if(s[i,j]){
		            for(k=0;k<n;k++){
		                if(s[j,k]){
		                    s[i,k] = true;
		                }
		            }
		        }
		    }
		}
		for(i=0;i<n;i++){
		    var z = 0;
		    for(j=0;j<n;j++){
		        if(s[i,j]){
		            z++;
		        }
		    }
		    Console.WriteLine(z);
		}
    }
}
0