QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#523844#6762. HotpotazWA 3ms9804kbC++20935b2024-08-18 19:41:422024-08-18 19:41:42

Judging History

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

  • [2024-08-18 19:41:42]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:9804kb
  • [2024-08-18 19:41:42]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
//#define endl "\n"
#define PII pair<int,int>
#define PIS pair<int,string>
#define fr(i,xxx,yyy) for(int i=xxx,ppp=yyy;i<=ppp;i++)
#define rp(i,xxx,yyy) for(int i=xxx,ppp=yyy;i>=ppp;i--)
const int N=1e6+10;
int mod=998244353;
int a[N],b[N],c[N],d[N];
void solve(){
	int n,m,k;
	cin>>n>>m>>k;
	fr(i,1,2*n+5){
		a[i]=b[i]=c[i]=d[i]=0;
	}
	fr(i,1,n){
		cin>>a[i];
		a[i+n]=a[i];
	}
	int t=k/(n*2);
	fr(i,1,2*n){
		if(b[a[i]]){
			c[(i+n-1)%n+1]++;
			b[a[i]]=0;
		}else b[a[i]]++;
	}
	fr(i,1,n){
		d[i]+=t*c[i];
	}
	fr(i,1,m){
		b[i]=0;
	}
	fr(i,1,k%(2*n)){
		if(b[a[i]]){
			d[(i+n-1)%n+1]++;
			b[a[i]]=0;
		}else b[a[i]]++;
	}
	fr(i,1,n){
		if(i>1)cout<<" ";
		cout<<d[i];
	}cout<<endl;
}
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	int n=1;
	cin>>n;
	while(n--)
	solve();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

4
3 2 6
1 1 2
1 1 5
1
2 2 10
1 2
2 2 10
1 1

output:

0 2 1
2
2 2
0 5

result:

ok 4 lines

Test #2:

score: -100
Wrong Answer
time: 3ms
memory: 9764kb

input:

1000
2 73 291100997
46 23
40 2 11764377
1 2 2 2 1 2 2 2 1 2 2 2 2 1 1 1 2 2 2 1 2 2 1 1 1 1 1 1 1 1 1 1 2 1 2 1 2 2 1 1
29 20 781370886
4 9 7 4 10 4 1 6 19 15 20 9 20 18 7 4 7 13 18 4 13 13 10 15 15 9 20 5 3
53 95 911403367
44 41 65 63 37 8 15 9 47 83 44 91 23 89 59 60 5 19 77 24 73 35 30 79 1 94 92...

output:

72775249 72775249
147055 147055 147055 147055 147055 147055 147055 147055 147055 147055 147055 147055 147055 147055 147055 147055 147055 147055 147054 147054 147055 147054 147055 147054 147055 147054 147055 147054 147055 147054 147055 147054 147055 147055 147054 147054 147055 147054 147055 147054
13...

result:

wrong answer 280th lines differ - expected: '13530354 13530354 13530354 0 1...0708 13530354 13530354 13530353', found: '13530354 13530354 13530354 0 1...0708 13530354 13530354 13530353'