結果
| 問題 |
No.547 未知の言語
|
| コンテスト | |
| ユーザー |
hamray
|
| 提出日時 | 2017-11-04 17:58:27 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 563 bytes |
| コンパイル時間 | 493 ms |
| コンパイル使用メモリ | 62,300 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-26 02:53:05 |
| 合計ジャッジ時間 | 1,376 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 33 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:24:13: warning: ‘ans’ may be used uninitialized in this function [-Wmaybe-uninitialized]
24 | cout << ans << endl;
| ^~~
ソースコード
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(){
int N; cin >> N;
vector<string> v1;
vector<string> v2;
int ans;
for(int i = 0; i < N; i++){
string a;
cin >> a;
v1.push_back(a);
}
for(int i = 0; i < N; i++){
string a;
cin >> a;
v2.push_back(a);
}
for(int i = 0; i < N; i++){
if(v1[i] != v2[i])
ans = i + 1;
}
cout << ans << endl;
cout << v1[ans - 1] << endl;
cout << v2[ans - 1] << endl;
return 0;
}
hamray