답안 #1112010

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1112010 2024-11-13T13:55:14 Z idk__ Baloni (COCI15_baloni) C++14
0 / 100
133 ms 14160 KB
    #include <bits/stdc++.h>
    using namespace std;
    #define int long long


    signed main() {
    ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
    int n;
    cin >> n;
    pair<int ,int> a[n];
    for(int i = 0;i < n ;i++){
        int x;cin >> x;
        a[i] = {x, i+1};
    }
    sort(a, a+n);
    reverse(a, a+n);

    int ans = n;
    for(int i = 1;i < n; i++){
        auto [v, idx] = a[i];
        auto [v1,idx1] = a[i-1];

        if(idx > idx1 and v1 - v==1){
            ans--;
        }


    }
    cout << ans;


    }

Compilation message

baloni.cpp: In function 'int main()':
baloni.cpp:20:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   20 |         auto [v, idx] = a[i];
      |              ^
baloni.cpp:21:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   21 |         auto [v1,idx1] = a[i-1];
      |              ^
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Incorrect 1 ms 336 KB Output isn't correct
3 Incorrect 1 ms 336 KB Output isn't correct
4 Incorrect 1 ms 336 KB Output isn't correct
5 Incorrect 121 ms 12624 KB Output isn't correct
6 Incorrect 133 ms 14160 KB Output isn't correct
7 Incorrect 111 ms 13896 KB Output isn't correct
8 Incorrect 113 ms 11600 KB Output isn't correct
9 Incorrect 115 ms 12380 KB Output isn't correct
10 Incorrect 117 ms 12864 KB Output isn't correct