// No.547 未知の言語 // https://yukicoder.me/problems/no/547 // #include #include #include using namespace std; tuple solve(vector& wordsS, vector& wordsT); int main() { int N; cin >> N; vector wordsS; vector wordsT; string tmp; for (auto i = 0; i < N; i++) { cin >> tmp; wordsS.push_back(tmp); } for (auto i = 0; i < N; i++) { cin >> tmp; wordsT.push_back(tmp); } tuple ans = solve(wordsS, wordsT); #if 1 cout << get<0>(ans) << endl; cout << get<1>(ans) << endl; cout << get<2>(ans) << endl; #else int a; string s, t; tie(a, s, t) = ans; cout << a << endl << s << endl << t << endl; #endif } tuple solve(vector& wordsS, vector &wordsT) { for (auto i = 0; i < wordsS.size(); i++) { if (wordsS[i] != wordsT[i]) { return make_tuple(i+1, wordsS[i], wordsT[i]); } } }