BOJ-9375
07 Jul 2021패션왕 신해빈…해빈이는 패션에 매우 민감해서 한번 입었던 옷들의 조합을 절대 다시 입지 않는다…각 테스트 케이스에 대해 해빈이가 알몸이 아닌 상태로 의상을 입을 수 있는 경우를 출력하시오… 거참 문제 한번 상황이 웃기네…
/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <iostream>
#include <cstring>
#include <vector>
#include <cmath>
#include <utility>
using namespace std;
int fact(int n) {
int i,j;
if(n==1) return n;
else {
i = n;
for(j=n-1; j>0; j--) i *= j;
return i;
}
}
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
int n;
cin >> n;
if (n<0 || n>30) return 0;
vector<pair<string, string>> fashion;
for (int i=0; i<n; i++) {
int num;
cin >> num;
for (int j=0; j<num; j++) {
string a,b;
scanf("%s %s", a,b);
// fashion.push_back(input);
pair<string, string> last = *(fashion.end());
if (!last.second.compare(b)) {
pair<string, string> input = make_pair(a,b);
fashion.push_back(input);
}
if(j==num-1) {
int size = fashion.size();
cout << size << "\n";
cout << fact(size) << "\n";
}
fashion.clear();
}
}
}
이상하게 오늘 vscode가 느리고 버벅거린다… 터미널도 맛탱이가 나갔다… 그래서 gdb online을 썼더니 더 느리고 복잡하다…. 머리 아파….. 얼른 자야겠다…