Codeforces Round #145 (Div. 2, ACM-ICPC Rules)
はい。
http://codeforces.com/contest/234
B. Reading
ざっくりと大意
・本を読むために明るいポイントをk箇所選んで、それが何番目のポイントか出力
方針のようなもの
・明るい方はソートすれば大きい順にみればだけど、何番目のかが難しい罠 ・下はエラーが出たもので要修正。。同じ値が2個以上あるときの処理が本当にアレ
#!/usr/bin/env python # -*- coding: UTF-8 -*- import time import sys import io import re import math import itertools sys.stdin=file('input.txt') sys.stdout=file('output.txt','w') #10**9+7 mod=1000000007 #start = time.clock() n,k=map(int,raw_input().split()) l=[int(x) for x in raw_input().split()] m=sorted(l) m=m[-k:] ans=chk=0 t=[] for i in m: if l.index(i) not in t: t.append(l.index(i)) else: c=l.index(i) while 1: if l[c+1:].index(i): t.append(l[c+1:]).index((i)+c+1) break else: c+=1 print min(m) t.sort() for i in t: print i+1,