Submission #966242

# Submission time Handle Problem Language Result Execution time Memory
966242 2024-04-19T14:58:33 Z vjudge1 Financial Report (JOI21_financial) C++17
5 / 100
45 ms 8912 KB
#include <bits/stdc++.h>
using namespace std;

#define ff(i, a, b) for(auto i=(a); i<=(b); ++i)
#define ffr(i, b, a) for(auto i=(b); i>=(a); --i)
#define nl "\n"
#define ss " "
#define sz size()
#define pb emplace_back
#define pf push_front
#define fi first
#define se second
#define ms(a,x) memset(a, x, sizeof (a))
#define re exit(0)

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pair<int, int> > vpii;
typedef vector<pair<ll, ll> > vpll;

const ll mod=1e9+7, maxn=3e5+5, inf=1e18;

void rf(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    if(fopen("o.inp","r")){
        freopen("o.inp","r",stdin); freopen("o.out","w",stdout);
    }
}

int n, d, a[maxn];
pii f[maxn];
vi v;

int main()
{
    rf();
    cin>>n>>d;
    ff(i, 1, n) cin>>a[i], f[i].fi, f[i].se=a[i];
    if(d==n)
    {
        ff(i, 1, n)
        {
            auto it=lower_bound(v.begin(), v.end(), a[i]);
            if(it==v.end()) v.pb(a[i]);
            else *it=a[i];
        }
        cout<<v.sz;
    }
    re;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:11:12: warning: right operand of comma operator has no effect [-Wunused-value]
   11 | #define fi first
      |            ^
Main.cpp:44:33: note: in expansion of macro 'fi'
   44 |     ff(i, 1, n) cin>>a[i], f[i].fi, f[i].se=a[i];
      |                                 ^~
Main.cpp: In function 'void rf()':
Main.cpp:32:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   32 |         freopen("o.inp","r",stdin); freopen("o.out","w",stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~
Main.cpp:32:44: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   32 |         freopen("o.inp","r",stdin); freopen("o.out","w",stdout);
      |                                     ~~~~~~~^~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 23 ms 3776 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 26 ms 4180 KB Output is correct
2 Correct 41 ms 6768 KB Output is correct
3 Correct 38 ms 6736 KB Output is correct
4 Correct 45 ms 6748 KB Output is correct
5 Correct 39 ms 7636 KB Output is correct
6 Correct 39 ms 6896 KB Output is correct
7 Correct 29 ms 8912 KB Output is correct
8 Correct 23 ms 6864 KB Output is correct
9 Correct 31 ms 7392 KB Output is correct
10 Correct 35 ms 6900 KB Output is correct
11 Correct 38 ms 6740 KB Output is correct
12 Correct 25 ms 6736 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -