QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#774793#5140. Frozen Scoreboardszy10010AC ✓302ms34964kbC++234.2kb2024-11-23 13:52:002024-11-23 13:52:00

Judging History

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

  • [2024-11-23 13:52:00]
  • 评测
  • 测评结果:AC
  • 用时:302ms
  • 内存:34964kb
  • [2024-11-23 13:52:00]
  • 提交

answer

#include <map>
#include <set>
#include <queue>
#include <deque>
#include <cmath>
#include <vector>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <unordered_map>
using namespace std;
#define fi first
#define se second
#define u1 (u<<1)
#define u2 (u<<1|1)
#define pb push_back
#define pp pop_back()
#define int long long
#define laile cout<<"laile"<<endl
#define lowbit(x) ((x)&(-x))
#define double long double
#define sf(x) scanf("%lld",&x)
#define sff(x,y) scanf("%lld %lld",&x,&y)
#define sd(x) scanf("%Lf",&x)
#define sdd(x,y) scanf("%Lf %Lf",&x,&y)
#define _for(i,n) for(int i=0;i<(n);++i)
#define _rep(i,a,b) for(int i=(a);i<=(b);++i)
#define _pre(i,a,b) for(int i=(a);i>=(b);--i)
#define all(x) (x).begin(), (x).end()
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
typedef unsigned long long ULL;
typedef pair<int,int>PII;
typedef pair<double,double>PDD;
const int N=1e6+10,INF=4e18;
int n,p,m;
string s[N];
int ac,nowpen;
struct aa
{
	bool bl;
	int submit;
	int must;
	int finalsubmit;
	int pen;
	int id;
};
vector<aa>v;
void deal1(string &s)
{
	bool bl=false;
	int x=0,y=0;
	_for(i,s.size())
	{
		if(isdigit(s[i]))
		{
			if(!bl)x=x*10+s[i]-'0';
			else y=y*10+s[i]-'0';
		}
		if(s[i]=='/')bl=true;
	}
	nowpen-=(x-1)*20;
	nowpen-=y;
	ac--;
}
void deal2(string &s,int id)
{
	bool bl=false;
	int x=0,y=0;
	_for(i,s.size())
	{
		if(isdigit(s[i]))
		{
			if(!bl)x=x*10+s[i]-'0';
			else y=y*10+s[i]-'0';
		}
		if(s[i]==' '&&x)bl=true;
	}
	v.pb({false,x,y-x,0,0,id});
}
bool pan[20];//判断是否?变+
void solve()
{
	cin>>ac>>nowpen;
	getline(cin,s[0]);
	v.clear();
	_rep(i,1,m)
	{
		pan[i]=false;
		getline(cin,s[i]);
		if(s[i][0]=='.'||s[i][0]=='-')continue;
		if(s[i][0]=='+')deal1(s[i]);
		if(s[i][0]=='?')deal2(s[i],i);
	}
	if(nowpen<0)
	{
		cout<<"No\n";
		return ;
	}
	if(ac==0)
	{
		if(nowpen==0)
		{
			cout<<"Yes\n";
			_rep(i,1,m)
			{
				if(s[i][0]!='?')cout<<s[i]<<"\n";
				else 
				{
					cout<<"- ";
					for(auto k:v)
					{
						if(k.id==i)
						{
							cout<<k.must+k.submit<<'\n';
							break;
						}
					}
				}
			}
		}
		else cout<<"No\n";
		return;
	}
//	cout<<"nowpen="<<nowpen<<endl;
//	cout<<v.size()<<" "<<ac<<endl;
	for(int i=0;i<1<<(int)v.size();i++)
	{
		int pen=nowpen;
		bool panduan=false;
		int l=0,r=0,sumsubmit=0,cnt1=0;
		int minneed;//最少需要多提交次数
		for(int j=0;j<(int)v.size();j++)
		{
			if(i>>j&1)
			{
				l+=240;
				r+=299;
				pen-=v[j].must*20;
				sumsubmit+=v[j].submit-1;
				//可能产生罚时的提交
				cnt1++;
				v[j].bl=true;
			}
			else v[j].bl=false;
		}
		/*
		bool bl;
		int submit;
		int must;
		int finalsubmit;
		int pen;
		int id;
		*/
		if(cnt1!=ac)continue;
//		cout<<"sumsubmit="<<cnt1<<" "<<sumsubmit<<" "<<pen<<" "<<l<<" "<<r<<endl;
//		cout<<"l,r="<<l<<"    "<<r<<endl;
		if(pen<l)continue;
		else if(pen>=l&&pen<=r)
			minneed=0;
		else 
		{
			minneed=((pen-r)+19)/20;
			pen-=minneed*20;
		}
//		cout<<"minneed pen="<<minneed<<" "<<pen<<endl;
//		cout<<"minneed subsubmit"<<minneed<<" "<<sumsubmit<<endl;
		if(minneed>sumsubmit)continue;
//		cout<<"ac="<<ac<<endl;
		int chu=pen/ac,yu=pen%ac,cnt=0;
		for(int j=0;j<(int)v.size();j++)
		{
			if(i>>j&1)
			{
				if(++cnt<=yu)v[j].pen=chu+1;
				else v[j].pen=chu;
				if(minneed>v[j].submit-1)
					v[j].finalsubmit=v[j].must+v[j].submit,minneed-=v[j].submit-1;
				else 
					v[j].finalsubmit=v[j].must+minneed+1,minneed=0;
				pan[v[j].id]=true;
			}
		}
		cout<<"Yes\n";
//		cout<<"m="<<m<<endl;
		for(int j=1;j<=m;j++)
		{
//			cout<<"j="<<j<<endl;
			if(!pan[j])
			{
				if(s[j][0]!='?')cout<<s[j]<<'\n';
				else 
				{
					cout<<"- ";
					for(auto k:v)
					{
						if(k.id==j)
						{
							cout<<k.must+k.submit<<'\n';
							break;
						}
					}
				}
			}
			else
			{
				for(auto k:v)
				{
					if(k.id==j)
					{
						cout<<"+ "<<k.finalsubmit<<"/"<<k.pen<<'\n';
						break;
					}
				}
			}
		}
		return ;
	}
	cout<<"No\n";
	return ;
}
signed main()
{
	IOS;
	int T=1;
    cin>>T>>m;
	while(T--)
		solve();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 34884kb

input:

1 13
7 951
+ 1/6
? 3 4
+ 4/183
- 2
+ 3/217
.
.
.
+ 2/29
+ 1/91
.
+ 1/22
.

output:

Yes
+ 1/6
+ 2/263
+ 4/183
- 2
+ 3/217
.
.
.
+ 2/29
+ 1/91
.
+ 1/22
.

result:

ok ok (1 test case)

Test #2:

score: 0
Accepted
time: 0ms
memory: 34884kb

input:

6 2
1 100
.
? 3 4
2 100
+ 1/1
+ 1/2
0 0
- 5
- 6
2 480
? 100 100
? 100 100
2 480
? 99 100
? 100 100
1 2000
? 100 100
? 100 100

output:

No
No
Yes
- 5
- 6
Yes
+ 1/240
+ 1/240
No
Yes
+ 87/280
- 100

result:

ok ok (6 test cases)

Test #3:

score: 0
Accepted
time: 4ms
memory: 34812kb

input:

1000 13
6 1519
+ 3/183
- 1
+ 9/133
? 2 3
- 5
? 1 3
- 5
? 1 1
? 1 3
- 5
+ 1/165
- 6
? 2 5
2 570
- 2
- 9
.
- 1
- 7
- 6
+ 4/179
- 2
? 2 5
.
- 2
? 1 3
.
1 140
.
- 2
.
- 2
- 1
- 2
- 2
.
.
.
.
+ 3/100
.
1 195
+ 1/195
.
.
.
.
.
.
.
.
? 1 1
.
.
.
0 0
.
.
.
.
.
.
.
.
.
.
.
.
.
3 776
? 8 22
? 1 8
- 6
+ 1/173
...

output:

Yes
+ 3/183
- 1
+ 9/133
+ 2/260
- 5
+ 3/259
- 5
+ 1/259
- 3
- 5
+ 1/165
- 6
- 5
Yes
- 2
- 9
.
- 1
- 7
- 6
+ 4/179
- 2
+ 4/271
.
- 2
- 3
.
Yes
.
- 2
.
- 2
- 1
- 2
- 2
.
.
.
.
+ 3/100
.
Yes
+ 1/195
.
.
.
.
.
.
.
.
- 1
.
.
.
Yes
.
.
.
.
.
.
.
.
.
.
.
.
.
Yes
- 22
- 8
- 6
+ 1/173
- 11
- 9
- 3
- 6
+ 4/29...

result:

ok ok (1000 test cases)

Test #4:

score: 0
Accepted
time: 6ms
memory: 34812kb

input:

1000 13
0 0
.
.
.
- 1
.
- 5
.
- 2
- 2
- 1
- 9
- 2
.
0 0
- 7
- 1
? 2 2
- 2
- 4
.
- 1
- 3
- 6
- 1
? 4 6
.
- 1
2 480
+ 4/120
- 3
- 5
.
- 11
- 1
- 4
- 4
- 3
? 13 22
.
+ 9/140
? 1 5
3 465
.
.
.
+ 1/124
.
+ 1/139
.
.
+ 1/202
.
.
.
.
3 885
- 1
- 4
- 4
+ 4/158
.
+ 9/138
? 1 8
.
? 1 3
.
- 4
? 2 5
.
6 970
- 4...

output:

Yes
.
.
.
- 1
.
- 5
.
- 2
- 2
- 1
- 9
- 2
.
Yes
- 7
- 1
- 2
- 2
- 4
.
- 1
- 3
- 6
- 1
- 6
.
- 1
Yes
+ 4/120
- 3
- 5
.
- 11
- 1
- 4
- 4
- 3
- 22
.
+ 9/140
- 5
Yes
.
.
.
+ 1/124
.
+ 1/139
.
.
+ 1/202
.
.
.
.
Yes
- 1
- 4
- 4
+ 4/158
.
+ 9/138
- 8
.
- 3
.
- 4
+ 5/289
.
No
Yes
- 2
+ 1/205
- 1
+ 1/106
- 1...

result:

ok ok (1000 test cases)

Test #5:

score: 0
Accepted
time: 3ms
memory: 34880kb

input:

1000 13
5 1620
- 2
- 1
? 2 4
? 4 5
+ 6/213
.
+ 6/231
? 2 4
+ 7/215
.
.
? 2 6
? 1 1
2 975
? 1 4
- 2
- 6
.
? 2 12
? 1 4
? 2 7
- 3
- 1
? 2 19
? 2 2
- 2
? 1 1
0 0
.
.
- 3
- 1
.
- 1
- 4
.
- 1
.
- 1
- 1
- 3
4 1342
.
- 6
- 2
- 4
- 8
- 6
+ 14/95
? 2 2
? 1 9
? 6 10
- 7
+ 4/205
? 3 5
5 1019
.
.
.
+ 2/116
.
- ...

output:

Yes
- 2
- 1
+ 3/291
+ 2/290
+ 6/213
.
+ 6/231
- 4
+ 7/215
.
.
- 6
- 1
Yes
+ 4/288
- 2
- 6
.
- 12
- 4
- 7
- 3
- 1
+ 18/287
- 2
- 2
- 1
Yes
.
.
- 3
- 1
.
- 1
- 4
.
- 1
.
- 1
- 1
- 3
Yes
.
- 6
- 2
- 4
- 8
- 6
+ 14/95
+ 1/281
+ 9/281
- 10
- 7
+ 4/205
- 5
Yes
.
.
.
+ 2/116
.
- 1
+ 3/127
.
.
+ 1/275
+ 4/1...

result:

ok ok (1000 test cases)

Test #6:

score: 0
Accepted
time: 3ms
memory: 34808kb

input:

1000 13
0 0
.
.
.
.
- 1
.
? 1 4
.
.
- 1
.
.
- 1
5 1008
- 2
- 2
.
+ 4/157
.
.
+ 2/145
- 3
+ 2/125
.
+ 1/233
+ 4/188
- 5
0 0
.
.
? 1 1
.
.
.
.
.
.
.
.
.
.
6 1359
+ 1/100
+ 2/144
- 4
+ 2/238
- 2
- 2
+ 4/107
+ 4/214
.
? 3 6
+ 9/236
- 4
- 6
8 3064
+ 20/155
.
- 17
- 11
? 9 10
? 11 30
- 1
? 6 13
+ 6/113
+ ...

output:

Yes
.
.
.
.
- 1
.
- 4
.
.
- 1
.
.
- 1
Yes
- 2
- 2
.
+ 4/157
.
.
+ 2/145
- 3
+ 2/125
.
+ 1/233
+ 4/188
- 5
Yes
.
.
- 1
.
.
.
.
.
.
.
.
.
.
Yes
+ 1/100
+ 2/144
- 4
+ 2/238
- 2
- 2
+ 4/107
+ 4/214
.
- 6
+ 9/236
- 4
- 6
Yes
+ 20/155
.
- 17
- 11
+ 2/261
+ 20/261
- 1
- 13
+ 6/113
+ 2/221
+ 4/260
+ 12/151
...

result:

ok ok (1000 test cases)

Test #7:

score: 0
Accepted
time: 3ms
memory: 34872kb

input:

1000 13
2 501
? 1 8
- 1
+ 4/208
- 5
- 1
- 19
+ 4/173
- 11
.
- 11
? 1 1
.
- 10
4 599
- 2
.
- 12
.
+ 1/142
+ 3/85
- 3
? 4 8
+ 4/80
.
- 1
.
+ 3/152
13 3774
? 2 7
? 2 3
+ 12/162
+ 2/112
+ 4/174
+ 12/156
+ 2/163
+ 2/168
+ 12/186
+ 6/191
+ 8/43
? 1 2
? 1 16
8 2408
? 2 5
? 1 1
? 6 14
+ 4/204
.
+ 2/97
+ 2/2...

output:

Yes
- 8
- 1
+ 4/208
- 5
- 1
- 19
+ 4/173
- 11
.
- 11
- 1
.
- 10
Yes
- 2
.
- 12
.
+ 1/142
+ 3/85
- 3
- 8
+ 4/80
.
- 1
.
+ 3/152
No
Yes
+ 5/294
+ 1/294
+ 9/294
+ 4/204
.
+ 2/97
+ 2/222
+ 10/230
.
- 7
.
- 1
+ 2/233
Yes
.
- 8
- 4
- 4
- 2
.
- 7
.
.
- 10
- 5
- 3
- 4
Yes
+ 5/267
+ 1/173
.
- 2
- 1
+ 5/238
-...

result:

ok ok (1000 test cases)

Test #8:

score: 0
Accepted
time: 282ms
memory: 34868kb

input:

1000 13
1 19917
? 30 39
? 79 81
? 32 33
? 35 95
? 14 84
? 6 17
? 11 31
? 5 8
? 34 89
? 38 50
? 10 10
? 22 54
? 5 92
1 16730
? 56 59
? 40 55
? 42 54
? 5 9
? 65 79
? 7 11
? 25 34
? 2 10
? 29 51
? 2 7
? 39 48
? 4 67
? 24 36
8 17772
? 17 35
? 36 46
? 42 63
? 2 11
? 59 84
? 4 36
? 9 21
? 76 86
? 48 89
? ...

output:

No
No
No
Yes
+ 95/295
+ 22/295
- 22
+ 72/295
- 8
- 8
+ 74/294
- 40
- 60
- 38
- 25
- 99
- 52
No
No
No
Yes
+ 54/298
+ 31/298
+ 52/298
+ 11/298
+ 20/298
+ 74/297
- 14
+ 50/297
+ 92/297
- 67
- 9
- 55
- 97
No
Yes
+ 75/296
+ 52/296
+ 23/295
- 3
- 9
- 89
- 17
- 79
- 44
- 71
- 39
- 44
- 12
No
No
No
No
No
Ye...

result:

ok ok (1000 test cases)

Test #9:

score: 0
Accepted
time: 281ms
memory: 34960kb

input:

1000 13
11 8761
? 14 96
? 9 35
? 12 16
? 28 55
? 2 27
? 6 7
? 17 50
? 25 31
? 4 11
? 62 98
? 10 19
? 3 3
? 9 13
6 12408
? 46 73
? 22 46
? 24 66
? 19 43
? 13 17
? 2 3
? 14 23
? 6 6
? 61 67
? 17 25
? 1 62
? 59 64
? 2 32
10 4393
? 11 90
? 19 58
? 61 98
? 42 43
? 55 69
? 32 35
? 26 70
? 2 5
? 14 65
? 16...

output:

Yes
+ 96/299
+ 32/299
+ 5/299
+ 28/298
+ 26/298
+ 2/298
+ 34/298
+ 7/298
+ 8/298
+ 37/298
+ 10/298
- 3
- 13
No
No
No
Yes
- 30
+ 65/295
- 30
- 33
+ 58/295
+ 80/295
+ 43/294
- 80
- 43
- 1
- 25
- 81
- 19
Yes
+ 11/241
+ 6/240
+ 50/240
+ 6/240
- 75
- 52
+ 4/240
+ 3/240
+ 1/240
+ 19/240
- 26
- 9
- 7
Yes
+...

result:

ok ok (1000 test cases)

Test #10:

score: 0
Accepted
time: 282ms
memory: 34936kb

input:

1000 13
8 4901
? 16 42
? 66 89
? 67 91
? 6 10
? 1 63
? 2 10
? 44 65
? 22 45
? 2 29
? 27 47
? 18 32
? 11 64
? 17 30
11 12279
? 65 99
? 20 33
? 57 71
? 20 68
? 38 58
? 4 4
? 2 4
? 19 95
? 58 74
? 23 39
? 29 71
? 17 49
? 4 32
3 11014
? 9 37
? 15 61
? 3 34
? 5 78
? 24 54
? 26 34
? 18 23
? 4 20
? 26 36
?...

output:

Yes
+ 27/241
+ 24/240
+ 25/240
+ 5/240
- 63
+ 9/240
+ 22/240
+ 24/240
- 29
+ 21/240
- 32
- 64
- 30
Yes
+ 99/299
+ 33/298
+ 71/298
+ 68/298
+ 32/298
+ 1/298
+ 3/298
+ 77/298
+ 17/298
+ 17/298
+ 43/298
- 49
- 32
No
No
No
No
No
Yes
- 9
+ 76/297
- 18
+ 87/297
- 10
- 12
- 3
+ 65/297
+ 89/297
- 25
+ 62/29...

result:

ok ok (1000 test cases)

Test #11:

score: 0
Accepted
time: 289ms
memory: 34964kb

input:

1000 13
5 2258
? 89 96
? 6 46
? 8 75
? 18 66
? 1 3
? 35 96
? 60 88
? 4 68
? 12 51
? 84 95
? 7 46
? 9 21
? 52 52
11 12149
? 27 29
? 11 32
? 61 76
? 89 94
? 26 96
? 80 97
? 89 89
? 25 84
? 20 90
? 51 57
? 60 89
? 18 35
? 3 28
8 10339
? 81 92
? 32 72
? 54 73
? 3 9
? 29 35
? 24 25
? 70 72
? 23 36
? 4 16...

output:

Yes
+ 8/260
- 46
- 75
- 66
+ 3/260
- 96
+ 29/260
- 68
- 51
+ 12/259
- 46
- 21
+ 1/259
Yes
+ 29/299
+ 32/299
+ 76/299
+ 59/299
+ 71/299
+ 18/299
+ 1/299
+ 60/299
+ 71/299
+ 7/299
+ 30/299
- 35
- 28
Yes
+ 92/298
+ 72/298
+ 73/298
+ 9/297
+ 35/297
+ 25/297
+ 72/297
+ 28/297
- 16
- 27
- 7
- 1
- 26
Yes
+...

result:

ok ok (1000 test cases)

Test #12:

score: 0
Accepted
time: 284ms
memory: 34956kb

input:

1000 13
6 11102
? 16 53
? 83 100
? 52 62
? 10 25
? 23 46
? 59 86
? 1 3
? 78 90
? 23 62
? 11 40
? 51 55
? 19 78
? 52 73
11 19315
? 48 48
? 14 23
? 13 89
? 2 28
? 27 29
? 97 98
? 30 70
? 77 80
? 67 97
? 10 83
? 4 11
? 4 28
? 1 24
10 16960
? 41 47
? 9 80
? 2 8
? 26 32
? 1 20
? 24 24
? 10 17
? 37 63
? 3...

output:

Yes
- 53
+ 100/297
+ 62/297
- 25
- 46
+ 86/297
- 3
+ 90/297
+ 62/297
- 40
- 55
+ 72/297
- 73
No
No
Yes
+ 62/299
+ 20/298
+ 66/298
- 26
+ 45/298
+ 57/298
+ 36/298
- 33
+ 53/298
- 16
- 100
- 81
- 79
No
Yes
+ 5/290
+ 43/289
- 88
+ 19/289
+ 3/289
+ 16/289
- 40
+ 3/289
- 63
- 16
- 80
- 19
- 57
No
No
Yes
...

result:

ok ok (1000 test cases)

Test #13:

score: 0
Accepted
time: 235ms
memory: 34832kb

input:

1000 13
6 2161
? 11 17
? 5 36
? 88 95
? 31 44
? 59 85
? 7 18
? 35 88
? 4 8
? 2 89
? 20 30
? 58 88
? 14 40
? 22 30
7 3123
? 19 30
? 15 19
? 84 90
? 65 84
? 59 71
? 9 54
? 2 92
? 2 9
? 21 42
? 15 44
? 17 33
? 32 99
? 19 19
7 3439
? 51 72
? 24 37
? 19 36
? 60 91
? 57 61
? 5 23
? 25 76
? 41 95
? 9 24
? ...

output:

No
Yes
+ 12/278
+ 5/278
+ 7/278
+ 20/278
+ 13/277
- 54
- 92
+ 8/277
- 42
- 44
- 33
- 99
+ 1/277
Yes
+ 22/243
+ 14/243
+ 18/243
- 91
+ 5/243
+ 19/243
- 76
- 95
- 24
+ 4/242
+ 12/242
- 97
- 12
Yes
- 59
+ 2/298
- 64
+ 4/298
+ 9/298
+ 3/298
- 58
+ 4/298
+ 1/298
- 95
- 19
- 80
- 11
No
No
No
Yes
+ 1/266
-...

result:

ok ok (1000 test cases)

Test #14:

score: 0
Accepted
time: 255ms
memory: 34884kb

input:

1000 13
6 2111
? 8 61
? 1 14
? 36 64
? 3 32
? 16 63
? 19 62
? 19 21
? 14 17
? 3 52
? 33 83
? 51 66
? 13 23
? 12 43
7 2808
? 5 8
? 21 85
? 10 22
? 23 84
? 17 50
? 24 61
? 3 6
? 4 63
? 7 30
? 25 76
? 18 92
? 23 39
? 19 39
6 1989
? 91 93
? 28 41
? 17 53
? 66 73
? 7 26
? 35 50
? 2 2
? 3 86
? 29 32
? 10 ...

output:

No
No
Yes
+ 3/245
+ 14/245
- 53
+ 8/245
- 26
- 50
+ 1/245
- 86
+ 4/245
- 44
- 22
+ 2/244
- 68
Yes
+ 3/272
+ 22/272
+ 4/272
+ 11/271
+ 35/271
+ 1/271
+ 1/271
- 71
- 82
- 90
- 89
- 43
- 86
No
No
Yes
+ 22/265
+ 20/265
+ 8/264
+ 8/264
- 87
+ 16/264
+ 3/264
- 35
- 15
- 69
- 53
- 29
- 63
No
No
No
No
No
No...

result:

ok ok (1000 test cases)

Test #15:

score: 0
Accepted
time: 302ms
memory: 34888kb

input:

1000 13
6 11435
? 11 17
? 5 36
? 88 95
? 31 44
? 59 85
? 7 18
? 35 88
? 4 8
? 2 89
? 20 30
? 58 88
? 14 40
? 22 30
7 12636
? 19 30
? 15 19
? 84 90
? 65 84
? 59 71
? 9 54
? 2 92
? 2 9
? 21 42
? 15 44
? 17 33
? 32 99
? 19 19
7 12572
? 51 72
? 24 37
? 19 36
? 60 91
? 57 61
? 5 23
? 25 76
? 41 95
? 9 24...

output:

Yes
- 17
- 36
+ 95/296
+ 44/296
+ 85/296
- 18
+ 88/296
- 8
+ 89/296
- 30
+ 88/295
- 40
- 30
No
Yes
+ 72/299
- 37
- 36
+ 91/299
+ 61/299
- 23
+ 76/299
+ 95/299
- 24
- 9
+ 39/299
+ 97/298
- 12
No
No
No
No
No
Yes
+ 87/299
- 11
+ 53/299
+ 70/299
+ 34/299
- 23
+ 66/298
- 27
- 25
+ 89/298
+ 36/298
- 22
- ...

result:

ok ok (1000 test cases)

Test #16:

score: 0
Accepted
time: 285ms
memory: 34896kb

input:

1000 13
6 9645
? 8 61
? 1 14
? 36 64
? 3 32
? 16 63
? 19 62
? 19 21
? 14 17
? 3 52
? 33 83
? 51 66
? 13 23
? 12 43
7 12161
? 5 8
? 21 85
? 10 22
? 23 84
? 17 50
? 24 61
? 3 6
? 4 63
? 7 30
? 25 76
? 18 92
? 23 39
? 19 39
6 10123
? 91 93
? 28 41
? 17 53
? 66 73
? 7 26
? 35 50
? 2 2
? 3 86
? 29 32
? 1...

output:

Yes
+ 61/298
- 14
+ 64/298
- 32
+ 63/298
+ 62/297
- 21
- 17
- 52
+ 83/297
+ 66/297
- 23
- 43
Yes
- 8
+ 85/298
- 22
+ 84/298
+ 50/297
+ 61/297
- 6
+ 63/297
- 30
+ 76/297
+ 92/297
- 39
- 39
Yes
+ 93/298
- 41
+ 53/297
+ 73/297
- 26
+ 50/297
- 2
+ 86/297
- 32
- 44
- 22
- 5
+ 68/297
No
No
Yes
+ 61/298
+ ...

result:

ok ok (1000 test cases)

Test #17:

score: 0
Accepted
time: 4ms
memory: 34804kb

input:

21 13
13 0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
12 0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
13 1
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
12 0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/...

output:

Yes
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
No
No
Yes
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
+ 1/0
- 1
No
Yes
.
.
.
.
.
.
.
.
.
.
.
.
.
No
Yes
- 100
- 100
- 100
- 100
- 100
- 100
- 100
- 100
- 100
- 100
- 100
- 100
- 100
Yes
- 100
- 10...

result:

ok ok (21 test cases)