답안 #501900

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
501900 2022-01-04T18:36:07 Z SirCovidThe19th Money (IZhO17_money) C++17
0 / 100
0 ms 292 KB
#include <bits/stdc++.h>
using namespace std; 

int main(){
    int n; cin >> n; int A[n], ans = 1; multiset<int> S;
    for (int i = 0; i < n; i++) cin >> A[i], S.insert(A[i]);

    for (int i = n - 1; i; i--){ //should we include i and i - 1?
        if (A[i - 1] > A[i] or *next(S.find(A[i - 1])) != A[i]) ans++;
        S.erase(S.find(A[i]));
    }
    cout<<ans<<endl;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 292 KB Output is correct
4 Incorrect 0 ms 204 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 292 KB Output is correct
4 Incorrect 0 ms 204 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 292 KB Output is correct
4 Incorrect 0 ms 204 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 292 KB Output is correct
4 Incorrect 0 ms 204 KB Output isn't correct
5 Halted 0 ms 0 KB -