結果
| 問題 | No.547 未知の言語 |
| コンテスト | |
| ユーザー |
AQUA16573837
|
| 提出日時 | 2018-03-12 00:21:28 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
RE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 430 bytes |
| 記録 | |
| コンパイル時間 | 168 ms |
| コンパイル使用メモリ | 51,000 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2026-03-12 16:41:56 |
| 合計ジャッジ時間 | 1,237 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 RE * 2 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:20:15: warning: 'res' may be used uninitialized [-Wmaybe-uninitialized]
20 | printf("%d\n%s\n%s\n", res + 1, s[res], t[res]);
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:7:19: note: 'res' was declared here
7 | int n, p, res;
| ^~~
ソースコード
#include <stdio.h>
#include <algorithm>
using namespace std;
using ll = long long;
int main() {
int n, p, res;
scanf("%d", &n);
char s[10][21], t[10][21];
for (int i = 0; i < n; i++)
scanf("%s", s[i]);
for (int i = 0; i < n; i++)
scanf("%s", t[i]);
for (int i = 0; i < n; i++)
for (p = 0; s[i][p] != 0 && t[i][p] != 0; p++)
if (s[i][p] != t[i][p])
res = i;
printf("%d\n%s\n%s\n", res + 1, s[res], t[res]);
}
AQUA16573837