제출 #847707

#제출 시각아이디문제언어결과실행 시간메모리
847707NgTrung2217Rabbit Carrot (LMIO19_triusis)C++14
0 / 100
1 ms348 KiB
#include <bits/stdc++.h>
#define taskname ""
#define ff first
#define ss second
using namespace std;
using ld = long double;
using ull = unsigned long long;
using ll = long long;
using pll = pair <ll, ll>;
using pii = pair <int, int>;
const char el = '\n';
const char sp = ' ';
const ll oo = 1e9; //1e18;
const ll maxN = 1e5 + 5;
ll n, m;
ll e[maxN], c = 0;

int main ()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    if (fopen(taskname".inp", "r"))
    {
        freopen(taskname".inp","r",stdin);
        freopen(taskname".out","w",stdout);
    }
    cin >> n >> m;
    for (int i = 1;i <= n;++i)
    {
        ll x;
        cin >> x;
        if (i * m >= x)
        {
            x = i * m - x;
            int k = upper_bound(e + 1, e + 1 + n, x) - e;
            c += k > c;
            e[k] = x;
        }
    }
    cout << n - c;
}

컴파일 시 표준 에러 (stderr) 메시지

triusis.cpp: In function 'int main()':
triusis.cpp:24:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |         freopen(taskname".inp","r",stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
triusis.cpp:25:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   25 |         freopen(taskname".out","w",stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...