結果

問題 No.365 ジェンガソート
ユーザー mai
提出日時 2016-04-29 22:35:39
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 464 bytes
コンパイル時間 530 ms
コンパイル使用メモリ 73,712 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-04 18:15:30
合計ジャッジ時間 2,301 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11 WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <queue>
#include <list>
#include <map>
#include <string>
#include <cstdio>

using namespace std;

int memo[100001];

int main(){
    int i,j,k,l,m,n;
    int c;
    
    cin >> n;
    
    m=0;c=1;
    for (i=0;i<n;i++){
        cin >> j;
        if (j==c){
            while (memo[++c]);
        }else{
            m++;
        }
        memo[j]=1;
    }
    
    cout << m << endl;
            
    
    return 0;
}
0