結果

問題 No.504 ゲーム大会(ランキング)
ユーザー Kmcode1Kmcode1
提出日時 2017-04-21 22:55:44
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 48 ms / 2,000 ms
コード長 842 bytes
コンパイル時間 2,115 ms
コンパイル使用メモリ 153,268 KB
実行使用メモリ 5,544 KB
最終ジャッジ日時 2023-09-27 12:22:08
合計ジャッジ時間 3,408 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 48 ms
5,508 KB
testcase_08 AC 48 ms
5,524 KB
testcase_09 AC 48 ms
5,456 KB
testcase_10 AC 47 ms
5,448 KB
testcase_11 AC 48 ms
5,508 KB
testcase_12 AC 30 ms
5,400 KB
testcase_13 AC 29 ms
5,508 KB
testcase_14 AC 48 ms
5,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
using namespace std;

int n;

struct BIT{
	vector<long double> bit;
	void resize(int N){
		bit.assign(N, 0);
	}
	void add(int i, long double j){
		i++;
		while (i < bit.size()){
			bit[i] += j;
			i += i&-i;
		}
	}
	long double sum(int i){
		long double r = 0;
		i++;
		while (i){
			r += bit[i];
			i -= i&-i;
		}
		return r;
	}
};


vector<int> v;
vector<int> vv;
BIT b;

int main(){
	cin >> n;
	for (int i = 0; i < n; i++){
		int a;
		scanf("%d", &a);
		v.push_back(a);
	}
	b.resize(v.size());
	vv = v;
	sort(vv.begin(), vv.end());
	vv.erase(unique(vv.begin(), vv.end()), vv.end());
	int D = 0;
	for (int i = 0; i < v.size(); i++){
		v[i] = lower_bound(vv.begin(), vv.end(), v[i]) - vv.begin();
		if (v[0] < v[i]){
			D++;
		}
		printf("%d\n", D + 1);
	}
	return 0;
}
0