結果

問題 No.1786 Maximum Suffix Median (Online)
ユーザー 沙耶花沙耶花
提出日時 2021-12-15 01:56:19
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 155 ms / 2,000 ms
コード長 443 bytes
コンパイル時間 1,889 ms
コンパイル使用メモリ 201,300 KB
実行使用メモリ 13,032 KB
最終ジャッジ日時 2023-10-01 02:20:44
合計ジャッジ時間 7,805 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 131 ms
11,820 KB
testcase_09 AC 82 ms
9,112 KB
testcase_10 AC 90 ms
9,704 KB
testcase_11 AC 71 ms
8,508 KB
testcase_12 AC 140 ms
12,340 KB
testcase_13 AC 131 ms
11,632 KB
testcase_14 AC 97 ms
9,892 KB
testcase_15 AC 106 ms
10,524 KB
testcase_16 AC 111 ms
10,736 KB
testcase_17 AC 92 ms
9,448 KB
testcase_18 AC 151 ms
12,756 KB
testcase_19 AC 155 ms
12,856 KB
testcase_20 AC 155 ms
13,032 KB
testcase_21 AC 154 ms
12,732 KB
testcase_22 AC 153 ms
12,776 KB
testcase_23 AC 107 ms
10,740 KB
testcase_24 AC 75 ms
8,560 KB
testcase_25 AC 124 ms
12,108 KB
testcase_26 AC 99 ms
10,860 KB
testcase_27 AC 84 ms
10,192 KB
testcase_28 AC 103 ms
11,672 KB
testcase_29 AC 1 ms
4,380 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 124 ms
12,708 KB
testcase_32 AC 130 ms
12,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define Inf 1000000001

int main(){
	
	int last = 0;
	
	
	int N;
	scanf("%d",&N);
	multiset<int> S;
	S.insert(0);
	rep(i,N){
		int A;
		scanf("%d",&A);
		A ^= last;
		rep(j,2)S.insert(A+1);
		
		auto it = S.end();
		it--;
		S.erase(it);
		it = S.end();
		it--;
		int ok = *it;
		ok--;
		printf("%d\n",ok);
		last = ok;
	}
	
	
	return 0;
}
0