Submission #223817


Source Code Expand

#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <iterator>
#include <queue>
#include <stack>
#include <deque>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <string>
#include <cmath>
#include <complex>
#include <functional>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <cstdlib>
#include <cctype>
#include <bitset>

#define REP(i,m,n) for(int i=m;i<(int)n;i++)
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rrep(i,n) for(int i = 1; i <= n; i++)
#define drep(i,n) for(int i = n; i >= 0; i--)
#define rp(i,c) rep(i,(int)c.size())
#define fr(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define mp make_pair
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define rall(u) (u).rbegin(),(u).rend()
#define dbg(x) cerr<<#x<<" = "<<(x)<<endl
#define v_delete(a,b) (a).erase(remove((a).begin(), (a).end(), b), (a).end())
#define v_unique(a) (a).erase(unique((a).begin(), (a).end()), (a).end())
#define VV(T) vector<vector< T > >
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
const int inf=1<<28;
const double INF=1e10,EPS=1e-9;


template<class T>int SIZE(T a){return a.size();}
template<class T>string IntToString(T num){string res;stringstream ss;ss<<num;return ss.str();}
template<class T>T StringToInt(string str){T res=0;for(int i=0;i<SIZE(str);i++)res=(res*10+str[i]-'0');return res;}
template<class T>T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template<class T>T lcm(T a,T b){return a/gcd(a,b)*b;}

template <class T> void input(T& a, int n) { for (int i = 0; i < n; ++i) cin >> a[i]; }
template <class T> void input(T* a, int n) { for (int i = 0; i < n; ++i) cin >> a[i]; }

int chmax(int& a,int b){
	if(b > a){
		a=b;
	}
	return a;
}
int chmin(int& a,int b){
	if(b < a){
		a=b;
	}
	return a;
}

int main(int argc, char const *argv[])
{
	int N,K;
	cin >> N >> K;
	vector<pii> l;
	vector<pii> cache;
	rep(i,N){
		int t;
		cin >> t;
		l.pb(mp(t, i));
	}
	for(int i=K;i<=N;i++){
        copy(l.begin(), l.end(), back_inserter(cache) );
		sort(cache.begin(), cache.begin()+i);
		cout << cache[K-1].second + 1 << endl;
	}

	return 0;
}

Submission Info

Submission Time
Task B - 特別賞
User luyikei
Language C++ (G++ 4.6.4)
Score 40
Code Size 2335 Byte
Status TLE
Exec Time 2094 ms
Memory 526080 KB

Judge Result

Set Name Sample Subtask1 Subtask2
Score / Max Score 0 / 0 40 / 40 0 / 60
Status
AC × 2
AC × 13
AC × 13
TLE × 7
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
Subtask1 sample_01.txt, sample_02.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt
Subtask2 subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt
Case Name Status Exec Time Memory
sample_01.txt AC 23 ms 796 KB
sample_02.txt AC 23 ms 804 KB
subtask1_01.txt AC 23 ms 800 KB
subtask1_02.txt AC 23 ms 800 KB
subtask1_03.txt AC 23 ms 928 KB
subtask1_04.txt AC 24 ms 804 KB
subtask1_05.txt AC 84 ms 9116 KB
subtask1_06.txt AC 93 ms 9116 KB
subtask1_07.txt AC 23 ms 800 KB
subtask1_08.txt AC 61 ms 9116 KB
subtask1_09.txt AC 98 ms 9108 KB
subtask1_10.txt AC 51 ms 5016 KB
subtask1_11.txt AC 95 ms 9104 KB
subtask2_01.txt TLE 2061 ms 263164 KB
subtask2_02.txt AC 105 ms 9128 KB
subtask2_03.txt TLE 2067 ms 263804 KB
subtask2_04.txt TLE 2084 ms 525944 KB
subtask2_05.txt AC 94 ms 3016 KB
subtask2_06.txt TLE 2094 ms 526080 KB
subtask2_07.txt TLE 2048 ms 263800 KB
subtask2_08.txt TLE 2060 ms 525940 KB
subtask2_09.txt TLE 2048 ms 263804 KB