Skip to content

Commit

Permalink
add yuki_0674
Browse files Browse the repository at this point in the history
  • Loading branch information
idat50me committed Nov 27, 2023
1 parent 100df2c commit 3fc6a95
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions test/yuki_0674.test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// competitive-verifier: PROBLEM https://yukicoder.me/problems/no/674

#ifndef call_include
#define call_include
#include <bits/stdc++.h>
using namespace std;
#endif

#include "structure/segment_set.cpp"

int main() {
long long D;
int Q;
SegmentSet<long long> s;

cin >> D >> Q;

long long ans = 0;
for(int i = 0; i < Q; i++) {
long long A, B;
cin >> A >> B;
s.insert(A, B);
auto p = s.get_seg(A);
ans = max(ans, p.second - p.first + 1);
cout << ans << endl;
}
}

0 comments on commit 3fc6a95

Please sign in to comment.