传送门:http://codeforces.com/contest/765
A题:给你家的名字,以及n张机票的起点和终点,Jinotega一开始在家,你要根据这些机票的起点和终点判断Jinotega最后是不是在家。直接记录起点和终点家出现的次数,如果相等说明Jinotega在家,否则不在家。
#include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> #include <vector> #include <queue> #include <string> #include <stack> #include <map> #include <set> #include <bitset> #define X first #define Y second #define clr(u,v); memset(u,v,sizeof(u)); #define in() freopen("data","r",stdin); #define out() freopen("ans","w",stdout); #define Clear(Q); while (!Q.empty()) Q.pop(); #define pb push_back using namespace std; typedef long long ll; typedef pair<int, int> pii; const int maxn = 1e5 + 10; const int INF = 0x3f3f3f3f; char str[100]; char s[5]; int main() { int n; scanf("%d", &n); scanf("%s", s); int ans = 0; for (int i = 0; i < n; i++) { scanf("%s", str); str[3] = '