結果
| 問題 |
No.3251 kthmex
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-09-02 11:23:45 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 892 bytes |
| コンパイル時間 | 955 ms |
| コンパイル使用メモリ | 83,364 KB |
| 実行使用メモリ | 15,936 KB |
| 最終ジャッジ日時 | 2025-09-02 11:23:51 |
| 合計ジャッジ時間 | 6,043 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 4 TLE * 1 -- * 27 |
ソースコード
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
using namespace std;
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;
set<int> b(a.begin(), a.end());
int s = 0, found = 0;
for (int c : b) {
if (k + s < c) {
cout << k + s << endl;
found = 1;
break;
}
s++;
}
if (!found) cout << k + s << endl;
}
}
return 0;
}