QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#689207 | #9446. Construction of Town | TJ_Andeviking | WA | 0ms | 3712kb | C++20 | 655b | 2024-10-30 15:49:29 | 2024-10-30 15:49:30 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define range(x) (x).begin(), (x).end()
const int dir[][2] = {1, 0, -1, 0, 0, 1, 0, -1};
void solve()
{
int n, m;
cin >> n >> m;
for (int i = 2; i <= n; ++i)
cout << "1 " << i << '\n';
m -= n - 1;
for (int i = 2; i <= n; ++i)
for (int j = i + 1; j <= n; ++j) {
if (!m)
return;
cout << i << ' ' << j << '\n';
}
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t = 1;
// cin >> t;
while (t--)
solve();
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3600kb
input:
3 2 4 5
output:
1 2 1 3
result:
ok Output is valid. OK
Test #2:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
4 6 12 34 56
output:
1 2 1 3 1 4 2 3 2 4 3 4
result:
ok Output is valid. OK
Test #3:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
2 1 998244353
output:
1 2
result:
ok Output is valid. OK
Test #4:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
3 3 1 10
output:
1 2 1 3 2 3
result:
ok Output is valid. OK
Test #5:
score: -100
Wrong Answer
time: 0ms
memory: 3712kb
input:
5 8 242843383 518993849 724779449 840953559
output:
1 2 1 3 1 4 1 5 2 3 2 4 2 5 3 4 3 5 4 5
result:
wrong answer Participant output contains extra tokens.