QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#842273 | #9964. Frogs | ucup-team1004# | WA | 0ms | 4032kb | C++20 | 1.4kb | 2025-01-04 11:24:59 | 2025-01-04 11:25:00 |
Judging History
answer
#include<bits/stdc++.h>
#define Gc() getchar()
#define Me(x,y) memset(x,y,sizeof(x))
#define Mc(x,y) memcpy(x,y,sizeof(x))
#define d(x,y) ((m)*(x-1)+(y))
#define R(n) (rnd()%(n)+1)
#define Pc(x) putchar(x)
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second
#define eb emplace_back
#define all(x) x.begin(),x.end()
using namespace std;using ll=long long;using db=double;using lb=long db;using ui=unsigned;using ull=unsigned long long;using pii=pair<int,int>;
const int N=3e6+5,M=(1<<8)+5,K=1000+5,mod=1e9+7,Mod=mod-1;const db eps=1e-9;const int INF=1e9+7;mt19937 rnd(28382);
#define Tp template<typename T>
#define Ts template<typename T,typename... Ar>
namespace Debug{
Tp void _debug(char* f,T t){cerr<<f<<'='<<t<<endl;}
Ts void _debug(char* f,T x,Ar... y){while(*f!=',') cerr<<*f++;cerr<<'='<<x<<",";_debug(f+1,y...);}
#ifdef LOCAL
#define gdb(...) _debug((char*)#__VA_ARGS__,__VA_ARGS__)
#else
#define gdb(...) void()
#endif
}using namespace Debug;
int n;ll k,A[N];
void Solve(){
scanf("%d%lld",&n,&k);
for(int i=1;i<=n;i++) scanf("%lld",&A[i]);
for(int i=1;i<=n;i++) A[i]=(A[i]%(2*k)+2*k)%(2*k);
int cnt=0;
for(int i=2;i<=n;i++){
if(A[i-1]<=A[i]) cnt++;
else cnt--;
printf("%d",cnt+(A[i]<=A[1]?1:-1)!=0);
}
printf("\n");
}
int main(){
int t=1;
scanf("%d",&t);
while(t--) Solve();
cerr<<clock()*1.0/CLOCKS_PER_SEC<<'\n';
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 4032kb
input:
6 2 4 3 -3 5 100 100
output:
0 0101 0101 0101 0101 0101
result:
wrong answer 1st lines differ - expected: '01011', found: '0'