QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#676239 | #8544. Colorful Graph 2 | snow_mikumiku | WA | 0ms | 8492kb | C++14 | 939b | 2024-10-25 20:45:39 | 2024-10-25 20:45:40 |
Judging History
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;
}
Details
Tip: Click on the bar to expand more detailed information
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)