///@author Sycamore, ZJNU; ///@date 8/6/2017 #include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(false); int T; cin >> T; while (T--) { bool same = true; int N, M; cin >> N; string s,t1,t2; for(int i=0;i<N;i++) { cin >> s; t1.push_back(s[0]); } cin >> M; if (N != M)same = false; while (M--) { cin >> s; t2.push_back(s[0]); } cout << (same&&t1 == t2 ? "SAME\n" : "DIFFERENT\n"); } return 0; }
时间: 2024-10-24 15:59:59