QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#249407 | #7640. Colorful Cycles | manizare | WA | 86ms | 5588kb | C++14 | 991b | 2023-11-12 05:48:11 | 2023-11-12 05:48:11 |
Judging History
answer
#include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define all(a) a.begin(),a.end()
#define pii pair <int,int>
#define PII pair<pii , pii>
#define int long long
#define sz(v) (int)v.size()
using namespace std ;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int maxn = 2e6 + 10 , inf = 1e18 , lg = 21 ;
int mark[maxn] , d[maxn][4] ;
signed main(){
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0) ;
int T ;
cin >> T ;
while(T--){
int n , m ;
cin >> n >> m ;
for(int i = 1 ; i<= n; i++){
for(int j = 1; j <= 3; j ++){
d[i][j] = 0;
mark[j] =0 ;
}
}
for(int i = 1; i <= m; i++){
int v , u , c;
cin >> v >> u >> c;
d[v][c] = d[u][c] = 1 ;
mark[c]= 1;
}
int ted= 0 ;
for(int i = 1; i <= n; i++){
if((d[i][3]+d[i][1]+d[i][2])>=2){ted++;}
}
if(ted >= 3 && mark[1]&& mark[2]&&mark[3])cout << "Yes\n";
else cout << "No\n";
}
}
/*
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 5448kb
input:
2 3 3 1 2 3 2 3 1 1 3 2 5 6 1 2 1 2 3 1 1 3 2 3 4 3 3 5 3 4 5 3
output:
Yes No
result:
ok 2 token(s): yes count is 1, no count is 1
Test #2:
score: -100
Wrong Answer
time: 86ms
memory: 5588kb
input:
100000 7 10 7 2 2 6 4 2 6 1 2 7 1 3 3 4 1 6 7 1 2 6 3 3 1 2 5 3 1 2 1 1 7 10 5 7 3 7 1 1 4 6 3 6 3 1 3 4 3 4 2 2 3 2 3 1 3 3 3 7 1 1 4 2 7 10 5 6 3 3 5 2 7 2 3 7 3 3 1 2 2 4 3 2 7 4 2 6 1 2 2 6 1 7 5 2 7 10 7 1 3 7 5 3 6 4 1 7 6 1 1 4 1 3 4 2 2 7 2 1 3 1 3 5 3 5 1 3 7 10 6 7 2 3 4 3 1 4 2 5 3 2 7 4 ...
output:
Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes Yes Yes Yes Yes No Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes No ...
result:
wrong answer expected NO, found YES [131st token]