답안 #172758

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
172758 2020-01-02T14:27:02 Z Swan Money (IZhO17_money) C++14
0 / 100
2 ms 376 KB
#include <bits/stdc++.h>
#define stop system("pause")
#define stop2 char o; cin >> o
#define INP freopen("pcb.in","r",stdin)
#define OUTP freopen ("pcb.out","w",stdout)
#define int long long
using namespace std;

const int maxn = 2e5+228;

vector<int> v;

main(){
    ios_base::sync_with_stdio(0);
    int n; cin >> n;
    int ans = 0;
    for(int i(0); i < n;i++){
        int x; cin >> x;
        v.push_back(x);
    }
    ans = 1;
    for(int i(1); i < v.size();i++){
        if(v[i] < v[i-1])ans++;
    }
    cout << ans;
}
/*
*/

Compilation message

money.cpp:13:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(){
      ^
money.cpp: In function 'int main()':
money.cpp:22:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i(1); i < v.size();i++){
                   ~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Halted 0 ms 0 KB -