@[鱼鱼号铲屎车](/user/222479) `cout << "NO";` `O`应该是小写`o`
by konjacp @ 2021-01-26 11:06:27
@[konjacp](/user/186403) 谢谢
但是还是0分
by 鱼鱼号铲屎车 @ 2021-01-26 11:07:06
@[konjacp](/user/186403) 我该肿么办?
by 鱼鱼号铲屎车 @ 2021-01-26 11:07:40
@[鱼鱼号铲屎车](/user/222479) 您能先发一下改了过后的代码吗
by konjacp @ 2021-01-26 11:09:06
```cpp
#include<bits/stdc++.h>
using namespace std;
map<string,string> mp;
string fatheryingshe(string n){
if(mp[n] == n) {
return n;
}
return mp[n] = fatheryingshe(mp[n]);
}
int main(){
int n,m;
cin >> n >> m;
for(int i = 0; i < n; i ++){
string t;
cin >> t;
mp[t] = t;
}
for(int i = 0 ; i < m ; i ++){
string t,t1;
cin >> t >> t1;
string t2 = fatheryingshe(t);
string t3 = fatheryingshe(t1);
if(t2 != t3){
mp[t2] = t3;
}
}
int k;
cin >> k;
for(int i = 0 ; i < k; i ++){
string t,t1;
cin >> t >> t1;
string t2 = fatheryingshe(t);
string t3 = fatheryingshe(t1);
if(t2 != t3){
cout << "No";
cout << '\n';
} else {
cout << "Yes\n";
}
}
exit(0);
}
```
by 鱼鱼号铲屎车 @ 2021-01-26 11:10:02
@[鱼鱼号铲屎车](/user/222479) `Yes`和`No`后面都应该有个`.`
by konjacp @ 2021-01-26 11:14:27
谢谢您我已经AC了,WA原因是YES和No后面少了个句号
by 鱼鱼号铲屎车 @ 2021-01-26 11:15:12