QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#843402 | #9964. Frogs | Flammable Dumpster (Lin Wu, Pengrui Zhu, Qingyang Li)# | WA | 1ms | 7728kb | C++20 | 493b | 2025-01-04 18:44:06 | 2025-01-04 18:44:07 |
Judging History
answer
#include<iostream>
#include<vector>
#include<cstring>
using namespace std;
int n,k,a[500010],A[500010];
bool op[500010];
int main()
{
cin>>n>>k;
for(int i=1;i<=n;i++)
{
cin>>a[i];
A[i]=a[i];
}
for(int i=1;i<=n;i++)
{
op[i]=(a[i]%k<=a[i%n+1]%k);
}
for(int i=1;i<=n;i++)
{
a[i]=a[i]/k&1;
}
for(int i=2,cnt=0;i<=n;i++)
{
cnt+=(a[i-1]==a[i])?(op[i]?1:-1):0;
cout<<bool(cnt+((a[1]==a[i])?((A[i]%k<=A[1]%k)?1:-1):0));
}
cout<<endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 5688kb
input:
6 2 4 3 -3 5 100 100
output:
01011
result:
ok single line: '01011'
Test #2:
score: 0
Accepted
time: 1ms
memory: 5616kb
input:
2 10 -9 -18
output:
0
result:
ok single line: '0'
Test #3:
score: 0
Accepted
time: 0ms
memory: 5684kb
input:
2 3 10 7
output:
0
result:
ok single line: '0'
Test #4:
score: 0
Accepted
time: 0ms
memory: 5732kb
input:
2 3 10 4
output:
1
result:
ok single line: '1'
Test #5:
score: 0
Accepted
time: 1ms
memory: 5616kb
input:
2 1000000000 0 0
output:
1
result:
ok single line: '1'
Test #6:
score: 0
Accepted
time: 1ms
memory: 7728kb
input:
2 1000000000 999999999 1000000000
output:
0
result:
ok single line: '0'
Test #7:
score: 0
Accepted
time: 1ms
memory: 7720kb
input:
3 1 -6 -2 0
output:
11
result:
ok single line: '11'
Test #8:
score: -100
Wrong Answer
time: 1ms
memory: 5624kb
input:
4 7 -142973635 -432776724 -308791196 375008845
output:
010
result:
wrong answer 1st lines differ - expected: '011', found: '010'