結果
問題 | No.1390 Get together |
ユーザー |
|
提出日時 | 2021-02-16 20:49:31 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 381 bytes |
コンパイル時間 | 329 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 388,636 KB |
最終ジャッジ日時 | 2024-09-13 10:15:59 |
合計ジャッジ時間 | 7,833 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | TLE * 1 -- * 28 |
ソースコード
import numpy as np n,m=map(int,input().split()) z=np.zeros([m,n]) for i in range(n): b,c=map(int,input().split()) z[b-1][c-1]+=1 for i in range(n): nonzero=np.where(z[:,i]!=0)[0] if(len(nonzero)!=0): p=nonzero[0] nonzero_r=nonzero[::-1][:-1] for idx in nonzero_r: z[p]+=z[idx] z=np.delete(z,idx,0) print(m-z.shape[0])