답안 #311817

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
311817 2020-10-11T20:07:23 Z MarcoMeijer Bubble Sort 2 (JOI18_bubblesort2) C++14
0 / 100
7678 ms 888 KB
#include "bubblesort2.h"
#include <bits/stdc++.h>
using namespace std;

// macros
typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef pair<ll, ll> lll;
typedef tuple<int, int, int> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<ll> vll;
typedef vector<lll> vlll;
#define REP(a,b,c) for(int a=int(b); a<int(c); a++)
#define RE(a,c) REP(a,0,c)
#define RE1(a,c) REP(a,1,c+1)
#define REI(a,b,c) REP(a,b,c+1)
#define REV(a,b,c) for(int a=int(c-1); a>=int(b); a--)
#define FOR(a,b) for(auto& a : b)
#define all(a) a.begin(), a.end()
#define INF 1e9
#define EPS 1e-9
#define pb push_back
#define popb pop_back
#define fi first
#define se second
#define sz size()
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

vi countScans(vi A, vi X, vi V){
    int n=A.size();
	int q=X.size();
	vi ans(q);

    RE(j,q) {
        A[X[j]] = V[j];
        vi B = A;
        sort(all(B));
        int cAns = 0;
        RE(i,n) {
            cAns = max(cAns, int(upper_bound(all(B), A[i])-B.begin() - 1 - i));
        }
        ans[j] = cAns;
    }

	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 30 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 30 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 7678 ms 888 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 30 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -