結果
| 問題 | 
                            No.2520 L1 Explosion
                             | 
                    
| コンテスト | |
| ユーザー | 
                             MasKoaTS
                         | 
                    
| 提出日時 | 2022-02-21 17:26:23 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                RE
                                 
                             
                            
                            (最新)
                                AC
                                 
                             
                            (最初)
                            
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 738 bytes | 
| コンパイル時間 | 520 ms | 
| コンパイル使用メモリ | 12,800 KB | 
| 実行使用メモリ | 10,880 KB | 
| 最終ジャッジ日時 | 2024-09-24 19:38:28 | 
| 合計ジャッジ時間 | 2,164 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | RE * 3 | 
| other | RE * 22 | 
ソースコード
import sys input = sys.stdin.readline N = int(input()) P = [list(map(int, input().split())) for _ in [0] * N] route = [[] for _ in [0] * N] for i in range(N - 1): for j in range(i + 1, N): d = abs(P[i][0] - P[j][0]) + abs(P[i][1] - P[j][1]) route[i].append((j, d)) route[j].append((i, d)) def func(d): c = [0] * N for v in range(N): if(c[v]): continue c[v] = 1 que = [v] while(que): now = que.pop() for nv, nd in route[now]: if(nd <= d): continue if(c[nv] == 0): c[nv] = -c[now] que.append(nv) elif(c[nv] == c[now]): return False return True ok = 4 * 10 ** 9 + 1 ng = 0 while(ok - ng > 1): d = (ok + ng) // 2 if(func(d)): ok = d else: ng = d ans = ok // 2 print(ans)
            
MasKoaTS