QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#155119#5522. F*** 3-Colorable GraphseikkiRE 0ms0kbC++14644b2023-09-01 11:17:402023-09-01 11:17:42

Judging History

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

  • [2023-09-01 11:17:42]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2023-09-01 11:17:40]
  • 提交

answer

#include <iostream>
#include <vector>
#define maxN 10005

int main() {
    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;
            }
        }
    }
    if (has4) std::cout << 2;
    else std::cout << 3;
}

詳細信息

Test #1:

score: 0
Runtime Error

input:

2 4
1 3
1 4
2 3
2 4

output:


result: