QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#196256#442. 超现实树c20231020100 ✓240ms48852kbC++238.5kb2023-10-01 14:51:062023-10-01 14:51:07

Judging History

你现在查看的是最新测评结果

  • [2023-10-01 14:51:07]
  • 评测
  • 测评结果:100
  • 用时:240ms
  • 内存:48852kb
  • [2023-10-01 14:51:06]
  • 提交

answer

/*
膜拜传奇特级宗师 Afterglow 大神儿
今天在 florr 首页称您为大夏尊贵的大名儿
一股敬佩之情油生然而
您在 florr 为国争光,扬我大夏威名
向您献上最真挚的膜拜!!!
膜拜传奇特级宗师 Afterglow 大神儿,今,一,您,扬。向!
膜拜传奇特级宗师 Afterglow 大神儿,今,一,您,扬。向!
膜拜传奇特级宗师 Afterglow 大神儿,今,一,您,扬。向!
*/
/*
          _____                    _____                     _____                    _____
         /\    \                  /\    \                   /\    \                  /\    \
        /  \    \                /  \    \                 /  \____\                /  \    \
        \   \    \              /    \    \               /   /    /                \   \    \
         \   \    \            /      \    \             /   /    /                  \   \    \
          \   \    \          /   /\   \    \           /   /____/                    \   \    \
           \   \    \        /   /  \   \    \         /    |    |                     \   \    \
            \   \    \      /   /    \   \    \       /     |    |                      \   \    \
             \   \    \    /   /    / \   \    \     /      |    |                       \   \    \
              \   \    \  /   /    /   \   \    \   /       |____|__ _____                \   \    \
_______________\   \____\/   /____/     \   \    \ /   /|            \    \ _______________\   \____\
\                  /    /\   \    \      \   \    \\  / |    _________\____\\                  /    /
 \    ____________/____/  \   \    \      \   \____\\/__|   |    |           \    ____________/____/
  \   \    \               \   \    \     |   |    |    |   |    |            \   \    \
   \   \    \               \   \    \    |   |    |    |   |    |             \   \    \
    \   \    \               \   \    \   |   |____|    |   |    |              \   \    \
     \   \    \               \   \    \  /   /    /    \   |    |               \   \    \
      \   \    \               \   \    \/   /    /      \  |    |                \   \    \
       \   \____\               \   \___/   /    /        \ |    |                 \   \____\
        \  /    /                \         /    /          \|    |                  \  /    /
         \/____/                  \_______/____/            \____|                   \/____/
*/
#define poj
#define zcz
#ifdef poj
//C++
#include<iomanip>
#include<iostream>
//C
#include<cassert>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
//STL
#include<algorithm>
#include<bitset>
#include<functional>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<vector>
//C++11
#if __cplusplus>=201103L
#include<chrono>
#include<random>
#include<unordered_set>
#include<unordered_map>
#endif
#else
#include<bits/stdc++.h>
#endif
using namespace std;
#ifdef zcz
class fastin{
	private:
#ifdef poj
	static const int MAXBF=1<<20;
#else
	const int MAXBF=1<<27;
#endif
	FILE *inf;
	char *inbuf,*inst,*ined;
	inline char _getchar(){
		if(inst==ined)inst=inbuf,ined=inbuf+fread(inbuf,1,MAXBF,inf);
		return inst==ined?EOF:*inst++;
	}
	public:
	fastin(FILE*_inf=stdin){
		inbuf=new char[MAXBF],inf=_inf,inst=inbuf,ined=inbuf;
	}
	~fastin(){delete inbuf;}
	template<typename Int> fastin&operator>>(Int &n){
		static char c;
		Int t=1;
		while((c=_getchar())<'0'||c>'9')if(c=='-')t=-1;
		n=(c^48);
		while((c=_getchar())>='0'&&c<='9')n=n*10+(c^48);
		n*=t;
		return *this;
	}
	fastin&operator>>(char&c){
		while((c=_getchar())<'!'||c>'~');
		return *this;
	}
	fastin&operator>>(char*s){
		int t=0;
		static char c;
		while((c=_getchar())==' '||c=='\n');
		s[t++]=c;
		while((c=_getchar())>='!'&&c<='~')s[t++]=c;
		s[t]='\0';
		return *this;
	}
}fi;
class fastout{
	private:
#ifdef poj
	static const int MAXBF=1<<20;
#else
	const int MAXBF=1<<27;
#endif
	FILE *ouf;
	char *oubuf,*oust,*oued;
	inline void _flush(){fwrite(oubuf,1,oued-oust,ouf);oued=oust;}
	inline void _putchar(char c){
		if(oued==oust+MAXBF)_flush(),oued=oubuf;
		*oued++=c;
		#ifdef local
		_flush();
		#endif
	}
	public:
	fastout(FILE*_ouf=stdout){
		oubuf=new char[MAXBF],ouf=_ouf,oust=oubuf,oued=oubuf;
	}
	~fastout(){_flush();delete oubuf;}
	template<typename Int> fastout&operator<<(Int n){
		if(n<0)_putchar('-'),n=-n;
		static char S[20];
		int t=0;
		do{S[t++]='0'+n%10,n/=10;}while(n);
		for(int i=0;i<t;++i)_putchar(S[t-i-1]);
		return *this;
	}
	fastout&operator<<(char c){_putchar(c);return *this;}
	fastout&operator<<(char*s){
		for(int i=0;s[i];++i)_putchar(s[i]);
		return *this;
	}
	fastout&operator<<(const char*s){
		for(int i=0;s[i];++i)_putchar(s[i]);
		return *this;
	}
}fo;
#define cin fi
#define cout fo
#else
#define czc ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#endif
#define mod7 1000000007
#define mod9 998244353
#define ll long long
#define isinf 0x3f3f3f3f
#define ilinf 0x7fffffff
#define lsinf 0x3f3f3f3f3f3f3f3f
#define llinf 0x7fffffffffffffff
#define pii pair<int,int>
#define fr first
#define sc second
#define next ___
#define pb push_back
#define N 500010
#define M 2000010
#define For(i,a,b) for(int i=(a);i<=(b);++i)
#define Rep(i,a,b,c) for(int i=(a);i<=(b);i+=c)
#define Per(i,a,b,c) for(int i=(a);i>=(b);i-=c)
#define Gra(i) for(int i=h[x];i;i=next[i])
typedef int arr[N];
typedef int arm[M];
typedef ll arl[N];
typedef ll alm[M];
typedef double ard[N];
typedef double adm[M];
namespace modint{
	template<typename Int,Int mod,Int m1>
	struct modint{
		Int v;
		modint(){v=0;}
		modint(Int a){v=a;}
		bool operator==(modint a){return v==a.v;}
		bool operator!=(modint a){return v!=a.v;}
		bool operator<(modint a){return v<a.v;}
		bool operator>(modint a){return v>a.v;}
		bool operator<=(modint a){return v<=a.v;}
		bool operator>=(modint a){return v>=a.v;}
		bool operator==(Int a){return v==a;}
		bool operator!=(Int a){return v!=a;}
		bool operator<(Int a){return v<a;}
		bool operator>(Int a){return v>a;}
		bool operator<=(Int a){return v<=a;}
		bool operator>=(Int a){return v>=a;}
		modint operator+(modint a){return v>mod-a.v?v-mod+a.v:v+a.v;}
		modint operator-(modint a){return v>=a.v?v-a.v:v+mod-a.v;}
		modint modnum(modint a){
			return a-((__int128(a.v)*m1)>>80)*mod;
		}
		modint operator*(modint a){return modnum(v*a.v);}
		modint operator+=(modint a){*this=*this+a;return *this;}
		modint operator-=(modint a){*this=*this-a;return *this;}
		modint operator*=(modint a){*this=*this*a;return *this;}
		modint qpow(modint a,Int b){
			modint r(1);
			for(;b;b>>=1,a*=a)if(b&1)r*=a;
			return r;
		}
		modint operator/(modint a){return qpow(a,mod-2)*v;}
		modint operator/=(modint a){*this=*this/a;return *this;}
		modint&operator++(){*this=*this+1;return *this;}
		modint&operator--(){*this=*this-1;return *this;}
		const modint operator++(int){modint r=*this;++*this;return r;}
		const modint operator--(int){modint r=*this;--*this;return r;}
		#ifdef cout
		friend fastout&operator<<(fastout&out,modint n){out<<n.v;return out;}
		#else
		friend ostream&operator<<(ostream&out,modint n){out<<n.v;return out;}
		#endif
	};
	typedef modint<long long,1000000007,1208925811152148> int7;
	typedef modint<long long,998244353,1211051999424262> int9;
}
using namespace modint;
int son[M][2],chs[M][4],s[M],now[M];
void solve(){
	int n,cnt=0,ori=0;
	memset(chs,0,sizeof(chs));
	memset(now,0,sizeof(now));
	function<int(int)>chk=[&](int x){
		s[x]=1;
		For(i,0,1)if(son[x][i]){
			if(!chk(son[x][i]))return 0;
			s[x]+=s[son[x][i]];
		}
		if(son[x][0]&&son[x][1]&&min(s[son[x][0]],s[son[x][1]])>1)return 0;
		return 1;
	};
	function<void(int&,int)>build=[&](int&x,int y){
		if(!x)x=++cnt;
		int ls=son[y][0],rs=son[y][1];
		if(!ls&&!rs){
			now[x]=1;
			return;
		}
		if(ls&&!rs){
			build(chs[x][0],ls);
			return;
		}
		if(!ls&&rs){
			build(chs[x][1],rs);
			return;
		}
		if(s[ls]==1)build(chs[x][2],rs);
		if(s[rs]==1)build(chs[x][3],ls);
	};
	function<int(int)>ck=[&](int x){
		if(!x)return 0;
		if(now[x])return 1;
		now[x]=1;
		For(i,0,3)now[x]&=ck(chs[x][i]);
		return now[x];
	};
	cin>>n;
	while(n--){
		int m;
		cin>>m;
		For(i,1,m){
			cin>>son[i][0]>>son[i][1];
		}
		if(!chk(1))continue;
		build(ori,1);
	}
	if(ck(1))cout<<"Almost Complete\n";
	else cout<<"No\n";
	return;
}
int main(){
	#ifndef zcz
	czc;
	#endif
	int t=1;cin>>t;
	while(t--)solve();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 4
Accepted
time: 155ms
memory: 45640kb

input:

100
3
1
0 0
1
0 0
1
0 0
6
1
0 0
1
0 0
1
0 0
1
0 0
1
0 0
1
0 0
1
1
0 0
3
1
0 0
1
0 0
1
0 0
1
1
0 0
1
1
0 0
1
1
0 0
1
1
0 0
1
1
0 0
1
1
0 0
3
1
0 0
1
0 0
1
0 0
1
1
0 0
1
1
0 0
1
1
0 0
6
1
0 0
1
0 0
1
0 0
1
0 0
1
0 0
1
0 0
1
1
0 0
1
1
0 0
3
1
0 0
1
0 0
1
0 0
1
1
0 0
1
1
0 0
1
1
0 0
1
1
0 0
1
1
0 0
6
1
...

output:

Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Compl...

result:

ok 100 lines

Test #2:

score: 4
Accepted
time: 150ms
memory: 45336kb

input:

100
3
1
0 0
2
2 0
0 0
3
2 3
0 0
0 0
1
2
2 0
0 0
2
1
0 0
2
2 0
0 0
2
1
0 0
2
2 0
0 0
3
1
0 0
2
2 0
0 0
3
2 3
0 0
0 0
1
2
0 2
0 0
2
2
0 2
0 0
3
2 3
0 0
0 0
1
3
2 3
0 0
0 0
4
1
0 0
2
2 0
0 0
2
0 2
0 0
3
2 3
0 0
0 0
2
1
0 0
3
2 3
0 0
0 0
1
2
0 2
0 0
2
1
0 0
2
2 0
0 0
3
1
0 0
2
2 0
0 0
3
2 3
0 0
0 0
3
1
...

output:

Almost Complete
No
Almost Complete
Almost Complete
Almost Complete
No
No
No
Almost Complete
Almost Complete
No
Almost Complete
Almost Complete
Almost Complete
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
No
Almost Complete
Almost Complete
A...

result:

ok 100 lines

Test #3:

score: 4
Accepted
time: 185ms
memory: 44416kb

input:

100
2
2
2 0
0 0
2
0 2
0 0
2
2
0 2
0 0
3
2 3
0 0
0 0
3
1
0 0
2
2 0
0 0
3
2 3
0 0
0 0
2
1
0 0
2
2 0
0 0
3
1
0 0
2
2 0
0 0
3
2 3
0 0
0 0
2
1
0 0
2
0 2
0 0
3
2
2 0
0 0
2
0 2
0 0
3
2 3
0 0
0 0
2
2
2 0
0 0
2
0 2
0 0
2
1
0 0
3
2 3
0 0
0 0
1
2
2 0
0 0
2
2
2 0
0 0
2
0 2
0 0
2
2
2 0
0 0
3
2 3
0 0
0 0
2
1
0 0
...

output:

No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almost Complete
No
No
No
Almost Complete
Almost Complete
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
Almost Complet...

result:

ok 100 lines

Test #4:

score: 4
Accepted
time: 175ms
memory: 45228kb

input:

100
52
7
7 6
3 4
0 0
0 0
0 0
5 2
0 0
5
3 4
0 0
0 5
0 0
0 2
5
5 0
0 4
0 0
0 0
2 3
6
3 6
0 0
0 0
0 0
2 0
5 4
4
4 0
3 0
0 0
0 2
4
4 0
0 3
0 0
2 0
6
2 5
0 0
6 4
0 0
0 3
0 0
5
4 0
0 0
5 2
0 3
0 0
5
2 0
3 5
4 0
0 0
0 0
6
6 2
0 0
0 0
0 0
3 4
5 0
5
0 5
0 0
4 2
0 0
0 3
5
2 5
3 0
4 0
0 0
0 0
6
0 2
4 5
0 0
0 0...

output:

No
Almost Complete
No
No
No
Almost Complete
Almost Complete
No
No
Almost Complete
No
Almost Complete
No
No
Almost Complete
Almost Complete
No
No
No
Almost Complete
No
Almost Complete
No
No
No
No
Almost Complete
No
No
No
No
No
No
No
Almost Complete
No
No
No
Almost Complete
No
No
No
No
No
No
No
No
No
...

result:

ok 100 lines

Test #5:

score: 4
Accepted
time: 174ms
memory: 48520kb

input:

100
260
6
0 6
0 0
5 0
0 0
0 4
2 3
7
0 4
6 0
0 0
3 2
0 0
5 7
0 0
9
2 3
6 4
0 0
0 0
0 0
9 7
8 5
0 0
0 0
7
7 2
0 0
0 4
0 0
3 6
0 0
5 0
6
0 5
4 0
0 0
6 3
2 0
0 0
6
5 4
6 0
2 0
0 0
0 3
0 0
8
2 5
6 0
0 0
0 0
0 0
8 3
0 0
4 7
7
6 0
0 0
2 5
3 7
0 0
0 4
0 0
7
2 0
3 0
5 4
7 6
0 0
0 0
0 0
7
7 0
0 3
4 5
0 0
0 0
...

output:

No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
No
Almost Complete
Almost Complete
No
No
Almost Complete
No
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
No
No
No
Almost Complete
No
Almost Complete
No
No
No
No
No
No
Almost Complete
No
No
No
Almo...

result:

ok 100 lines

Test #6:

score: 4
Accepted
time: 181ms
memory: 46212kb

input:

100
365
9
0 9
6 4
0 8
0 0
0 7
0 0
3 0
0 2
0 5
10
0 7
0 10
0 0
0 5
8 3
0 0
0 2
9 0
0 0
4 6
10
0 8
0 9
0 0
0 0
3 0
0 0
4 5
0 2
10 0
7 6
10
0 8
0 3
0 0
7 10
6 4
0 0
0 2
0 9
0 5
0 0
11
0 4
0 0
0 0
0 5
0 7
0 11
9 8
0 0
3 6
0 0
2 10
10
0 9
0 0
0 0
0 0
3 7
10 0
6 4
0 5
0 8
2 0
11
0 7
0 0
10 6
2 9
0 8
0 0
0...

output:

Almost Complete
Almost Complete
Almost Complete
No
No
No
Almost Complete
Almost Complete
No
Almost Complete
Almost Complete
No
Almost Complete
Almost Complete
Almost Complete
No
No
Almost Complete
No
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almost Comp...

result:

ok 100 lines

Test #7:

score: 4
Accepted
time: 200ms
memory: 46004kb

input:

100
1
1
0 0
1
1
0 0
68
5
2 0
3 5
0 0
0 0
0 4
5
0 2
4 5
0 0
0 3
0 0
5
4 3
5 0
0 2
0 0
0 0
5
0 3
0 0
4 2
5 0
0 0
5
0 4
5 3
0 0
0 2
0 0
6
2 6
0 3
5 4
0 0
0 0
0 0
6
6 0
0 0
0 0
0 0
2 4
3 5
5
5 3
0 0
0 0
2 0
4 0
4
0 2
0 4
0 0
3 0
6
0 3
5 6
4 2
0 0
0 0
0 0
6
5 4
3 0
0 0
0 0
2 6
0 0
7
6 4
7 5
0 0
2 3
0 0
0...

output:

Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
Almost...

result:

ok 100 lines

Test #8:

score: 4
Accepted
time: 198ms
memory: 48532kb

input:

100
295
15
4 9
7 3
5 0
0 2
8 0
14 10
0 0
11 13
0 0
0 0
0 6
0 0
0 0
15 12
0 0
13
10 7
6 0
0 0
13 2
0 0
0 0
0 0
12 0
3 8
0 9
5 4
11 0
0 0
12
6 5
8 0
12 0
10 0
0 0
0 7
11 4
0 3
0 2
9 0
0 0
0 0
10
8 3
0 0
0 7
0 0
10 9
0 5
0 6
2 0
0 0
0 4
13
11 8
6 0
0 0
2 0
0 0
12 0
5 4
0 0
10 0
3 13
0 7
9 0
0 0
13
9 8
...

output:

Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
No
Almost ...

result:

ok 100 lines

Test #9:

score: 4
Accepted
time: 240ms
memory: 47192kb

input:

100
11
2
2 0
0 0
1
0 0
3
0 2
3 0
0 0
4
2 0
3 0
0 4
0 0
3323
0 2
0 3
4 0
0 5
0 6
0 7
8 0
0 9
10 0
11 0
0 12
13 0
14 0
15 0
0 16
0 17
0 18
0 19
0 20
0 21
22 0
23 0
0 24
0 25
26 0
0 27
0 28
29 0
0 30
31 0
32 0
0 33
34 0
35 0
0 36
37 0
0 38
39 0
40 0
0 41
42 0
0 43
44 0
0 45
0 46
47 0
48 0
49 0
50 0
51 ...

output:

Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almost Complete
Almost Complete
Almost Co...

result:

ok 100 lines

Test #10:

score: 4
Accepted
time: 28ms
memory: 48000kb

input:

20
2
2
2 0
0 0
10
2 0
0 3
0 4
0 5
6 0
7 0
8 0
9 10
0 0
0 0
19
7
2 0
0 3
4 0
5 0
7 6
0 0
0 0
3
3 2
0 0
0 0
6
2 0
0 3
4 0
5 0
0 6
0 0
10
2 0
0 3
4 0
5 0
6 0
7 0
8 0
0 9
0 10
0 0
8
2 0
0 3
4 0
5 0
6 0
7 0
0 8
0 0
5
2 0
0 3
4 0
0 5
0 0
4
2 0
3 4
0 0
0 0
6
2 0
0 3
4 0
6 5
0 0
0 0
5
2 0
0 3
5 4
0 0
0 0
10...

output:

No
Almost Complete
Almost Complete
No
No
No
Almost Complete
Almost Complete
No
Almost Complete
No
No
No
No
No
No
Almost Complete
No
No
Almost Complete

result:

ok 20 lines

Test #11:

score: 4
Accepted
time: 33ms
memory: 48060kb

input:

20
9
5
0 2
0 3
0 4
0 5
0 0
4
2 0
3 0
4 0
0 0
3
3 2
0 0
0 0
2
0 2
0 0
5
2 0
3 0
4 5
0 0
0 0
3
2 0
0 3
0 0
7
0 2
3 0
0 4
5 0
6 0
7 0
0 0
6
0 2
0 3
0 4
5 6
0 0
0 0
4
2 0
4 3
0 0
0 0
8
7
2 0
0 3
4 0
0 5
6 0
7 0
0 0
3
2 0
0 3
0 0
2
0 2
0 0
4
2 0
3 0
4 0
0 0
4
2 0
4 3
0 0
0 0
21
0 2
0 3
0 4
0 5
0 6
7 0
8 ...

output:

No
No
Almost Complete
No
No
No
No
Almost Complete
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
No
Almost Complete
No
No
No
Almost Complete

result:

ok 20 lines

Test #12:

score: 4
Accepted
time: 39ms
memory: 45668kb

input:

20
111
41
2 0
3 0
4 0
0 5
0 6
0 7
8 0
0 9
10 0
0 11
12 0
13 0
0 14
0 15
16 0
0 17
0 18
19 0
0 20
21 0
22 0
0 23
0 24
25 0
26 0
0 27
0 28
0 29
30 0
0 31
32 0
0 33
0 34
0 35
0 36
0 37
0 38
39 0
40 0
41 0
0 0
28
2 0
3 0
0 4
0 5
6 0
0 7
0 8
9 0
0 10
11 0
12 0
0 13
14 0
15 0
0 16
0 17
18 0
0 19
20 0
21 0...

output:

No
No
No
Almost Complete
No
No
No
No
No
Almost Complete
No
Almost Complete
No
Almost Complete
Almost Complete
No
Almost Complete
Almost Complete
No
No

result:

ok 20 lines

Test #13:

score: 4
Accepted
time: 49ms
memory: 46032kb

input:

20
168
38
0 2
3 0
4 0
5 0
6 0
7 0
0 8
0 9
10 0
0 11
12 0
0 13
0 14
15 0
16 0
0 17
0 18
19 0
20 0
21 0
22 0
0 23
0 24
0 25
26 0
0 27
0 28
29 0
30 0
31 0
32 0
33 0
0 34
35 0
36 0
38 37
0 0
0 0
52
0 2
3 0
4 0
5 0
6 0
7 0
0 8
0 9
10 0
0 11
12 0
0 13
0 14
15 0
16 0
0 17
0 18
19 0
20 0
21 0
22 0
0 23
0 24...

output:

No
No
Almost Complete
Almost Complete
No
No
No
No
Almost Complete
No
No
No
No
No
Almost Complete
No
No
Almost Complete
Almost Complete
No

result:

ok 20 lines

Test #14:

score: 4
Accepted
time: 33ms
memory: 45556kb

input:

20
4
1
0 0
1
0 0
1
0 0
1
0 0
1
1
0 0
1
1
0 0
4
1
0 0
1
0 0
1
0 0
1
0 0
5
2
2 0
0 0
4
2 3
0 0
0 4
0 0
3
3 0
0 0
2 0
4
2 3
0 0
4 0
0 0
3
2 3
0 0
0 0
19
11
0 11
0 0
10 7
0 0
8 0
9 4
0 0
6 0
0 3
0 0
2 5
2
2 0
0 0
8
0 4
6 0
0 0
3 2
0 0
8 0
0 0
7 5
6
0 3
6 0
5 2
0 0
0 0
0 4
5
0 3
0 4
5 2
0 0
0 0
7
0 6
3 0...

output:

Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almost Complete
No
No
Almost Complete
No
Almost Complete
Almost Complete
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No

result:

ok 20 lines

Test #15:

score: 4
Accepted
time: 36ms
memory: 46168kb

input:

20
1
1
0 0
3
2
0 2
0 0
2
2 0
0 0
3
3 2
0 0
0 0
3
3
2 3
0 0
0 0
3
3 2
0 0
0 0
2
2 0
0 0
18
5
2 3
0 0
4 5
0 0
0 0
4
4 3
0 0
0 2
0 0
4
3 0
0 0
2 4
0 0
2
0 2
0 0
4
3 0
0 0
0 4
2 0
9
8 0
0 0
5 6
7 0
4 2
0 0
0 9
0 3
0 0
3
2 3
0 0
0 0
5
4 0
5 3
0 0
0 2
0 0
6
0 5
4 0
0 0
0 6
0 2
0 3
7
7 0
0 0
0 0
0 0
2 4
5 ...

output:

Almost Complete
Almost Complete
No
Almost Complete
Almost Complete
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete

result:

ok 20 lines

Test #16:

score: 4
Accepted
time: 33ms
memory: 44616kb

input:

20
12
5
3 5
0 0
4 0
2 0
0 0
7
3 2
5 7
4 6
0 0
0 0
0 0
0 0
5
5 4
0 3
0 0
0 0
2 0
3
2 3
0 0
0 0
6
2 3
4 5
6 0
0 0
0 0
0 0
2
0 2
0 0
6
6 4
0 0
0 0
0 2
0 0
5 3
4
4 3
0 0
0 0
0 2
7
2 3
7 0
0 5
0 0
0 0
0 0
4 6
8
4 3
6 8
7 5
2 0
0 0
0 0
0 0
0 0
2
2 0
0 0
7
3 7
6 4
2 0
0 0
0 0
0 0
5 0
12
3
0 3
0 0
2 0
3
2 3...

output:

Almost Complete
Almost Complete
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almost Complete
Almost Complete
No

result:

ok 20 lines

Test #17:

score: 4
Accepted
time: 75ms
memory: 45224kb

input:

40
364
51
13 0
0 0
0 0
36 30
0 0
40 0
0 0
0 0
0 6
0 0
0 0
0 50
41 8
11 45
35 3
0 0
0 0
0 46
22 47
0 0
0 15
0 0
21 0
9 27
0 49
17 18
0 0
23 0
5 39
29 0
51 7
28 10
16 19
48 0
0 31
0 0
33 0
43 0
0 26
14 0
34 44
2 38
0 4
0 0
0 0
0 25
24 0
0 42
12 0
20 32
37 0
95
57 30
0 0
0 34
0 0
0 0
18 28
0 0
0 71
0 0...

output:

Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
Almost Complete
Almost Complete
No
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almost Complete
N...

result:

ok 40 lines

Test #18:

score: 4
Accepted
time: 89ms
memory: 45168kb

input:

40
512
135
0 6
132 104
0 84
0 45
0 115
65 26
28 0
50 91
0 116
0 0
0 77
98 10
48 111
0 0
125 67
59 82
0 0
93 100
129 83
126 0
0 121
99 55
0 0
0 0
96 0
0 0
134 0
89 0
0 22
124 0
0 0
0 0
0 0
0 0
42 0
109 16
0 0
0 72
23 135
0 56
0 2
13 0
0 0
128 0
17 27
0 0
81 78
0 0
0 130
0 0
0 0
0 90
76 71
58 20
0 0
0...

output:

Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almo...

result:

ok 40 lines

Test #19:

score: 4
Accepted
time: 95ms
memory: 48732kb

input:

40
626
204
201 0
0 0
0 0
152 0
0 198
0 177
0 19
0 96
0 105
121 41
176 22
188 150
158 192
168 0
182 35
191 0
0 10
145 125
49 0
0 0
103 0
199 0
0 0
197 73
0 0
0 130
100 187
0 0
0 141
140 183
64 91
94 25
0 0
0 0
0 0
92 69
28 108
0 0
0 0
0 127
71 0
27 93
128 0
89 87
0 0
0 0
0 204
58 129
175 14
143 0
173...

output:

Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almo...

result:

ok 40 lines

Test #20:

score: 4
Accepted
time: 118ms
memory: 46056kb

input:

40
741
46
0 20
4 6
0 0
0 17
34 45
0 0
2 9
0 0
0 0
0 0
0 36
39 0
11 0
0 37
18 0
28 0
10 42
14 41
44 13
0 24
16 0
12 0
0 0
46 30
0 0
7 8
33 25
0 31
0 0
3 32
0 5
0 15
0 0
0 35
0 22
26 0
21 0
0 27
29 40
19 0
0 0
0 43
23 38
0 0
0 0
0 0
223
0 47
0 79
37 32
29 138
165 105
0 53
62 0
147 0
0 0
221 0
58 132
3...

output:

Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almo...

result:

ok 40 lines

Test #21:

score: 4
Accepted
time: 132ms
memory: 48852kb

input:

40
836
203
118 129
0 0
187 109
0 156
105 6
100 126
108 0
123 32
0 84
0 0
0 60
0 0
91 0
0 38
0 30
0 0
52 10
0 27
160 0
89 115
0 0
181 119
95 141
0 0
0 0
0 184
0 0
72 0
150 0
0 0
45 81
0 0
173 46
0 0
88 51
0 0
169 76
0 0
199 166
176 134
0 63
195 0
164 0
67 0
124 0
8 171
0 54
0 200
165 61
0 0
112 125
1...

output:

Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almo...

result:

ok 40 lines

Test #22:

score: 4
Accepted
time: 121ms
memory: 45708kb

input:

40
952
55
54 10
0 0
0 50
0 0
49 38
0 0
0 0
39 36
0 0
0 0
52 17
0 0
19 0
23 0
51 0
0 0
53 0
12 30
0 37
0 21
55 2
14 0
43 0
0 5
0 0
0 0
0 29
34 20
8 41
0 11
26 27
28 9
0 35
0 0
4 13
0 25
44 0
7 31
0 0
24 42
0 0
0 0
0 47
0 32
3 0
15 0
48 0
18 0
0 0
33 0
40 16
0 0
0 45
0 22
46 6
241
201 109
0 33
0 0
164...

output:

Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almo...

result:

ok 40 lines

Test #23:

score: 4
Accepted
time: 133ms
memory: 45100kb

input:

40
959
287
0 152
0 214
145 251
259 0
0 0
0 227
202 0
217 0
0 0
0 0
125 0
0 82
98 229
0 0
0 285
271 192
0 249
144 0
0 0
0 0
19 106
96 0
0 176
185 241
65 0
254 0
137 14
0 0
66 0
127 283
0 0
36 200
51 0
237 86
0 57
0 0
244 0
0 44
0 0
0 267
69 0
0 0
17 0
32 0
0 0
0 89
58 0
226 39
0 0
245 203
0 157
42 78...

output:

Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almo...

result:

ok 40 lines

Test #24:

score: 4
Accepted
time: 137ms
memory: 46896kb

input:

40
951
232
176 3
146 0
84 69
17 190
105 22
62 142
158 163
0 197
0 0
0 0
0 0
0 112
0 0
59 0
208 95
182 173
0 231
0 0
0 0
0 0
0 93
223 138
0 203
0 0
43 55
0 15
0 126
86 0
0 0
127 0
0 0
0 0
0 124
0 0
0 0
230 52
154 181
0 42
0 0
16 175
0 0
45 201
192 44
128 99
82 174
136 184
0 0
0 39
0 0
0 0
70 0
80 145...

output:

Almost Complete
Almost Complete
No
Almost Complete
No
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almost Complete
N...

result:

ok 40 lines

Test #25:

score: 4
Accepted
time: 145ms
memory: 46304kb

input:

40
958
98
0 72
0 0
0 0
2 40
0 57
0 0
58 0
0 0
0 0
24 0
50 51
0 0
0 10
0 0
41 55
26 67
22 0
36 88
0 0
61 38
0 0
0 39
0 0
23 85
18 45
0 5
0 78
0 68
94 0
44 0
17 0
7 12
59 60
0 33
0 28
0 0
56 0
47 25
0 81
0 0
0 0
46 29
0 0
0 15
0 0
0 0
0 0
6 84
0 73
0 0
93 63
53 54
0 0
92 96
97 0
0 76
89 0
71 86
14 74
...

output:

Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
No
Almost Complete
Almost Complete
Almost Complete
Almost Complete
No
Almo...

result:

ok 40 lines

Extra Test:

score: 0
Extra Test Passed