結果

問題 No.481 1から10
ユーザー das08
提出日時 2019-10-25 14:09:32
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 209 bytes
コンパイル時間 489 ms
コンパイル使用メモリ 58,104 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-19 15:45:24
合計ジャッジ時間 1,006 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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=1;i<10;i++){
        cin>>a[i];
        if (a[i]!=i)ans=i;
    }
    cout<<ans<<endl;
}
0