QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#404321 | #5528. Least Annoying Constructive Problem | ucup-team173 | WA | 1ms | 3916kb | C++20 | 1.2kb | 2024-05-03 19:46:05 | 2024-05-03 19:46:06 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define Mp make_pair
#define pb push_back
#define SZ(a) (int(a.size()))
typedef long long ll;
typedef double db;
typedef std::pair<int, int> pii;
typedef std::vector<int> vi;
std::mt19937_64 gen(std::chrono::system_clock::now().time_since_epoch().count());
ll get(ll l, ll r) { std::uniform_int_distribution<ll> dist(l, r); return dist(gen); }
void solve() {
int n;
cin >> n;
if(n % 2) {
int k = n / 2;
for(int i = 0; i < n; i++)
for(int j = 1; j <= k; j++)
cout << (i - j + 1 + n) % n + 1 << ' ' << (i + j) % n + 1 << '\n';
} else {
n--;
int k = n / 2;
for(int i = 0; i < n; i++) {
for(int j = 1; j <= k; j++)
cout << (i - j + 1 + n) % n + 1 << ' ' << (i + j) % n + 1 << '\n';
cout << (i + k + 1) % n + 1 << ' ' << 2 * k + 2 << '\n';
}
}
}
signed main() {
atexit([](){cerr << "time: " << (db)clock()/CLOCKS_PER_SEC << "s\n";});
ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
int t = 1;
// cin >> t;
while(t--) solve();
return 0;
}
详细
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3916kb
input:
3
output:
1 2 2 3 3 1
result:
wrong answer Integer 1 violates the range [4, 3]