結果
問題 |
No.3251 kthmex
|
ユーザー |
|
提出日時 | 2025-09-03 10:32:03 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 935 bytes |
コンパイル時間 | 5,443 ms |
コンパイル使用メモリ | 172,172 KB |
実行使用メモリ | 11,776 KB |
最終ジャッジ日時 | 2025-09-03 10:32:16 |
合計ジャッジ時間 | 12,587 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 4 TLE * 1 -- * 27 |
ソースコード
#include <iostream> #include <vector> #include <boost/container/flat_set.hpp> using namespace std; using boost::container::flat_set; int main() { int n, m; cin >> n >> m; vector<int> a(n); for (int i = 0; i < n; ++i) cin >> a[i]; for (int i = 0; i < m; ++i) { int t, l, r; cin >> t >> l >> r; if (t == 1) { int x, y; cin >> x >> y; for (int j = l; j <= r; ++j) { if (a[j] == x) a[j] = y; } } else { int k; cin >> k; flat_set<int> b(a.begin(), a.end()); // ソート済み重複なし int s = 0; for (int c : b) { if (k + s < c) { cout << k + s << endl; goto NEXT; } s++; } cout << k + s << endl; NEXT:; } } return 0; }