Submission #1112369

# Submission time Handle Problem Language Result Execution time Memory
1112369 2024-11-14T06:48:56 Z vjudge1 Baloni (COCI15_baloni) C++17
0 / 100
2000 ms 14160 KB
#include <bits/stdc++.h>
#define int long long
using namespace std;
int32_t main()
{
    int n,tut,cev=0;
    cin >> n;
    int arr[n+5],visited[n+5];
    for(int i=0;i<n;i++){
    cin >> arr[i];
    visited[i]=0;
    }
    for(int i=0;i<n;i++)
    {
        if(visited[i]==1)
            continue; 
        visited[i]=1;
        cev++;
        tut=arr[i];
        tut--;
        for(int j=i+1;j<n;j++)
        {
            if(arr[j]==tut){
            visited[j]=1;
            tut--;
            }
        }
    }
    cout << cev;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Incorrect 2 ms 336 KB Output isn't correct
3 Incorrect 5 ms 504 KB Output isn't correct
4 Incorrect 6 ms 336 KB Output isn't correct
5 Execution timed out 2093 ms 12592 KB Time limit exceeded
6 Execution timed out 2076 ms 14160 KB Time limit exceeded
7 Execution timed out 2064 ms 11856 KB Time limit exceeded
8 Execution timed out 2065 ms 11600 KB Time limit exceeded
9 Execution timed out 2069 ms 12368 KB Time limit exceeded
10 Execution timed out 2053 ms 12624 KB Time limit exceeded