QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#540260 | #8726. Magic Show | zzafanti | 0 | 0ms | 0kb | C++23 | 1.4kb | 2024-08-31 16:45:09 | 2024-08-31 16:45:10 |
Alice
#include <vector>
#include "Alice.h"
#include<bits/stdc++.h>
// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().
#define N 4977
#define P 63
using namespace std;
std::vector<std::pair<int,int>> Alice(){
long long X=setN(N+2);
vector<pair<int,int>> T;
for(int i=1; i<=N; i++){
int u=(i-1)%P;
if(((i-1)/P%2)&&(X>>u&1)||((i-1)/P%3==0)&&(X>>(P-u-1)&1)) T.emplace_back(i,i+2);
else T.emplace_back(i,i+1);
}
T.emplace_back(N+1,N+2);
assert(T.size()==N);
return T;
}
Bob
#include <vector>
#include "Bob.h"
#include <bits/stdc++.h>
// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().
using namespace std;
#define P 63
#define N 4977
long long Bob(std::vector<std::pair<int,int>> V){
long long ret=0;
for(auto pt:V){
int x=(pt.first-1)%P,y=(pt.first-1)/P;
if(pt.first>N) continue;
if(pt.second==pt.first+1) continue;
if(y%2==0) ret|=(1ll<<(P-x-1));
else ret|=(1ll<<x);
}
return ret;
}
详细
Subtask #1:
score: 0
Runtime Error
Test #1:
score: 0
Runtime Error
input:
1 4005
output:
Subtask #2:
score: 0
Runtime Error
Test #13:
score: 0
Runtime Error
input:
1 17476204
output:
Subtask #3:
score: 0
Runtime Error
Test #25:
score: 0
Runtime Error
input:
1 355365355024496523