結果
| 問題 |
No.365 ジェンガソート
|
| コンテスト | |
| ユーザー |
Lay_ec
|
| 提出日時 | 2016-04-29 23:39:18 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 505 bytes |
| コンパイル時間 | 596 ms |
| コンパイル使用メモリ | 78,884 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-04 19:20:10 |
| 合計ジャッジ時間 | 1,813 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 WA * 32 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:31:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
31 | scanf("%d",&now);
| ~~~~~^~~~~~~~~~~
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <set>
#include <sstream>
#include <map>
#include <queue>
#include <stack>
using namespace std;
const long long mod=1000000007;
int main()
{
int n;
cin>>n;
int prev;
cin>>prev;
int res=0;
for(int i=1;i<n;i++){
int now;
scanf("%d",&now);
if(prev>now) res++;
prev=now;
}
cout<<res<<endl;
return 0;
}
Lay_ec