QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#401366 | #5528. Least Annoying Constructive Problem | 2745518585 | WA | 0ms | 3872kb | C++20 | 720b | 2024-04-28 16:08:49 | 2024-04-28 16:08:49 |
Judging History
answer
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
int n;
vector<pair<int,int>> ans;
int main()
{
scanf("%d",&n);
if(n%2==1)
{
for(int i=1;i<=n;++i)
{
for(int j=1;j<=n/2;++j)
{
ans.push_back(make_pair((i-j+n-1)%n+1,(i+j-1)%n+1));
}
}
}
else
{
for(int i=1;i<=n-1;++i)
{
ans.push_back(make_pair(i,n));
for(int j=1;j<=(n-1)/2;++j)
{
ans.push_back(make_pair((i-j+(n-1)-1)%(n-1)+1,(i+j-1)%(n-1)+1));
}
}
}
for(auto i:ans) printf("%d %d\n",i.first,i.second);
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3872kb
input:
3
output:
3 2 1 3 2 1
result:
wrong answer Integer 2 violates the range [4, 3]