結果
| 問題 |
No.479 頂点は要らない
|
| ユーザー |
vjudge1
|
| 提出日時 | 2024-12-22 14:09:20 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 42 ms / 1,500 ms |
| コード長 | 511 bytes |
| コンパイル時間 | 704 ms |
| コンパイル使用メモリ | 69,856 KB |
| 実行使用メモリ | 9,216 KB |
| 最終ジャッジ日時 | 2024-12-22 14:09:23 |
| 合計ジャッジ時間 | 3,418 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 |
ソースコード
#include<cstdio>
#include<vector>
#include<iostream>
using namespace std;
const int N=1e5+10; bool vis[N]; vector<int>g[N];
int main() {
//freopen("highway.in","r",stdin);
//freopen("highway.out","w",stdout);
int n,m,u,v; scanf("%d %d",&n,&m);
while(m--) scanf("%d %d",&u,&v),g[min(u,v)].push_back(max(u,v));
for(int i=n-1;i>=0;i--) for(auto j:g[i]) if(!vis[j]) vis[i]=true;
for(int i=n-1;i>=0;i--) {
if(!vis[i]) continue;
for(int j=i;j>=0;j--) printf("%d",vis[j]);
break;
}
return 0;
}
vjudge1