結果
| 問題 | No.547 未知の言語 |
| コンテスト | |
| ユーザー |
complement_real
|
| 提出日時 | 2017-07-28 22:27:17 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 378 bytes |
| 記録 | |
| コンパイル時間 | 403 ms |
| コンパイル使用メモリ | 77,188 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2026-03-12 14:47:23 |
| 合計ジャッジ時間 | 1,240 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 33 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:20:21: warning: 'ans' may be used uninitialized [-Wmaybe-uninitialized]
20 | cout << ans+1 << endl;
| ^
main.cpp:6:15: note: 'ans' was declared here
6 | int N,ans;
| ^~~
ソースコード
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(){
int N,ans;
cin >> N;
string S[10], T[10];
for (int i = 0; i < N; i++){
cin >> S[i];
}
for (int i = 0; i < N; i++){
cin >> T[i];
}
for (int i = 0; i < N; i++){
if (S[i] != T[i]){
ans = i;
}
}
cout << ans+1 << endl;
cout << S[ans] << endl;
cout << T[ans] << endl;
}
complement_real