QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#538197#8934. Challenge NPCucup-team133#AC ✓23ms5316kbC++231.6kb2024-08-31 08:47:162024-08-31 08:47:17

Judging History

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

  • [2024-08-31 08:47:17]
  • 评测
  • 测评结果:AC
  • 用时:23ms
  • 内存:5316kb
  • [2024-08-31 08:47:16]
  • 提交

answer

#include <bits/stdc++.h>
#ifdef LOCAL
#include <debug.hpp>
#else
#define debug(...) void(0)
#endif

template <class T> std::istream& operator>>(std::istream& is, std::vector<T>& v) {
    for (auto& e : v) {
        is >> e;
    }
    return is;
}

template <class T> std::ostream& operator<<(std::ostream& os, const std::vector<T>& v) {
    for (std::string_view sep = ""; const auto& e : v) {
        os << std::exchange(sep, " ") << e;
    }
    return os;
}

template <class T, class U = T> bool chmin(T& x, U&& y) {
    return y < x and (x = std::forward<U>(y), true);
}

template <class T, class U = T> bool chmax(T& x, U&& y) {
    return x < y and (x = std::forward<U>(y), true);
}

template <class T> void mkuni(std::vector<T>& v) {
    std::ranges::sort(v);
    auto result = std::ranges::unique(v);
    v.erase(result.begin(), result.end());
}

template <class T> int lwb(const std::vector<T>& v, const T& x) {
    return std::distance(v.begin(), std::ranges::lower_bound(v, x));
}

using ll = long long;

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);

    int k;
    cin >> k;
    int n = 2 * (k + 2);
    vector<pair<int, int>> es;
    vector<int> cs(n);
    for (int i = 0; i < n; i++) cs[i] = (i & 1) + 1;
    for (int i = 0; i < n; i += 2) {
        for (int j = 1; j < n; j += 2) {
            if (j != i + 1) {
                es.emplace_back(i, j);
            }
        }
    }
    int m = es.size(), c = 2;

    cout << n << " " << m << " " << c << "\n";
    cout << cs << "\n";
    for (auto [u, v] : es) cout << u + 1 << " " << v + 1 << "\n";
    return 0;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3592kb

input:

1

output:

6 6 2
1 2 1 2 1 2
1 4
1 6
3 2
3 6
5 2
5 4

result:

ok ok

Test #2:

score: 0
Accepted
time: 1ms
memory: 3536kb

input:

2

output:

8 12 2
1 2 1 2 1 2 1 2
1 4
1 6
1 8
3 2
3 6
3 8
5 2
5 4
5 8
7 2
7 4
7 6

result:

ok ok

Test #3:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

3

output:

10 20 2
1 2 1 2 1 2 1 2 1 2
1 4
1 6
1 8
1 10
3 2
3 6
3 8
3 10
5 2
5 4
5 8
5 10
7 2
7 4
7 6
7 10
9 2
9 4
9 6
9 8

result:

ok ok

Test #4:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

4

output:

12 30 2
1 2 1 2 1 2 1 2 1 2 1 2
1 4
1 6
1 8
1 10
1 12
3 2
3 6
3 8
3 10
3 12
5 2
5 4
5 8
5 10
5 12
7 2
7 4
7 6
7 10
7 12
9 2
9 4
9 6
9 8
9 12
11 2
11 4
11 6
11 8
11 10

result:

ok ok

Test #5:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

5

output:

14 42 2
1 2 1 2 1 2 1 2 1 2 1 2 1 2
1 4
1 6
1 8
1 10
1 12
1 14
3 2
3 6
3 8
3 10
3 12
3 14
5 2
5 4
5 8
5 10
5 12
5 14
7 2
7 4
7 6
7 10
7 12
7 14
9 2
9 4
9 6
9 8
9 12
9 14
11 2
11 4
11 6
11 8
11 10
11 14
13 2
13 4
13 6
13 8
13 10
13 12

result:

ok ok

Test #6:

score: 0
Accepted
time: 14ms
memory: 5180kb

input:

433

output:

870 188790 2
1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2...

result:

ok ok

Test #7:

score: 0
Accepted
time: 23ms
memory: 5240kb

input:

500

output:

1004 251502 2
1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 ...

result:

ok ok

Test #8:

score: 0
Accepted
time: 19ms
memory: 5244kb

input:

499

output:

1002 250500 2
1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 ...

result:

ok ok

Test #9:

score: 0
Accepted
time: 19ms
memory: 5244kb

input:

457

output:

918 210222 2
1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2...

result:

ok ok

Test #10:

score: 0
Accepted
time: 19ms
memory: 5316kb

input:

497

output:

998 248502 2
1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2...

result:

ok ok

Extra Test:

score: 0
Extra Test Passed