結果
問題 |
No.497 入れ子の箱
|
ユーザー |
|
提出日時 | 2017-03-25 00:25:40 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 730 bytes |
コンパイル時間 | 93 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 11,136 KB |
最終ジャッジ日時 | 2024-07-06 03:18:22 |
合計ジャッジ時間 | 2,800 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 WA * 14 |
ソースコード
import sys from operator import itemgetter def solve(): N = int(input()) hako = [sorted([int(i) for i in input().split()]) for j in range(N)] hako.sort() inf = 10**9 dp = [1] * N for i in range(N - 2, -1, -1): for j in range(i + 1, N): if is_larger(hako[i], hako[j]): dp[i] = dp[j] + 1 break ans = dp[0] print(ans) def is_larger(a, b): for i in range(3): if b[i] <= a[i]: return False return True def debug(x, table): for name, val in table.items(): if x is val: print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr) return None if __name__ == '__main__': solve()