結果
問題 | No.1786 Maximum Suffix Median (Online) |
ユーザー |
![]() |
提出日時 | 2021-12-15 16:23:44 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 184 ms / 2,000 ms |
コード長 | 363 bytes |
コンパイル時間 | 4,572 ms |
コンパイル使用メモリ | 196,340 KB |
最終ジャッジ日時 | 2025-01-26 23:09:47 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main() {ios::sync_with_stdio(false);cin.tie(nullptr);multiset<int, greater<>> st;int n;cin >> n;int ans = 0;for(int i = 0; i < n; i++) {int a;cin >> a;a ^= ans;st.insert(a);st.insert(a);st.erase(st.begin());ans = *st.begin();cout << ans << '\n';}}