# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
427989 | Amylopectin | Island (NOI18_island) | C++14 | 195 ms | 31236 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <stdio.h>
#include <vector>
using namespace std;
const int mxn = 8e5 + 10;
vector <int> pa[mxn] = {};
int ans[mxn] = {};
int fima(int l,int r)
{
if(l > r)
return l;
return r;
}
int main()
{
int i,j,n,m,f,t,ma = 0;
scanf("%d %d",&n,&m);
for(i=0; i<n+m-1; i++)
{
scanf("%d %d",&f,&t);
pa[f].push_back(t);
pa[t].push_back(f);
}
for(i=n+1; i<=n+m; i++)
{
ans[pa[i].size()-1] ++;
ma = fima(ma,pa[i].size()-1);
}
for(i=ma; i>1; i--)
{
ans[i] += ans[i+1];
}
for(i=2; i<=ma; i++)
{
printf("%d %d\n",i,ans[i]);
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |