QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#36729#4325. Kraljiceyuyue0 2ms3632kbC++20973b2022-06-28 16:57:492022-06-28 16:57:49

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-06-28 16:57:49]
  • 评测
  • 测评结果:0
  • 用时:2ms
  • 内存:3632kb
  • [2022-06-28 16:57:49]
  • 提交

answer

#include<bits/stdc++.h>
#define LL long long
#define pb push_back
#define SZ(x) ((int)x.size()-1)
#define ms(a,b) memset(a,b,sizeof a)
#define F(i,a,b) for (int i=(a);i<=(b);++i)
#define DF(i,a,b) for (int i=(a);i>=(b);--i)
//#define mp make_pair
//#define OO(x) fixed<<setprecision(x)
using namespace std;
//mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
inline int read(){
	char ch=getchar(); int w=1,c=0;
	for(;!isdigit(ch);ch=getchar()) if (ch=='-') w=-1;
	for(;isdigit(ch);ch=getchar()) c=(c<<1)+(c<<3)+(ch^48);
	return w*c;
}

int main(){
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	int n=read();
	n=(n-1)/2*2+1;
	cout<<n*n<<"\n";
	F(i,1,n){
		F(j,1,n){
			cout<<i<<" "<<j<<"\n";
		}
	}
	return 0;
}
/* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* WRITE STUFF DOWN
	* DON'T GET STUCK ON ONE APPROACH
*/

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 6
Accepted
time: 2ms
memory: 3632kb

input:

1

output:

1
1 1

result:

ok 1 queen(s)

Test #2:

score: 0
Accepted
time: 1ms
memory: 3520kb

input:

2

output:

1
1 1

result:

ok 1 queen(s)

Test #3:

score: -6
Wrong Answer
time: 1ms
memory: 3420kb

input:

3

output:

9
1 1
1 2
1 3
2 1
2 2
2 3
3 1
3 2
3 3

result:

wrong answer the cell (1, 2) is attacking by 1 queen(s)

Subtask #2:

score: 0
Skipped

Dependency #1:

0%

Subtask #3:

score: 0
Skipped

Dependency #1:

0%

Subtask #4:

score: 0
Skipped

Dependency #1:

0%