QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#654463#9178. All-You-Can-Eatwoodie_0064#WA 1ms3764kbC++201.0kb2024-10-18 21:36:432024-10-18 21:36:47

Judging History

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

  • [2024-10-18 21:36:47]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3764kb
  • [2024-10-18 21:36:43]
  • 提交

answer

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
const int N = 1e5 + 3;
int T;
int n, num;


void work(){
	cin >> n;
	int p = 0; vector<int> cake(n+1);
	vector<int> have; int s = 0, big = 0, idd = 0;
	for(int i = 1; i <= n; ++i){
		cin >> cake[i];
		if(p)	cout << "0\nIGNORE\n" << flush;
		if(cake[i] >= 600){
			cout << have.size() << " ";
			for(auto x : have) cout << x << " ";
			cout << "\nTAKE\n" << flush; 
			p = 1;
		}else if(cake[i] <= 400){
			cout << "0\nTAKE\n" << flush;
			s += cake[i];
			have.push_back(i);
		}else{
			if(!big){
				cout << "0\nTAKE\n" << flush;
				big = cake[i], s += cake[i], idd = i;
			}else if(cake[i] < big){
				cout << "1 " << idd << "\nTAKE\n" << flush;
				s = s - big + cake[i], idd = i;
			}else{
				cout << "0\nIGNORE\n" << flush;
			}
		}	
		if(s >= 600)	p = 1;		
	}
}


int main(){
//	freopen("test.txt", "r", stdin);
//	ios::sync_with_stdio(false);
//	cin.tie(0);
	int T = 1;
	cin >> T;
	while(T--){
		work();
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3764kb

input:

1
5
10
13
450
585
465

output:

0
TAKE
0
TAKE
0
TAKE
0
IGNORE
0
IGNORE

result:

wrong answer alg = 473 opt = 938 (test case 1)