QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#689207#9446. Construction of TownTJ_AndevikingWA 0ms3712kbC++20655b2024-10-30 15:49:292024-10-30 15:49:30

Judging History

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

  • [2024-10-30 15:49:30]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3712kb
  • [2024-10-30 15:49:29]
  • 提交

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.