QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#322022#4829. Mark on a GraphHaccerKat0 0ms0kbC++201.2kb2024-02-06 02:52:522024-02-06 02:52:53

Judging History

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

  • [2024-02-06 02:52:53]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2024-02-06 02:52:52]
  • 提交

answer

#include "bits/stdc++.h"
#ifdef DEBUG
#include "algo/debug.hpp"
#else
#define dbg(...)
#define dbgm(...)
#endif
using namespace std;
typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
// using u128 = __uint128_t;
// using i128 = __int128;
const int mod = 1000000007;
const int N = 1005;
const int LOG = 20;
const int inf = 1e9;
const double eps = 1e-11;
int n, m, k, qq;
int deg[N];
bool adj[N][N];
void solve() {
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        int u, v;
        cin >> u >> v;
        adj[u][v] = adj[v][u] = 1;
        deg[u]++, deg[v]++;
    }
    
    int u = -1, v = -1, cu = 0, cv = 0;
    for (int i = 1; i <= n; i++) {
        if (deg[i] > cv) v = i, cv = deg[i];
        if (cv > cu) swap(u, v), swap(cu, cv);
    }
    
    if (cu - cv >= 5) {
        cout << "ok\n";
        return;
    }
    
    int c = 0;
    cout << "mark\n5\n";
    for (int i = 1; i <= n; i++) {
        if (c == 5) break;
        if (!adj[u][i]) cout << u << " " << i << "\n";
    }
}

int32_t main() {
    std::ios::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
}

詳細信息

Test #1:

score: 0
Wrong Answer on the first run

input:

1000 3560
603 151
415 20
102 569
895 552
678 734
24 614
689 518
440 223
751 919
223 433
711 551
502 634
706 583
812 501
514 535
780 751
720 530
532 384
888 139
864 791
292 675
171 881
30 592
464 557
280 299
654 650
894 335
250 532
792 10
83 969
118 771
579 300
852 983
243 940
957 939
817 889
911 319...

output:

mark
5
310 1
310 2
310 3
310 4
310 5
310 6
310 7
310 8
310 9
310 10
310 11
310 12
310 13
310 14
310 15
310 16
310 17
310 18
310 19
310 20
310 21
310 22
310 23
310 24
310 25
310 26
310 27
310 28
310 29
310 30
310 31
310 32
310 33
310 34
310 35
310 36
310 37
310 38
310 39
310 40
310 41
310 42
310 43
3...

input:


output:


result:

wrong output format Extra information in the output file