QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#594884 | #5528. Least Annoying Constructive Problem | zhenjianuo2025 | WA | 0ms | 3680kb | C++14 | 1.9kb | 2024-09-28 10:59:13 | 2024-09-28 10:59:15 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define pii pair<int,int>
#define piii tuple<int,int,int>
#define mp make_pair
#define mt make_tuple
#define x first
#define y second
#define fi first
#define se second
#define era erase
#define ins insert
#define it iterator
#define lb lower_bound
#define ub upper_bound
#define exc(exp) if(exp)continue;
#define ret(exp) if(exp)return;
#define stop(exp) if(exp)break;
#define quit(sth) {sth;return;}
#define let(var...) int var;tie(var)
#define siz(vec) ((int)((vec).size()))
#define all(vec) (vec).begin(),(vec).end()
#define unq(vec) sort(all(vec)),(vec).erase(unique(all(vec)),(vec).end())
#define deb(var) cerr<<#var<<'='<<(var)<<"; "
#define debl(var) cerr<<#var<<'='<<(var)<<";\n"
#define int long long
#define inf (long long)(1e18)
void chkmax(int &x,int y){if(x<y)x=y;}
void chkmin(int &x,int y){if(x>y)x=y;}
const int mod=998244353;
void Add(int &x,int y){x=x+y<mod?x+y:x+y-mod;}
int add(int x,int y){return x+y<mod?x+y:x+y-mod;}
int fps(int x,int y){
int ans=1;for(;y;y>>=1,(x*=x)%=mod)if(y&1)(ans*=x)%=mod;return ans;
}
int n,w[310][310];
void work(){
cin>>n;
if(n&1){
for(int i=0;i<n;i++){
exc(w[i][(i+1)%n]);
for(int j=0;j<(n-1)/2;j++){
int u=(i-j+n)%n,v=(i+j+1)%n;
exc(w[u][v]);
w[u][v]=1;cout<<1+u<<' '<<1+v<<'\n';
}
for(int j=0;j<(n-1)/2;j++){
int u=(i+j+1)%n,v=(i-j-1+n)%n;
exc(w[u][v]);
w[u][v]=1;cout<<1+u<<' '<<1+v<<'\n';
}
}
}
}
signed main(){
ios::sync_with_stdio(0),
cin.tie(0),cout.tie(0);
int T=1;while(T--)work();
}
/*
* CONTINUE, NON-STOPPING, FOR THE FAITH
* START TYPING IF YOU DON'T KNOW WHAT TO DO
* STOP TYPING IF YOU DON'T KNOW WHAT YOU'RE DOING
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3680kb
input:
3
output:
1 2 2 3 3 1
result:
wrong answer Integer 1 violates the range [4, 3]