結果

問題 No.494 yukicoder
ユーザー takeya_okinotakeya_okino
提出日時 2017-06-20 19:37:46
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 234 bytes
コンパイル時間 559 ms
コンパイル使用メモリ 71,148 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-10 06:25:50
合計ジャッジ時間 1,158 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 1 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 1 ms
6,944 KB
testcase_08 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:13:20: warning: 'index' may be used uninitialized [-Wmaybe-uninitialized]
   13 |   cout << ans[index] << endl;
      |                    ^
main.cpp:9:7: note: 'index' was declared here
    9 |   int index;
      |       ^~~~~

ソースコード

diff #

#include <iostream>

using namespace std;
 
int main() {
  string s;
  cin >> s;
  string ans = "yukicoder";
  int index;
  for(int i = 0; i < 9; i++) {
    if(s[i] != ans[i]) index = i;
  }
  cout << ans[index] << endl;
  return 0;
}
0