// we all are lost trying to be someone.
#include <bits/stdc++.h>
#define fastio ios_base::sync_with_studio(0); cin.tie(0);
#define sz(x) int(x.size())
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define pb push_back
#define ss second
#define ff first
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> ii;
const int MAX=1e6;
const int inf=1e9;
const int mod=1e9+7;
vector<ii> gfo[MAX];
void solve(){
ll n, m, u, v;
char x;
cin>>n>>m;
for(ll i=0; i<m; i++){
cin>>u>>v>>x;
if(x=='A'){
gfo[u].pb({v,1});
gfo[v].pb({u,1});
}
else{
gfo[u].pb({v,0});
gfo[v].pb({u,0});
}
}
ll ans=0;
for(ll i=1; i<=n; i++){
if(sz(gfo[i])==n-1)ans++;
}
cout<<ans<<endl;
return;
}
int main(){
solve();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
445 ms |
47400 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
23764 KB |
Output is correct |
2 |
Correct |
11 ms |
23764 KB |
Output is correct |
3 |
Correct |
12 ms |
23736 KB |
Output is correct |
4 |
Correct |
14 ms |
24148 KB |
Output is correct |
5 |
Correct |
14 ms |
23792 KB |
Output is correct |
6 |
Correct |
188 ms |
40580 KB |
Output is correct |
7 |
Correct |
275 ms |
48988 KB |
Output is correct |
8 |
Correct |
20 ms |
24600 KB |
Output is correct |
9 |
Correct |
26 ms |
25364 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
23764 KB |
Output is correct |
2 |
Correct |
12 ms |
23736 KB |
Output is correct |
3 |
Correct |
14 ms |
24148 KB |
Output is correct |
4 |
Incorrect |
14 ms |
23884 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
14 ms |
23884 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
14 ms |
23884 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |