結果

問題 No.481 1から10
ユーザー das08
提出日時 2019-10-25 14:07:16
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 212 bytes
コンパイル時間 672 ms
コンパイル使用メモリ 59,188 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-19 15:34:06
合計ジャッジ時間 1,413 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other AC * 1 WA * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:11: warning: ‘ans’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   12 |     cout<<ans<<endl;
      |           ^~~

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;

int main(){
    int ans;
    vector<int> a(9);
    for (int i=0;i<9;i++){
        cin>>a[i];
        if (a[i]!=i+1)ans=i+1;
    }
    cout<<ans<<endl;
}
0