QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#716617#9546. Recover Statisticsblhxzjr#WA 3ms3532kbC++23871b2024-11-06 15:40:582024-11-06 15:40:59

Judging History

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

  • [2024-11-06 15:40:59]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3532kb
  • [2024-11-06 15:40:58]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;

const int N=2e5+10;

int n,m,k,q;
string s;
void solve(){
	set<int>st;
	cin>>n>>m>>q;
	int id=0,rk=m;
	vector<int>a(m+1,0);
	for(int i=1;i<=q;i++){
		int op,idd,x;
		cin>>op>>idd;
		if(op!=1) cin>>x;
		if(id==0&&op!=1) continue;
		if(op==1){
			id=idd;
			rk=m;
			st.clear();
		}
		else if(op==2){
			if(x!=id) continue;
			if(st.count(idd)) continue;
			a[idd]+=rk; rk--;
			st.insert(idd);
		}
		else{
			if(x!=id) continue;
			if(st.count(idd)) continue;
			st.insert(idd);
		}
	}
	vector<pair<int,int>>b;
	for(int i=1;i<=m;i++){
		b.push_back({-a[i],i});
	}
	sort(b.begin(),b.end());
	for(auto z:b){
		auto x=z.first;
		auto y=z.second;
		cout<<y<<' '<<-x<<endl;
	}
}
signed main(){
	ios::sync_with_stdio(0),cin.tie(0);
	int t; cin>>t;
	while(t--) solve();
	return 0;
} 

详细

Test #1:

score: 0
Wrong Answer
time: 3ms
memory: 3532kb

input:

50
95
99

output:

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

result:

wrong answer Integer parameter [name=n] equals to 1, violates the range [100, 100000]