QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#140634 | #5529. Most Annoying Constructive Problem | PhantomThreshold# | WA | 1ms | 3584kb | C++20 | 632b | 2023-08-16 15:04:11 | 2023-08-16 15:04:14 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int n;
vector<pair<int,int>> ans;
void add(int x,int y){
ans.emplace_back(x+1,y+1);
}
int main(){
ios_base::sync_with_stdio(false);
cin >> n;
if (n%2==0){
for (int st=0;st<=n-2;st++){
add(st,n-1);
int x=st;
int y=st;
do{
x=(x+1)%(n-1);
y=(y+(n-1)-1)%(n-1);
add(x,y);
}while ((x+1)%(n-1)!=y);
}
}
else{
for (int st=0;st<=n-1;st++){
int x=st;
int y=st;
do{
x=(x+1)%n;
y=(y+n-1)%n;
add(x,y);
}while ((x+1)%n!=y);
}
}
for (auto [x,y]:ans) cout << x << " " << y << endl;
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3584kb
input:
4 1 0 3 3 4 1 6 15
output:
1 4 2 3 2 4 3 1 3 4 1 2
result:
wrong answer Token parameter [name=yes/no] equals to "1", doesn't correspond to pattern "[yY][eE][sS]|[nN][oO]" (test case 1)