Submission #1165730

#TimeUsernameProblemLanguageResultExecution timeMemory
1165730TsaganaJJOOII 2 (JOI20_ho_t2)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>chiki  tv ganbat hiigeegui!!!

#define IOS ios_base::sync_with_stdio(false);cin.tie();cout.tie();
#define all(x) x.begin(), x.end()
#define int long long
#define pq priority_queue
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define pp pop_back
#define F first
#define S second

using namespace std;

void solve () {
	int n, k;
	string str;
	cin >> n >> k >> str;

	vector<vector<int>> pos(3);
	vector<int> last(4, -1e9);
	map<char, int> id = {{'J', 0}, {'O', 1}, {'I', 2}};
	int ans = 1e9;

	for (int i = 0; i < n; i++) {
		last[0] = i;
		int x = id[str[i]];
		pos[x].pb(last[x]);
		if (pos[x].size() >= k) last[x + 1] = pos[x][pos[x].size() - k];
		ans = min(ans, i - last[3] + 1 - 3 * k);
	}

	if (ans > n) ans = -1;
	cout << ans << '\n';
}
signed main() {IOS solve(); return 0;}

Compilation message (stderr)

ho_t2.cpp:1:31: warning: extra tokens at end of #include directive
    1 | #include<bits/stdc++.h>chiki  tv ganbat hiigeegui!!!
      |                               ^~
ho_t2.cpp:1:9: fatal error: bits/stdc++.h>chik: No such file or directory
    1 | #include<bits/stdc++.h>chiki  tv ganbat hiigeegui!!!
      |         ^~~~~~~~~~~~~~~~~~~~
compilation terminated.