QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#643251#7619. Make SYSU Great Again IFluoresce#WA 0ms3580kbC++201.4kb2024-10-15 20:08:472024-10-15 20:08:48

Judging History

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

  • [2024-10-15 20:08:48]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3580kb
  • [2024-10-15 20:08:47]
  • 提交

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;
	cout<<"1 1\n";
	st.insert(N+1);
	for(int i=2;i<=n;++i){
		cout<<i-1<<' '<<i<<'\n';
		cout<<i<<' '<<i<<'\n';
		st.insert((i-1)*N+i);
		st.insert(i*N+i);
	}
	cout<<n<<' '<<1<<'\n';
	st.insert(N*n+1);
	cnt=k;
	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;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3576kb

input:

3 6

output:

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

result:

ok The answer is correct.

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3580kb

input:

3 7

output:

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

result:

wrong output format Unexpected end of file - int32 expected