Submission #960240

# Submission time Handle Problem Language Result Execution time Memory
960240 2024-04-10T01:26:06 Z khangrl Studentsko (COCI14_studentsko) C++14
0 / 100
2 ms 604 KB
#include<bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define pb push_back
using namespace std;
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n, k;
	vector <pair <int, int> > v, sub;
	cin>>n>>k;
	for(int i=1; i<=n; i++){
		int a;
		cin>>a;
		v.pb({a, i});
	}
	sort(v.begin(), v.end());
	int y=1, i=1;
	for(auto x:v){
		sub.pb({x.ss, y});
		if(i%k==0){
			y++;
		}
		i++;
	}
	sort(sub.begin(), sub.end());
	vector <int> ans;
	vector <int> ::iterator itr;
	for(auto x:sub){
		itr=upper_bound(ans.begin(), ans.end(), x.ss);
		if(itr==ans.end()){
			ans.pb(x.ss);
		}
	}
	cout<<n-ans.size();
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 564 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 604 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 564 KB Output isn't correct
2 Halted 0 ms 0 KB -