QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#201701 | #7337. Grasshoppers | pengpeng_fudan | WA | 55ms | 5000kb | C++14 | 644b | 2023-10-05 16:16:26 | 2023-10-05 16:16:27 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a[100010];
ll b[100010];
void solve(){
ll n,m,t;
cin>>n>>m>>t;
for(int i=0;i<n;i++)cin>>a[i];
t=(t-1)%(m*m-1)+1;
for(int i=0;i<t;i++){
for(int j=0;j<n;j++)b[j]=(2*a[(j+1)%n]-a[j]-1+m*2)%m+1;
for(int j=0;j<n;j++)a[j]=b[j];
//for(int j=0;j<n;j++)cout<<a[j]<<" ";
//cout<<"\n";
}
for(int i=0;i<n;i++)cout<<a[i]<<" ";
//cout<<"\n";
cout<<"\n";
}
int main(){
ios::sync_with_stdio(0);
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: 3556kb
input:
2 3 5 1 1 1 2 3 5 4 1 1 2
output:
1 3 5 5 4 5
result:
ok 6 numbers
Test #2:
score: -100
Wrong Answer
time: 55ms
memory: 5000kb
input:
92 3 5 5 4 2 3 3 5 5 3 1 5 3 5 5 4 3 5 3 5 5 3 3 2 3 5 5 1 3 3 3 5 5 2 3 3 3 5 5 3 3 2 3 5 5 4 2 5 3 5 5 1 2 4 3 5 5 4 5 1 3 5 5 4 1 4 3 5 5 1 1 2 3 5 5 1 1 4 3 5 5 1 1 4 3 5 5 5 2 4 3 5 5 5 5 1 3 5 5 2 5 5 3 5 5 3 2 5 3 5 5 1 2 3 3 5 5 1 1 1 3 5 5 4 3 1 3 5 5 1 3 4 3 5 5 1 5 1 3 5 5 1 4 4 3 5 5 5 2...
output:
2 1 1 2 5 2 1 5 1 1 3 4 5 4 3 4 1 3 1 3 4 1 1 4 2 5 5 3 3 4 4 2 3 3 1 5 2 1 3 2 1 3 3 3 5 2 5 4 3 4 5 2 4 4 5 5 1 1 1 1 3 5 5 2 4 2 1 2 4 2 3 4 5 3 4 3 4 2 4 3 5 2 5 5 4 4 1 2 5 1 1 1 5 2 5 2 1 5 1 1 1 1 2 2 5 4 3 4 4 2 2 1 2 5 2 5 4 3 3 1 4 4 5 5 5 1 4 3 3 ...
result:
wrong answer 481st numbers differ - expected: '35', found: '91'