QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#796131 | #7619. Make SYSU Great Again I | Maxduan# | WA | 1ms | 3716kb | C++23 | 901b | 2024-12-01 12:47:36 | 2024-12-01 12:47:37 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
#define pii pair<int,int>
const int N = 2e5 + 5;
int n,k;
pair<int,int> pos[N];
void solve(){
cin>>n>>k;
int now=1;
for(int i=1;i<=n;i++){
pos[now++]={i,i};
if(i!=n)
pos[now++]={i,i+1};
else
pos[now++]={i,i-1};
}
if(now<=k){
for(int i=1;i<=n&&now<=k;i++){
for(int j=1;j<=n&&now<=k;j++){
if(j==i||j==i+1||(i==n&&j==n-1))
continue;
pos[now++]={i,j};
}
}
}
for(int i=1;i<=k;i++){
cout<<pos[i].first<<' '<<pos[i].second<<endl;
}
return;
}
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
int T=1;//cin>>T;
while(T--){
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3716kb
input:
3 6
output:
1 1 1 2 2 2 2 3 3 3 3 2
result:
wrong answer The answer is wrong: There are fewer than two numbers in one row or column