QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#84462 | #5528. Least Annoying Constructive Problem | kkio | Compile Error | / | / | C++14 | 558b | 2023-03-06 15:14:54 | 2023-03-06 15:15:20 |
Judging History
你现在查看的是最新测评结果
- [2023-08-10 23:21:45]
- System Update: QOJ starts to keep a history of the judgings of all the submissions.
- [2023-03-06 15:15:20]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-03-06 15:14:54]
- 提交
answer
#include <bits/stdc++.h>
using namespace std;
int n;
int calc(int x){return (x-1+n)%n+1;}
int main()
{
scanf("%d",&n);
if(n&1)
{
for(int i=1;i<=n;i++)
for(int j=1;j<=(n-1)/2;j++)
{
int u=calc(i-j+1),v=calc(i+j);
if(u>v)swap(u,v);
printf("%d %d\n",u,v);
}
}
else
{
n--;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=(n-1)/2;j++)
{
int u=calc(i-j+1),v=calc(i+j);
if(u>v)swap(u,v);
printf("%d %d\n",u,v);
}
printf("%d %d\n",calc(i,n+1);
}
}
return 0;
}
Details
answer.code: In function ‘int main()’: answer.code:29:46: error: too many arguments to function ‘int calc(int)’ 29 | printf("%d %d\n",calc(i,n+1); | ~~~~^~~~~~~ answer.code:4:5: note: declared here 4 | int calc(int x){return (x-1+n)%n+1;} | ^~~~ answer.code:29:53: error: expected ‘)’ before ‘;’ token 29 | printf("%d %d\n",calc(i,n+1); | ~ ^ | ) answer.code:7:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d",&n); | ~~~~~^~~~~~~~~