QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#492316 | #4912. WereYouLast | Others | Compile Error | / | / | C++14 | 1.2kb | 2024-07-26 11:22:32 | 2024-07-26 11:22:34 |
Judging History
answer
#include <bits/stdc++.h>
#define ll long long
#define int long long
#define wdnmd const int mod=::mod;
#define lb(i) ((i)&(-(i)))
#define wr(x,ch) write(x),putchar(ch)
using namespace std;
#define gh() getchar()
bool query(int);
void modify(int,bool);
inline long long read(){
char ch=gh();
long long x=0;
char t=0;
while(ch<'0'||ch>'9') t|=ch=='-',ch=gh();
while(ch>='0'&&ch<='9') x=x*10+(ch^48),ch=gh();
return t?-x:x;
}
void write(ll x) {
if(x<0) putchar('-'),x=-x;
if(x>=10) write(x/10);
putchar(x%10^48);
return ;
}
int f(int *a,int tt) {
int t=0;
for(int i=0;i<tt;i++) t+=(a[i]<<i);
return t;
}
bool WereYouLast(int n,int m) {
if(m==10) {
int a[10];
for(int i=0;i<10;i++) a[i]=query(i);
int t=f(a,10);
if(t==1023) return 1;
for(int i=0;i<10;i++) {
if(!a[i]) {
modify(i,1);
break;
}
modify(i,0);
}
return 0;
}
int a[5];
for(int i=0;i<5;i++) a[i]=query(i);
int t=f(a,5);
if(t==n) return 1;
int p=query(t);
if(p==0) {
modify(t,1);
for(int i=0;i<5;i++)
modify(i,0);
return 0;
}
modify(t,0);
for(int i=0;i<5;i++) {
if(!a[i]) {
modify(i,1);
return 0;
}
modify(i,0);
}
return 0;
}
Details
/usr/bin/ld: /tmp/cc9QMfHx.o: in function `qWqautomaton::main1()': implementer.cpp:(.text+0x270): undefined reference to `WereYouLast(int, int)' /usr/bin/ld: /tmp/cc9QMfHx.o: in function `qWqautomaton::main2()': implementer.cpp:(.text+0x38a): undefined reference to `WereYouLast(int, int)' /usr/bin/ld: /tmp/cc3ZZ9pu.o: in function `WereYouLast(long long, long long)': answer.code:(.text+0x1a4): undefined reference to `query(long long)' /usr/bin/ld: answer.code:(.text+0x1e2): undefined reference to `query(long long)' /usr/bin/ld: answer.code:(.text+0x1f6): undefined reference to `modify(long long, bool)' /usr/bin/ld: answer.code:(.text+0x20f): undefined reference to `modify(long long, bool)' /usr/bin/ld: answer.code:(.text+0x244): undefined reference to `query(long long)' /usr/bin/ld: answer.code:(.text+0x299): undefined reference to `modify(long long, bool)' /usr/bin/ld: answer.code:(.text+0x2bb): undefined reference to `modify(long long, bool)' /usr/bin/ld: answer.code:(.text+0x2ca): undefined reference to `modify(long long, bool)' /usr/bin/ld: answer.code:(.text+0x2e9): undefined reference to `modify(long long, bool)' collect2: error: ld returned 1 exit status