結果

問題 No.479 頂点は要らない
ユーザー fal_rndfal_rnd
提出日時 2017-01-27 23:23:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 1,346 ms / 1,500 ms
コード長 879 bytes
コンパイル時間 4,574 ms
コンパイル使用メモリ 83,360 KB
実行使用メモリ 72,140 KB
最終ジャッジ日時 2023-08-25 10:34:17
合計ジャッジ時間 27,186 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,780 KB
testcase_01 AC 128 ms
55,796 KB
testcase_02 AC 127 ms
55,940 KB
testcase_03 AC 127 ms
56,032 KB
testcase_04 AC 124 ms
56,176 KB
testcase_05 AC 128 ms
55,800 KB
testcase_06 AC 127 ms
55,764 KB
testcase_07 AC 124 ms
55,872 KB
testcase_08 AC 126 ms
55,864 KB
testcase_09 AC 128 ms
56,192 KB
testcase_10 AC 126 ms
55,676 KB
testcase_11 AC 127 ms
56,060 KB
testcase_12 AC 131 ms
55,848 KB
testcase_13 AC 127 ms
56,392 KB
testcase_14 AC 128 ms
55,884 KB
testcase_15 AC 127 ms
56,164 KB
testcase_16 AC 125 ms
56,224 KB
testcase_17 AC 126 ms
55,728 KB
testcase_18 AC 125 ms
55,952 KB
testcase_19 AC 235 ms
59,308 KB
testcase_20 AC 234 ms
59,044 KB
testcase_21 AC 201 ms
59,172 KB
testcase_22 AC 240 ms
59,052 KB
testcase_23 AC 227 ms
59,084 KB
testcase_24 AC 215 ms
58,928 KB
testcase_25 AC 220 ms
59,232 KB
testcase_26 AC 1,318 ms
72,140 KB
testcase_27 AC 1,346 ms
71,656 KB
testcase_28 AC 1,235 ms
71,480 KB
testcase_29 AC 1,113 ms
71,468 KB
testcase_30 AC 1,096 ms
71,644 KB
testcase_31 AC 1,099 ms
71,896 KB
testcase_32 AC 1,095 ms
71,380 KB
testcase_33 AC 1,099 ms
69,116 KB
testcase_34 AC 1,116 ms
69,948 KB
testcase_35 AC 967 ms
67,008 KB
testcase_36 AC 797 ms
67,540 KB
testcase_37 AC 1,153 ms
69,920 KB
testcase_38 AC 1,030 ms
69,336 KB
testcase_39 AC 920 ms
67,436 KB
testcase_40 AC 1,030 ms
69,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicodercontest155;

import java.util.*;
public class D{
	static Scanner s = new Scanner(System.in);
	public static void main(String[] args) {
		int n=s.nextInt(),m=s.nextInt();
		BitSet b=new BitSet(n);
		PriorityQueue<Edge> queue = new PriorityQueue<>();
		for(int i=0;i<m;i++) {
			queue.add(new Edge(s.nextInt(), s.nextInt()));
		}
		boolean buf;
		for(int i=n-1;i>=0;i--) {
			buf=b.get(i);
			while((!queue.isEmpty())&&i==queue.peek().t) {
				if(!buf)
					b.set(queue.poll().s);
				else
					queue.poll();
			}
		}
		for(int i=b.previousSetBit(114514);i>=0;i--) {
			System.out.print(b.get(i)?1:0);
		}
		System.out.println();
	}
}
class Edge implements Comparable<Edge>{
	int s,t;
	Edge(int s,int t) {
		this.s=s;
		this.t=t;
	}
	@Override
	public int compareTo(Edge o) {
		return o.t-this.t;
	}
	@Override
	public String toString() {
		return ""+s+" "+t;
	}
}
0