結果
問題 | No.547 未知の言語 |
ユーザー |
![]() |
提出日時 | 2017-07-28 22:23:34 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 467 bytes |
コンパイル時間 | 488 ms |
コンパイル使用メモリ | 60,156 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 02:08:52 |
合計ジャッジ時間 | 1,455 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 33 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:20:17: warning: ‘ans’ may be used uninitialized in this function [-Wmaybe-uninitialized] 20 | cout << S[ans - 1] << endl; | ~~~~^~~
ソースコード
#include <iostream> #include <vector> #include <algorithm> #define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++) #define INF 1000000000LL #define MOD 1000000007LL using namespace std; typedef long long ll; ll N; string S[10], T[10]; int main(void) { cin >> N; REP(i, 0, N) cin >> S[i]; REP(i, 0, N) cin >> T[i]; ll ans; REP(i, 0, N) if(S[i] != T[i]) ans = i + 1; cout << ans << endl; cout << S[ans - 1] << endl; cout << T[ans - 1] << endl; }