結果

問題 No.497 入れ子の箱
ユーザー fgwiebfaoishfgwiebfaoish
提出日時 2020-04-03 12:56:10
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 73 ms / 5,000 ms
コード長 2,954 bytes
コンパイル時間 4,249 ms
コンパイル使用メモリ 110,092 KB
実行使用メモリ 23,768 KB
最終ジャッジ日時 2023-09-11 03:15:11
合計ジャッジ時間 8,499 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
21,680 KB
testcase_01 AC 63 ms
21,580 KB
testcase_02 AC 63 ms
21,568 KB
testcase_03 AC 70 ms
21,592 KB
testcase_04 AC 70 ms
21,624 KB
testcase_05 AC 72 ms
21,664 KB
testcase_06 AC 71 ms
21,684 KB
testcase_07 AC 70 ms
21,532 KB
testcase_08 AC 69 ms
23,656 KB
testcase_09 AC 69 ms
21,792 KB
testcase_10 AC 69 ms
21,736 KB
testcase_11 AC 71 ms
23,704 KB
testcase_12 AC 71 ms
21,688 KB
testcase_13 AC 71 ms
21,576 KB
testcase_14 AC 71 ms
21,676 KB
testcase_15 AC 73 ms
21,636 KB
testcase_16 AC 71 ms
21,868 KB
testcase_17 AC 73 ms
23,728 KB
testcase_18 AC 69 ms
19,668 KB
testcase_19 AC 70 ms
23,632 KB
testcase_20 AC 69 ms
21,788 KB
testcase_21 AC 69 ms
21,700 KB
testcase_22 AC 70 ms
23,580 KB
testcase_23 AC 69 ms
23,768 KB
testcase_24 AC 68 ms
21,660 KB
testcase_25 AC 64 ms
21,612 KB
testcase_26 AC 62 ms
21,560 KB
testcase_27 AC 71 ms
21,632 KB
testcase_28 AC 71 ms
23,696 KB
testcase_29 AC 72 ms
21,592 KB
testcase_30 AC 69 ms
21,572 KB
testcase_31 AC 68 ms
21,784 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
using System.Numerics;
static class Program{
	const int mod=(int)1e9+7;
	const double eps=1e-11;
	static void Main(){
		Sc sc=new Sc();
		var n=sc.I;
		var h=new int[n][];
		var dp=new int[n];
		for(int i = 0;i<n;i++) {
			h[i]=sc.Ia;
			Array.Sort(h[i],(u,v)=>v-u);
		}
		Array.Sort(h,(u,v)=>u[0]-v[0]);
		for(int i = 0;i<n;i++) {
			dp[i]=1;
			for(int j = i-1;j>=0;j--) {
				if(h[i][0]>h[j][0]&&h[i][1]>h[j][1]&&h[i][2]>h[j][2]){
					dp[i]=Max(dp[i],dp[j]+1);
				}
			}
		}
		Console.WriteLine("{0}",dp.Max());
	}
}

public class Sc{
	public int I{get{return int.Parse(Console.ReadLine());}}
	public long L{get{return long.Parse(Console.ReadLine());}}
	public double D{get{return double.Parse(Console.ReadLine());}}
	public string S{get{return Console.ReadLine();}}
	public int[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public object[] Oa{get{return Console.ReadLine().Split();}}
	public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}}
	public int[] Ia3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),int.Parse);}
	public int[] Ia3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),int.Parse);}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] La3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),long.Parse);}
	public long[] La3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),long.Parse);}
	public double[] Da2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),double.Parse);}}
	public double[] Da3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),double.Parse);}
	public double[] Da3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),double.Parse);}
	public T[] Arr<T>(int n,Func<T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f();}return a;}
	public T[] Arr<T>(int n,Func<int,T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i);}return a;}
	public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
	public T[] Arr<T>(int n,Func<int,string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i,Console.ReadLine().Split());}return a;}
}
0