QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#490177 | #5750. Siteswap | ucup-team1525# | WA | 0ms | 3884kb | C++20 | 712b | 2024-07-25 12:31:41 | 2024-07-25 12:31:41 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int n;
const int N=200005;
int a[N];
void solve()
{
scanf("%d",&n);
for (int i=1;i<=n;++i)
scanf("%d",&a[i]);
if (n%2==1)
{
for (int i=1;i<=n;++i)
a[i+n]=a[i];
n*=2;
}
long long sumz=0,sumy=0,sumall=0;
for (int i=1;i<=n;++i)
{
if (a[i]%2==1)
sumall+=a[i];
else
{
if (i%2==1)
sumz+=a[i];
else
sumy+=a[i];
}
}
printf("%lld %lld %lld\n",sumz/n,sumy/n,sumall/n);
}
int main()
{
int t;
scanf("%d",&t);
while (t--)
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3884kb
input:
3 3 1 5 0 6 4 6 4 0 4 0 2 6 4
output:
0 0 2 2 1 0 3 2 0
result:
ok 9 numbers
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3872kb
input:
100 10 94 8 4 52 7 53 16 96 29 1 10 23 35 96 34 86 39 16 72 63 96 10 51 2 46 21 15 31 41 28 42 83 10 75 67 64 88 46 98 3 17 14 98 10 24 77 54 48 16 37 23 88 99 84 10 52 93 44 87 84 80 37 22 73 28 10 35 80 96 60 75 19 100 63 54 88 10 38 49 63 68 29 67 3 57 68 48 10 89 57 51 21 61 16 100 73 99 83 10 6...
output:
11 15 9 19 20 16 8 3 24 12 28 16 9 22 23 18 13 29 25 22 19 10 11 26 10 1 53 6 4 19 13 14 29 9 11 27 15 23 9 12 10 18 9 4 34 20 7 9 18 21 24 11 19 34 9 14 18 3 5 35 20 12 21 8 3 42 14 8 48 24 19 0 16 8 32 13 13 14 18 12 15 6 27 24 7 6 31 8 9 21 11 13 7 10 14 17 12 16 34 9 13 21 23 26 18 5 9 39 22 13 ...
result:
wrong answer 1st numbers differ - expected: '2', found: '11'