| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 41434 | stevenyu | 【S】T2 | C++ | 解答错误 | 10 | 1297 MS | 252 KB | 452 | 2026-04-22 21:25:42 |
#include<bits/stdc++.h> using namespace std; #define int long long 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; } else{ } return 0; }