結果

問題 No.547 未知の言語
ユーザー snrnsidy
提出日時 2021-07-15 21:46:23
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 765 bytes
コンパイル時間 2,167 ms
コンパイル使用メモリ 197,688 KB
最終ジャッジ日時 2025-01-23 01:09:34
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
   
    int n;
    vector <string> a, b;
    string s;

    cin >> n;

    for (int i = 0; i < n; i++)
    {
        cin >> s;
        a.push_back(s);
    }

    for (int i = 0; i < n; i++)
    {
        cin >> s;
        b.push_back(s);
    }

    if (n == 1)
    {
        cout << 1 << '\n';
        cout << a[0] << '\n';
        cout << b[0] << '\n';
    }
    else
    {
        for (int i = 0; i < n; i++)
        {
            if (a[i] != b[i])
            {
                cout << i + 1 << '\n';
                cout << a[i] << '\n';
                cout << b[i] << '\n';
                break;
            }
        }
    }


    return 0;
}
0