QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#676239#8544. Colorful Graph 2snow_mikumikuWA 0ms8492kbC++14939b2024-10-25 20:45:392024-10-25 20:45:40

Judging History

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

  • [2024-10-25 20:45:40]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:8492kb
  • [2024-10-25 20:45:39]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ll = long long;
const int N = 2e5 + 10;
vector <int> G[N];
void solv()
{
    int n, m;
    cin >> n >> m;
    vector <char> col(n + 1);
    vector <int> vis(n + 1);
    for(int i = 1; i <= n; i++) {
        if(i == 1)
            G[i].push_back(i + 1), G[i].push_back(n);
        else if(i == n)
            G[i].push_back(i - 1), G[i].push_back(1);
        else 
            G[i].push_back(i - 1), G[i].push_back(i + 1);
    }

    int u, v;
    for(int i = 1; i <= m; i++) {
        cin >> u >> v;
        u++, v++;
        if(u > v) swap(u, v);
        swap(u, v);
    }

    
    
    for(int i = 1; i <= n; i++) cout << col[i];
    cout << '\n';
    for(int i = 1; i <= n; i++) G[i].clear();
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t;
    cin >> t;
    while(t--) solv();
    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 8492kb

input:

3
3 0
4 1
1 3
6 3
0 2
2 4
4 0

output:


result:

wrong answer Token parameter [name=S] equals to " (test case 1)