結果

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