結果
| 問題 |
No.5004 Room Assignment
|
| コンテスト | |
| ユーザー |
watarimaycry2
|
| 提出日時 | 2021-12-01 00:49:54 |
| 言語 | Java (openjdk 23) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,280 bytes |
| コンパイル時間 | 1,964 ms |
| 実行使用メモリ | 77,628 KB |
| スコア | 65,412 |
| 平均クエリ数 | 4449.71 |
| 最終ジャッジ日時 | 2021-12-01 00:50:56 |
| 合計ジャッジ時間 | 56,789 ms |
|
ジャッジサーバーID (参考情報) |
judge10 / judge15 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 RE * 79 |
ソースコード
import java.util.*;
public class Main{
public static void main(String arg[]){
Scanner sc = new Scanner(System.in);
int T = sc.nextInt();
int R = sc.nextInt();
int N = 5400;
Node[] list = new Node[N];
int user = 1;
for(int i = 0; i < T - 1; i++){
int G = sc.nextInt();
while(G > 0){
int v = sc.nextInt();
list[user - 1] = new Node(user, v);
G--;
user++;
}
System.out.println("0");
System.out.flush();
}
Arrays.sort(list);
ArrayList<String> output = new ArrayList<>();
for(int i = 0; i < N / 4; i++){
output.add(list[i * 4].no + " " + list[i * 4 + 1].no);
output.add(list[i * 4 + 1].no + " " + list[i * 4 + 2].no);
output.add(list[i * 4 + 2].no + " " + list[i * 4 + 3].no);
}
System.out.println(output.size());
for(int i = 0; i < output.size(); i++){
System.out.println(output.get(i));
}
System.out.flush();
}
}
class Node implements Comparable<Node>{
int no;
int V;
Node(int no, int V){
this.no = no;
this.V = V;
}
public int compareTo(Node ato){
return this.V - ato.V;
}
}
watarimaycry2