結果
| 問題 |
No.547 未知の言語
|
| コンテスト | |
| ユーザー |
Kazu05
|
| 提出日時 | 2019-02-21 19:53:55 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 973 bytes |
| コンパイル時間 | 817 ms |
| コンパイル使用メモリ | 94,332 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-20 19:36:50 |
| 合計ジャッジ時間 | 1,665 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 33 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:52:23: warning: 'ans' may be used uninitialized [-Wmaybe-uninitialized]
52 | cout << ans + 1 << endl;
| ^
main.cpp:45:13: note: 'ans' was declared here
45 | int ans;
| ^~~
ソースコード
#include <iostream>
#include <istream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
using namespace std;
#define REP(i, n) for(int i = 0; i < n;i++)
typedef long long ll;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
/*
int n, m;
int a[110];
cin >> n >> m;
for (int i = 0; i < n; i++) cin >> a[i];
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
if (j % i > (j + 1) % i) swap(a[i], a[i + 1]);
}
}
cout << a[0];
for (int i = 0; i < n; i++) cout << a[i] << endl;
*/
int n;
string s[20], t[20];
int ans;
cin >> n;
REP(i, n) cin >> s[i];
REP(i, n) {
cin >> t[i];
if (t[i] != s[i]) ans = i;
}
cout << ans + 1 << endl;
cout << s[ans] << endl << t[ans] << endl;
}
Kazu05