結果
| 問題 | No.365 ジェンガソート | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2019-08-15 02:08:22 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 243 bytes | 
| コンパイル時間 | 2,285 ms | 
| コンパイル使用メモリ | 192,864 KB | 
| 最終ジャッジ日時 | 2025-01-07 11:51:46 | 
| ジャッジサーバーID (参考情報) | judge1 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 3 WA * 38 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:12: warning: ‘n’ is used uninitialized [-Wuninitialized]
    7 |     int a[n];
      |            ^
main.cpp:6:9: note: ‘n’ was declared here
    6 |     int n;
      |         ^
            
            ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    int n;
    int a[n];
    for(int i=0;i<n;i++)cin>>a[i];
    for (int i=n-1;i>=0;i--)
        if (a[i]==n)
            n--;
    cout<<n<<endl;
    return 0;
}
            
            
            
        