백준 1764번 [듣보잡] 해결하기(C++)
·
🔓알고리즘/🌿백준
백준 1764: 듣보잡 [실버4]https://www.acmicpc.net/problem/1764 ✍️Point : 범위를 확인하기만약 다음과 같이 아무 생각 없이 이중 for문으로 풀게 된다면, 시간 초과를 마주할 수 있다. ??? : 배열로 입력 받고, 교집합이 있는지 이중 for문으로 확인하면 되지 않을까?#includeusing namespace std;int n,m;string s;vectornlisten;vectornsee;vectorret;int main(){ cin>>n>>m; for(int i=0;i>s; nlisten.push_back(s); } for(int i=0;i>s; nsee.push_back(s); } for(int i=0;i 그 이유는, 당연하게도 n과 m의 최대가 5..