結果

問題 No.494 yukicoder
ユーザー takeya_okinotakeya_okino
提出日時 2017-06-20 19:25:23
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 239 bytes
コンパイル時間 2,213 ms
コンパイル使用メモリ 193,228 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-10 06:15:26
合計ジャッジ時間 2,842 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>

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;
  }
  printf("%d\n", ans[index]);
  return 0;
}
0