Submission #765544

# Submission time Handle Problem Language Result Execution time Memory
765544 2023-06-24T18:47:32 Z Ahmed57 Money (IZhO17_money) C++17
0 / 100
1 ms 300 KB
#include<bits/stdc++.h>

using namespace std;

int main(){
    int n;
    cin>>n;
    vector<pair<int,long long>>v;
    for(int i = 0;i<n;i++){
        long long x;cin>>x;
        v.push_back({i,x});
    }
    sort(v.begin(),v.end());
    long long ans = 1;
    for(int i = 1;i<n;i++){
        if(v[i].second<v[i-1].second)ans++;
    }
    cout<<ans<<endl;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 300 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 300 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 300 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 300 KB Output isn't correct
3 Halted 0 ms 0 KB -