結果

問題 No.479 頂点は要らない
ユーザー tailstails
提出日時 2017-01-27 22:50:44
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 67 ms / 1,500 ms
コード長 414 bytes
コンパイル時間 1,355 ms
コンパイル使用メモリ 150,896 KB
実行使用メモリ 13,660 KB
最終ジャッジ日時 2023-08-25 04:26:34
合計ジャッジ時間 3,858 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,796 KB
testcase_01 AC 3 ms
5,800 KB
testcase_02 AC 3 ms
5,844 KB
testcase_03 AC 3 ms
5,844 KB
testcase_04 AC 3 ms
5,844 KB
testcase_05 AC 3 ms
5,812 KB
testcase_06 AC 3 ms
5,876 KB
testcase_07 AC 3 ms
5,872 KB
testcase_08 AC 4 ms
5,900 KB
testcase_09 AC 3 ms
5,904 KB
testcase_10 AC 4 ms
5,728 KB
testcase_11 AC 4 ms
5,808 KB
testcase_12 AC 3 ms
5,812 KB
testcase_13 AC 4 ms
5,984 KB
testcase_14 AC 3 ms
5,812 KB
testcase_15 AC 3 ms
5,736 KB
testcase_16 AC 4 ms
6,040 KB
testcase_17 AC 3 ms
5,808 KB
testcase_18 AC 3 ms
5,868 KB
testcase_19 AC 4 ms
5,784 KB
testcase_20 AC 4 ms
5,884 KB
testcase_21 AC 4 ms
5,836 KB
testcase_22 AC 4 ms
5,896 KB
testcase_23 AC 4 ms
5,844 KB
testcase_24 AC 4 ms
5,824 KB
testcase_25 AC 4 ms
6,044 KB
testcase_26 AC 65 ms
10,548 KB
testcase_27 AC 67 ms
10,504 KB
testcase_28 AC 53 ms
13,660 KB
testcase_29 AC 39 ms
8,516 KB
testcase_30 AC 39 ms
8,588 KB
testcase_31 AC 39 ms
8,512 KB
testcase_32 AC 38 ms
8,648 KB
testcase_33 AC 43 ms
8,508 KB
testcase_34 AC 46 ms
8,564 KB
testcase_35 AC 35 ms
7,408 KB
testcase_36 AC 19 ms
6,392 KB
testcase_37 AC 44 ms
8,852 KB
testcase_38 AC 38 ms
8,164 KB
testcase_39 AC 28 ms
7,864 KB
testcase_40 AC 35 ms
8,600 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:6: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
 main(){
      ^

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

vector<int> av[100002];
set<int> aset;

main(){
	int n,m;
	scanf("%d%d",&n,&m);
	for(int j=0;j<m;++j){
		int a,b;
		scanf("%d%d",&a,&b);
		av[a].push_back(b);
	}
	bool on=false;
	for(int i=n-1;i>=0;--i){
		int r=0;
		for(int a:av[i]){
			if(aset.find(a)==aset.end()){
				r=1;
				on=true;
				aset.insert(i);
				break;
			}
		}
		if(on){
			putchar(r+48);
		}
	}
}
0