結果

問題 No.547 未知の言語
ユーザー tsunenarazu
提出日時 2017-08-11 22:01:30
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 444 bytes
コンパイル時間 873 ms
コンパイル使用メモリ 77,900 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-26 02:33:01
合計ジャッジ時間 2,058 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:25:11: warning: 'ans' may be used uninitialized [-Wmaybe-uninitialized]
   25 |   cout << ans << endl;
      |           ^~~
main.cpp:14:7: note: 'ans' was declared here
   14 |   int ans;
      |       ^~~

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <cmath>
#include <queue>
#include <algorithm>
#include <iostream>
using namespace std;


int main()
{
  int n ; cin >> n;
  string s[11],t[11];
  int ans;
  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+1;
    }

  cout << ans << endl;
  cout << s[ans -1] << endl;
  cout << t[ans -1] << endl;

  return 0;
}
0