QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#594889#5528. Least Annoying Constructive Problemzhenjianuo2025WA 0ms3644kbC++142.0kb2024-09-28 11:00:092024-09-28 11:00:33

Judging History

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

  • [2024-09-28 11:00:33]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3644kb
  • [2024-09-28 11:00:09]
  • 提交

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;
                if(u>v)swap(u,v);
                exc(w[u][v]);
                w[u][v]=w[v][u]=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;
                if(u>v)swap(u,v);
                exc(w[u][v]);
                w[u][v]=w[v][u]=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: 100
Accepted
time: 0ms
memory: 3644kb

input:

3

output:

1 2
2 3
1 3

result:

ok Correct

Test #2:

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

input:

4

output:


result:

wrong output format Unexpected end of file - int32 expected