QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#155137#5522. F*** 3-Colorable GraphseikkiRE 0ms0kbC++20803b2023-09-01 11:32:332023-09-01 11:32:34

Judging History

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

  • [2023-09-01 11:32:34]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2023-09-01 11:32:33]
  • 提交

answer

#include <iostream>
#include <vector>
#include <map>
#define maxn 10005

int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    int n, m;
    std::cin >> n >> m;
    std::vector<int> adj[maxn]; // ai to bj
    for (int i = 0; i < m; i++) {
        int u, v;
        std::cin >> u >> v;
        v -= n;
        adj[u].push_back(v);
    }
    std::vector<int> cherry[maxn];
    bool has4 = 0;
    for (int i = 1; i <= n; i++) {
        for (auto a : adj[i]) {
            for (auto b : adj[i]) {
                if (a < b) cherry[a][b]++;
                if (cherry[a][b] > 1) {
                    has4 = 1;
                    std::cout << 2;
                    return 0;
                }
            }
        }
    }
    std::cout << 3;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Runtime Error

input:

2 4
1 3
1 4
2 3
2 4

output:


result: