답안 #852186

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
852186 2023-09-21T11:59:08 Z vjudge1 Bubble Sort 2 (JOI18_bubblesort2) C++17
0 / 100
6187 ms 872 KB
#include <bits/stdc++.h>
//#define int long long
#define ll long long
#define endl '\n'
#define pii pair<int,int>
#define vint vector<int>
#define vll vector<ll>
#define vpii vector<pii>
#define pb push_back
#define se second
#define fi first
#define all(x) x.begin(), x.end()
#define graph vector<vll>
using namespace std;
const int N = (int)2e5 + 69;
const int mod = (int)1e4 + 7;
const int naser = 3999, tourist = 3816;
int power(int a, int b) { int ans = 1; while (b) { if (b % 2) ans *= a; a *= a; b /= 2; } return ans; }
 
vint countScans(vint a, vint x, vint v) {
	int n = a.size();
	int q = x.size();
	vint ans(q);
	for (int j = 0; j < q; j++) {
		a[x[j]] = v[j];
		vint b = a;
		sort(all(b));
		map<int, pii> mp;
		for (int i = 0; i < n; i++) {
			if (!mp[b[i]].fi)
				mp[b[i]].fi = i + 1;
			else
				mp[b[i]].fi = min(mp[b[i]].fi, i + 1);
			mp[b[i]].se = max(mp[b[i]].se, i + 1);
		}
		for (int i = 1; i <= n; i++) {
			ans[j] = max(ans[j], min(abs(i - mp[a[i - 1]].fi), abs(i - mp[a[i - 1]].se)));
		}
	}
	return ans;
}

//int32_t main() {
//
//	vint ans = countScans({1,2,3,4}, {0,2}, {3,1});
//	for (int x : ans)
//		cout << x << endl;
//
//}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 62 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 62 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6187 ms 872 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 62 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -