QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#84505#5528. Least Annoying Constructive ProblemqwqwfCompile Error//C++141.0kb2023-03-06 15:28:562023-03-06 15:29:45

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:29:45]
  • 评测
  • [2023-03-06 15:28:56]
  • 提交

answer

#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#define ll long long
#define int ll
#define Inf 0x3f3f3f3f
using namespace std;
const int N=1e6+60,M=1e6+20,mod=998244353;
inline int read(){
    int d=0,f=1;char x=getchar();
    while(x<'0'||x>'9'){if(x=='-'){f=-1;}x=getchar();}
    while(x>='0'&&x<='9'){d=(d<<1)+(d<<3)+(x-48);x=getchar();}
    return d*f;
}
int n,m;
inline int calc(int x){return (x-1+n)%n+1;}
signed main(){
    n=read();
    if(n&1){
        for(int i=1;i<=n;i++){
            for(int j=1;j<=(i-1)/2;j++){
                int u=calc(i-j+1),v=cacl(i+j);
                if(u>v) swap(u,v);printf("%lld %lld\n",u,v);
            }
        }
    }
    else{
        n--;
        for(int i=1;i<=n;i++){
            for(int j=1;j<=(i-1)/2;j++){
                int u=calc(i-j+1),v=cacl(i+j);
                if(u>v) swap(u,v);printf("%lld %lld\n",u,v);
            }
            printf("%lld %lld\n",calc(i+1+(n-1)/2,n+1));
        }
    }
    return 0;
}
////7950

Details

answer.code: In function ‘int main()’:
answer.code:24:37: error: ‘cacl’ was not declared in this scope; did you mean ‘calc’?
   24 |                 int u=calc(i-j+1),v=cacl(i+j);
      |                                     ^~~~
      |                                     calc
answer.code:33:37: error: ‘cacl’ was not declared in this scope; did you mean ‘calc’?
   33 |                 int u=calc(i-j+1),v=cacl(i+j);
      |                                     ^~~~
      |                                     calc
answer.code:36:38: error: too many arguments to function ‘long long int calc(long long int)’
   36 |             printf("%lld %lld\n",calc(i+1+(n-1)/2,n+1));
      |                                  ~~~~^~~~~~~~~~~~~~~~~
answer.code:18:12: note: declared here
   18 | inline int calc(int x){return (x-1+n)%n+1;}
      |            ^~~~
answer.code:36:29: warning: format ‘%lld’ expects a matching ‘long long int’ argument [-Wformat=]
   36 |             printf("%lld %lld\n",calc(i+1+(n-1)/2,n+1));
      |                          ~~~^
      |                             |
      |                             long long int