結果

問題 No.365 ジェンガソート
ユーザー kotamanegi
提出日時 2016-04-29 22:28:15
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 13 ms / 2,000 ms
コード長 808 bytes
コンパイル時間 642 ms
コンパイル使用メモリ 79,344 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-12 01:38:12
合計ジャッジ時間 2,030 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 41
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:30:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   30 |         scanf("%d", &n);
      |         ~~~~~^~~~~~~~~~
main.cpp:31:24: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   31 |         REP(i, n) scanf("%d", &a[i]);
      |                   ~~~~~^~~~~~~~~~~~~

ソースコード

diff #
プレゼンテーションモードにする

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#define _SCL_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include<map>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cstdint>
#define REP(i,n) for(int i = 0;i < n;++i)
using namespace std;
int a[1000000] = {};
int main() {
int n;
scanf("%d", &n);
REP(i, n) scanf("%d", &a[i]);
int counter = 0;
int now_max = n;
for (int i = n - 1;i >= 0;--i) {
if (now_max != a[i]) {
counter++;
}
else {
now_max--;
}
}
cout << now_max << endl;
return 0;
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0