QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#84262#5528. Least Annoying Constructive Problemyx20220802Compile Error//C++141.3kb2023-03-06 07:54:552023-03-06 07:54:58

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 07:54:58]
  • 评测
  • [2023-03-06 07:54:55]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
namespace IO_ER{
	#define LL long long
	#define db double
	#define ULL unsigned long long
	#define In inline
	#define f(a,b,i) for(int i=a;i<=b;i++)
	#define ff(a,b,i) for(int i=a;i<b;i++)
	#define f_(a,b,i) for(int i=a;i>=b;i--)
	#define ff_(a,b,i) for(int i=a;i>b;i--)
	typedef pair<int,int> Pi;
	int inf=0x3f3f3f3f;
	int INF=0x7fffffff;
	LL infll=0x3f3f3f3f3f3f3f3fll;
	LL INFll=0x7fffffffffffffffll;
	int FLAG_=0;
	char CHAR=0;
	template<typename T>void read(T &x){
		FLAG_=0;
		CHAR=getchar();
		while(CHAR<'0'||'9'<CHAR){
			if(CHAR=='-')FLAG_=1;
			CHAR=getchar();
		}
		while('0'<=CHAR&&CHAR<='9'){
			x=(x<<1)+(x<<3)+(CHAR^48);
			CHAR=getchar();
		}
		x=FLAG_?-x:x;
	}
	template<typename T,typename ...Args>void read(T &x,Args &...args){
		read(x);
		read(args...);
	}
}
using namespace IO_ER;

int n;

int main(){
	read(n);
	if(n%2==1){
		ff(0,n,i){
			int u=i;
			inta v=(i+1)%n;
			f(1,n/2,j){
				printf("%d %d\n",min(u+1,v+1),max(u+1,v+1));
				u=(u-1+n)%n;
				v=(v+1)%n;
			}
		}
	}
	else{
		ff(0,n-1,i){
			int u=i;
			int v=(i+1)%(n-1);
			f(1,(n-1)/2,j){
				printf("%d %d\n",min(u+1,v+1),max(u+1,v+1));
				u=(u-1+(n-1))%(n-1);
				v=(v+1)%(n-1);
			}
			printf("%d %d\n",v+1,n);
		}
	}
	return 0;
}



Details

answer.code: In function ‘int main()’:
answer.code:46:25: error: ‘inta’ was not declared in this scope; did you mean ‘int’?
   46 |                         inta v=(i+1)%n;
      |                         ^~~~
      |                         int
answer.code:48:58: error: ‘v’ was not declared in this scope
   48 |                                 printf("%d %d\n",min(u+1,v+1),max(u+1,v+1));
      |                                                          ^