結果
| 問題 |
No.547 未知の言語
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-18 21:49:48 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 407 bytes |
| コンパイル時間 | 1,892 ms |
| コンパイル使用メモリ | 168,532 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-17 03:58:45 |
| 合計ジャッジ時間 | 2,890 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 33 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:23:11: warning: 'ans' may be used uninitialized [-Wmaybe-uninitialized]
23 | cout << ans << endl;
| ^~~
main.cpp:13:7: note: 'ans' was declared here
13 | int ans;
| ^~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
int main(void)
{
int n;
cin >> n;
vector<string> s(n), t(n);
rep(i, n) cin >> s[i];
rep(i, n) cin >> t[i];
int ans;
rep(i, n)
{
if (s[i] != t[i])
{
ans = i + 1;
break;
}
}
cout << ans << endl;
cout << s[ans - 1] << endl;
cout << t[ans - 1] << endl;
return 0;
}