QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#492356#4912. WereYouLastOthers10 4489ms5124kbC++141.2kb2024-07-26 11:36:552024-07-26 11:36:55

Judging History

你现在查看的是最新测评结果

  • [2024-07-26 11:36:55]
  • 评测
  • 测评结果:10
  • 用时:4489ms
  • 内存:5124kb
  • [2024-07-26 11:36:55]
  • 提交

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()
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 ;
}
bool query(int);
void modify(int,bool);
bool WereYouLast(int n,int m) {
	if(m==10) {
		int a[10];
		for(int i=0;i<10;i++) a[i]=query(i+1);
		int t=0;
		for(int i=0;i<10;i++) t|=(a[i]<<i);
		if(t==1023) return 1;
		for(int i=0;i<10;i++) {
			if(!a[i]) {
				modify(i+1,1);
				break;
			}
			modify(i+1,0);
		}
		return 0;
	}
	int a[5];
	for(int i=0;i<5;i++) a[i]=query(i+1);
	int t=0;
	for(int i=0;i<5;i++) t|=(a[i]<<i);
	if(t==n) return 1;
	int p=query(t+6);
	if(p==0&&t!=n-1) {
		modify(t+6,1);
		for(int i=0;i<5;i++) 
			modify(i+1,0);
		return 0;
	}
	modify(t+6,0);
	for(int i=0;i<5;i++) {
		if(!a[i]) {
			modify(i+1,1);
			return 0;
		}
		modify(i+1,0);
	}
	return 0;
}

详细

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 0ms
memory: 3764kb

input:

1024 10

output:

12345876 10 10

result:

ok Correct Answer.
C1 = 10.
C2 = 10.

Subtask #2:

score: 0
Wrong Answer

Test #2:

score: 0
Wrong Answer
time: 5ms
memory: 5004kb

input:

65536 100000

output:

12345876 -3 65536
12345876 -3 65536

result:

wrong answer Wrong Answer At Query 65536.

Subtask #3:

score: 0
Wrong Answer

Test #3:

score: 0
Wrong Answer
time: 71ms
memory: 5124kb

input:

1048576 100000

output:

12345876 -3 1048576
12345876 -3 1048576

result:

wrong answer Wrong Answer At Query 1048576.

Subtask #4:

score: 0
Wrong Answer

Test #4:

score: 0
Wrong Answer
time: 4489ms
memory: 5000kb

input:

67108864 100000

output:

12345876 -3 67108864
12345876 -3 67108864

result:

wrong answer Wrong Answer At Query 67108864.