Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
41433 stevenyu 【S】T2 C++ 解答错误 10 1286 MS 244 KB 409 2026-04-22 21:23:34

Tests(1/10):


#include<bits/stdc++.h> using namespace std; int n,k; signed main(){ cin>>n>>k; if(!(n&1))return cout<<-1,0; int gcd=__gcd(n,k); if(gcd==1){ cout<<(n-1)/2<<endl; int cnt=n; int nw=1; while(cnt>1){ cout<<nw<<" "<<(nw+k)%n<<endl; cnt-=2; nw=(((nw+k)%n)+k)%n; } return 0; } return 0; }


测评信息: