Submission #472307

# Submission time Handle Problem Language Result Execution time Memory
472307 2021-09-13T11:27:50 Z ZeyadWahid Nadan (COCI18_nadan) C++14
50 / 50
1 ms 204 KB
#include <bits/stdc++.h>
#include <chrono>
//#include <ext/pb_ds/detail/standard_policies.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define sinDegrees(x) sin((x) * PI / 180.0)
#define cosDegrees(x) cos((x) * PI / 180.0)
#define tanDegrees(x) tan((x) * PI / 180.0)
#define atanDegrees(x) atan(x)* 180.0 / PI
#define asinDegrees(x) asin(x)* 180.0 / PI
#define CEIL(a,b) (a+(b-1))/b)
#define flush fflush(stdout)
#define ULL unsigned long long
#define LL long long
#define LD long double
#define EPS 0.000000000000001
#define MOD 1000000007
#define endl '\n'
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
#define LOWER(s) transform(s.begin(),s.end(),s.begin(),::tolower)
#define UPPER(s) transform(s.begin(),s.end(),s.begin(),::toupper)
#define MAXN (int)1e5+5
#define OO (LL)1e14
#define PI acos(-1)
#define LONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONGLONG long long
//#pragma GCC optimize("trapv")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC optimize("-Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx2,tune=native")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-funroll-all-loops,-fpeel-loops,-funswitch-loops")

int dy[] = { 1,-1,0,0 };
int dx[] = { 0,0,1,-1 };

using namespace std;
using namespace chrono;

vector<int> v;

int f(int l,int r)
{
    
    int max = 0, len = 0;

    
    for (int i = l; i <= r; i++)
    {
        if (v[i] > v[i - 1])
            len++;
        else
        {
            if (max < len)
                max = len;

            len = 1;
        }
    }

    if (max < len)
        max = len;

    return max;
}
int32_t main() {
    //freopen("badsubs.in", "r", stdin);
    //freopen("badsubs.out", "w", stdout);
    //auto start = high_resolution_clock::now();
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n, k;
    cin >> k >> n;
    for (int i = 1; i <= n - 1; i++)
    {
        cout << i << endl;
        k -= i;
    }
    cout << k << endl;
    //auto stop = high_resolution_clock::now(); auto duration = duration_cast<microseconds>(stop - start); cout << "\n Time taken by Main(): " << duration.count() << " microseconds" << endl;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Correct 0 ms 204 KB Output is correct
10 Correct 0 ms 204 KB Output is correct