結果
問題 | No.711 競技レーティング単調増加 |
ユーザー | vwxyz |
提出日時 | 2022-07-16 02:04:38 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,328 bytes |
コンパイル時間 | 107 ms |
コンパイル使用メモリ | 11,096 KB |
実行使用メモリ | 37,088 KB |
最終ジャッジ日時 | 2023-09-10 08:50:56 |
合計ジャッジ時間 | 11,119 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 34 ms
10,428 KB |
testcase_01 | AC | 34 ms
10,404 KB |
testcase_02 | AC | 33 ms
10,380 KB |
testcase_03 | WA | - |
testcase_04 | AC | 35 ms
10,424 KB |
testcase_05 | WA | - |
testcase_06 | AC | 34 ms
10,528 KB |
testcase_07 | AC | 34 ms
10,388 KB |
testcase_08 | AC | 33 ms
10,412 KB |
testcase_09 | AC | 33 ms
10,392 KB |
testcase_10 | AC | 34 ms
10,432 KB |
testcase_11 | AC | 33 ms
10,456 KB |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 34 ms
10,392 KB |
testcase_16 | AC | 34 ms
10,472 KB |
testcase_17 | AC | 34 ms
10,376 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | AC | 251 ms
29,488 KB |
testcase_31 | AC | 256 ms
31,052 KB |
testcase_32 | AC | 262 ms
32,328 KB |
testcase_33 | AC | 269 ms
34,572 KB |
testcase_34 | AC | 254 ms
32,908 KB |
testcase_35 | AC | 279 ms
37,088 KB |
testcase_36 | AC | 282 ms
33,764 KB |
testcase_37 | AC | 282 ms
32,784 KB |
testcase_38 | AC | 274 ms
32,316 KB |
testcase_39 | AC | 166 ms
22,728 KB |
testcase_40 | AC | 179 ms
26,128 KB |
testcase_41 | AC | 34 ms
10,464 KB |
testcase_42 | AC | 154 ms
22,472 KB |
testcase_43 | AC | 209 ms
30,724 KB |
ソースコード
import bisect import copy import decimal import fractions import heapq import itertools import math import random import sys import time from collections import Counter,deque,defaultdict from functools import lru_cache,reduce from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max def _heappush_max(heap,item): heap.append(item) heapq._siftdown_max(heap, 0, len(heap)-1) def _heappushpop_max(heap, item): if heap and item < heap[0]: item, heap[0] = heap[0], item heapq._siftup_max(heap, 0) return item from math import gcd as GCD read=sys.stdin.read readline=sys.stdin.readline readlines=sys.stdin.readlines def LIS(lst,weakly=False,inf=float('inf'),restoration=False): f=bisect.bisect_right if weakly else bisect.bisect_left N=len(lst) update=[None]*N dp=[inf]*N for k,x in enumerate(lst): i=f(dp,x) dp[i]=x update[k]=(i,dp[i]) len_lis=bisect.bisect_left(dp,inf) if restoration: lis=[None]*len_lis len_lis-=1 for i,x in update[::-1]: if i==len_lis: lis[len_lis]=x len_lis-=1 return lis else: return len_lis N=int(readline()) A=list(map(int,readline().split())) for i in range(N): A[i]-=i ans=N-LIS(A,weakly=True) print(ans)