QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#643208#7619. Make SYSU Great Again IFluoresce#WA 0ms3588kbC++201.8kb2024-10-15 19:51:482024-10-15 19:51:49

Judging History

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

  • [2024-10-15 19:51:49]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3588kb
  • [2024-10-15 19:51:48]
  • 提交

answer

#include<bits/stdc++.h>
#include<unordered_map>
#include<unordered_set>
typedef long long ll;
typedef long double ld;
#define debug(a) cout<<a<<'\n'
#define Pll pair<ll,ll>
#define PII pair<int,int>
#define ft first
#define sd second
#define vec vector
#define pushk push_back
#define pl p<<1
#define pr p<<1|1
using namespace std;
const int N = 2e5 + 10, M = 1e4 + 10, mod = 1e9 + 7;
const ll inf = 1e18;
const ld eps = 1e-13;
int mov[4][2] = { {0,1},{1,0},{-1,0},{0,-1} }, dx, dy, _ = 1, __ = 1;
void bout(bool f) {
	if (f)cout << "Yes\n";
	else cout << "No\n";
}
ll n, m, k;


void ini() {
	
}
void solve() {
	int cnt,x,y;
	cin>>n>>k;
	unordered_set<ll>st;
	cnt=0;
	if(n&1){
		cout<<1<<' '<<1<<'\n';
		cout<<1<<' '<<2<<'\n';
		cout<<2<<' '<<2<<'\n';
		cout<<2<<' '<<3<<'\n';
		st.insert(1*N+1);
		st.insert(1*N+2);
		st.insert(2*N+2);		
		st.insert(2*N+3);
		cnt=4;
	}
	for(int i=(n&1)?4:1;i<n;i+=2){
		cout<<i<<' '<<i<<'\n';
		cout<<i<<' '<<i+1<<'\n';
		cout<<i+1<<' '<<i+1<<'\n';
		cout<<i+1<<' '<<i<<'\n';
		st.insert(i*N+i);
		st.insert(i*N+i+1);
		st.insert((i+1)*N+i+1);		
		st.insert((i+1)*N+i);				
		cnt+=4;
	}
	if(n&1){
		cout<<"3 3\n1 3\n";
		st.insert(3*N+3);
		st.insert(3*N+1);
		cnt+=2;
	}
	if(cnt==k)return;
	for(int i=1;i<=n;++i){
		for(int j=1;j<=n;++j){
			if(!st.count(i*N+j)){
				cout<<i<<' '<<j<<'\n';
				if(++cnt==k)return;
			}
		}
	}
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
#ifndef ONLINE_JUDGE
	streambuf* cinbackup = cin.rdbuf(), * coutbackup = cout.rdbuf();
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	cin.rdbuf(fin.rdbuf());
	cout.rdbuf(fout.rdbuf());
#endif
	//cin >> _;
	__ = _;
	ini();
	while (_--) {
		solve();
	}
	return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3588kb

input:

3 6

output:

1 1
1 2
2 2
2 3
3 3
1 3

result:

wrong answer The answer is wrong: There are fewer than two numbers in one row or column