Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .verify-helper/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[[languages.cpp.environments]]
CXX = "g++"
CXXFLAGS = ["-std=c++23", "-O2", "-Wno-deprecated", "-Wno-cpp", "-Wno-pragma-once-outside-header", "-Wno-sign-compare", "-D_GLIBCXX_DEBUG"]
CXXFLAGS = ["-std=c++23", "-O2", "-Wno-deprecated", "-Wno-cpp", "-Wno-pragma-once-outside-header", "-Wno-sign-compare"]
4 changes: 3 additions & 1 deletion datastructure/fenwick.dsl_2_b.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include "misc/template.hpp"

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, q;
cin >> n >> q;
Fenwick<int> bit(n + 1);
Expand All @@ -12,7 +14,7 @@ int main() {
if (c == 0) {
bit.add(x, y);
} else {
cout << bit.get(y) - bit.get(x - 1) << endl;
cout << bit.get(y) - bit.get(x - 1) << "\n";
}
}
return 0;
Expand Down
4 changes: 3 additions & 1 deletion datastructure/lazysegtree.aoj1351.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
int N, Q;
string s;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> N >> Q >> s;
vector<int> v(N), q(Q);
set<int> cl;
Expand Down Expand Up @@ -46,7 +48,7 @@ int main() {
s[l] = ')';
st.add(l, N, -2);
}
cout << l + 1 << endl;
cout << l + 1 << "\n";
}
return 0;
}
4 changes: 3 additions & 1 deletion datastructure/segmenttree.dsl_2_a.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include "misc/template.hpp"

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, q;
cin >> n >> q;
SegmentTree<int> st(n, INT_MAX);
Expand All @@ -13,7 +15,7 @@ int main() {
if (c == 0)
st.update(x, y);
else
cout << st.query(x, y + 1) << endl;
cout << st.query(x, y + 1) << "\n";
}
return 0;
}
8 changes: 5 additions & 3 deletions geometry/arrangement.aoj1279.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const double INF = 1e+10;
#include "graph/graph.hpp"

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
for (;;) {
int n;
cin >> n;
Expand Down Expand Up @@ -68,13 +70,13 @@ int main() {
vector<double> dist(ps.size());
dijkstra(graph, si, dist, prev);
if (dist[gi] == INF) {
cout << -1 << endl;
cout << -1 << "\n";
} else {
vector<int> path = buildPath(prev, gi);
for (const auto& v : path) {
cout << (int)ps[v].real() << " " << (int)ps[v].imag() << endl;
cout << (int)ps[v].real() << " " << (int)ps[v].imag() << "\n";
}
cout << 0 << endl;
cout << 0 << "\n";
}
}
}
4 changes: 3 additions & 1 deletion geometry/arrangement.aoj2448.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include "graph/graph.hpp"

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N;
cin >> N;
vector<P> ps(N);
Expand All @@ -35,6 +37,6 @@ int main() {
sort(ALL(res));
for (const auto& r : res)
sum += r;
cout << fixed << setprecision(5) << sum << endl;
cout << fixed << setprecision(5) << sum << "\n";
return 0;
}
4 changes: 3 additions & 1 deletion geometry/closestpair.cgl_5_a.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "misc/template.hpp"

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
vector<P> v(n);
Expand All @@ -13,6 +15,6 @@ int main() {
cin >> x >> y;
v[i] = P(x, y);
}
cout << fixed << setprecision(10) << closestPair(v) << endl;
cout << fixed << setprecision(10) << closestPair(v) << "\n";
return 0;
}
4 changes: 3 additions & 1 deletion geometry/convexcut.cgl_4_c.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include "misc/template.hpp"

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
Polygon p;
Expand All @@ -22,7 +24,7 @@ int main() {
int x1, x2, y1, y2;
cin >> x1 >> y1 >> x2 >> y2;
Polygon Q = convex_cut(p, Line(P(x1, y1), P(x2, y2)));
cout << area(Q) << endl;
cout << area(Q) << "\n";
}
return 0;
}
6 changes: 4 additions & 2 deletions geometry/convexhull.cgl_4_a.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "misc/template.hpp"

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
vector<P> v(n);
Expand All @@ -19,9 +21,9 @@ int main() {
if (lessY(p[i], p[idx]))
idx = i;
}
cout << m << endl;
cout << m << "\n";
for (int i = 0; i < m; ++i) {
cout << (int)p[(idx + i) % m].real() << " " << (int)p[(idx + i) % m].imag() << endl;
cout << (int)p[(idx + i) % m].real() << " " << (int)p[(idx + i) % m].imag() << "\n";
}
return 0;
}
4 changes: 3 additions & 1 deletion geometry/crosspoint.aoj2402.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ vector<Segment> star(int x, int y, int a, int r) {
}

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
for (;;) {
int N, M, L;
cin >> N >> M >> L;
Expand All @@ -91,6 +93,6 @@ int main() {
vector<Weight> dist(N);
vector<int> prev(N);
dijkstra(g, M - 1, dist, prev);
cout << fixed << setprecision(10) << dist[L - 1] << endl;
cout << fixed << setprecision(10) << dist[L - 1] << "\n";
}
}
4 changes: 3 additions & 1 deletion geometry/crosspoint.cgl_2_b.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "misc/template.hpp"

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int q;
cin >> q;
for (int i = 0; i < q; ++i) {
Expand All @@ -13,7 +15,7 @@ int main() {
cin >> a >> b >> c >> d;
L.push_back(Segment(P(a, b), P(c, d)));
}
cout << (intersectSS(L[0], L[1]) ? 1 : 0) << endl;
cout << (intersectSS(L[0], L[1]) ? 1 : 0) << "\n";
}
return 0;
}
4 changes: 3 additions & 1 deletion geometry/crosspoint.cgl_2_c.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "geometry/geometry.hpp"
#include "misc/template.hpp"
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int q;
cin >> q;
for (int i = 0; i < q; ++i) {
Expand All @@ -15,6 +17,6 @@ int main() {
}
P p = crosspointSS(L[0], L[1]);
cout << fixed << setprecision(10);
cout << real(p) << " " << imag(p) << endl;
cout << real(p) << " " << imag(p) << "\n";
}
}
4 changes: 3 additions & 1 deletion geometry/crosspoint.cgl_2_d.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "misc/template.hpp"

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int q;
cin >> q;
for (int i = 0; i < q; ++i) {
Expand All @@ -15,7 +17,7 @@ int main() {
L.push_back(Segment(P(a, b), P(c, d)));
}
cout << fixed << setprecision(11);
cout << distanceSS(L[0], L[1]) << endl;
cout << distanceSS(L[0], L[1]) << "\n";
}
return 0;
}
4 changes: 3 additions & 1 deletion geometry/crosspoint.cgl_7_d.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "misc/template.hpp"

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int x, y, r, q;
cin >> x >> y >> r >> q;
Circle C(x, y, r);
Expand All @@ -19,7 +21,7 @@ int main() {
cout << fixed << setprecision(10) << real(vp[j]) << " " << imag(vp[j]);
if (j == 0) cout << " ";
}
cout << endl;
cout << "\n";
}
return 0;
}
4 changes: 3 additions & 1 deletion geometry/crosspoint.cgl_7_e.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "misc/template.hpp"

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
vector<Circle> v;
for (int i = 0; i < 2; ++i) {
int x, y, r;
Expand All @@ -15,6 +17,6 @@ int main() {
if (!lessX(ps.first, ps.second)) swap(ps.first, ps.second);
cout << fixed << setprecision(10);
cout << real(ps.first) << " " << imag(ps.first) << " ";
cout << real(ps.second) << " " << imag(ps.second) << endl;
cout << real(ps.second) << " " << imag(ps.second) << "\n";
return 0;
}
4 changes: 3 additions & 1 deletion geometry/geometry.cgl_1_a.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "misc/template.hpp"

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int x1, x2, y1, y2, q;
cin >> x1 >> y1 >> x2 >> y2 >> q;
Line L(P(x1, y1), P(x2, y2));
Expand All @@ -12,7 +14,7 @@ int main() {
cin >> x >> y;
P p = projection(L, P(x, y));
cout << fixed << setprecision(10);
cout << real(p) << " " << imag(p) << endl;
cout << real(p) << " " << imag(p) << "\n";
}
return 0;
}
4 changes: 3 additions & 1 deletion geometry/geometry.cgl_1_b.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "misc/template.hpp"

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int x1, x2, y1, y2, q;
cin >> x1 >> y1 >> x2 >> y2 >> q;
Line L(P(x1, y1), P(x2, y2));
Expand All @@ -12,7 +14,7 @@ int main() {
cin >> x >> y;
P p = reflection(L, P(x, y));
cout << fixed << setprecision(10);
cout << real(p) << " " << imag(p) << endl;
cout << real(p) << " " << imag(p) << "\n";
}
return 0;
}
12 changes: 7 additions & 5 deletions geometry/geometry.cgl_1_c.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
#include "misc/template.hpp"

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int x1, x2, y1, y2, q;
cin >> x1 >> y1 >> x2 >> y2 >> q;
Line L(P(x1, y1), P(x2, y2));
for (int i = 0; i < q; ++i) {
int x, y;
cin >> x >> y;
int c = ccw(L[0], L[1], P(x, y));
if (c == 0) cout << "ON_SEGMENT" << endl;
else if (c == 2) cout << "ONLINE_BACK" << endl;
else if (c == -2) cout << "ONLINE_FRONT" << endl;
else if (c == 1) cout << "COUNTER_CLOCKWISE" << endl;
else cout << "CLOCKWISE" << endl;
if (c == 0) cout << "ON_SEGMENT" << "\n";
else if (c == 2) cout << "ONLINE_BACK" << "\n";
else if (c == -2) cout << "ONLINE_FRONT" << "\n";
else if (c == 1) cout << "COUNTER_CLOCKWISE" << "\n";
else cout << "CLOCKWISE" << "\n";
}
return 0;
}
4 changes: 3 additions & 1 deletion geometry/geometry.cgl_2_a.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include "misc/template.hpp"

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int q;
cin >> q;
for (int i = 0; i < q; ++i) {
Expand All @@ -15,7 +17,7 @@ int main() {
int r = 0;
if (parallel(L[0], L[1])) r = 2;
else if (orthogonal(L[0], L[1])) r = 1;
cout << r << endl;
cout << r << "\n";
}
return 0;
}
4 changes: 3 additions & 1 deletion geometry/polygon.cgl_3_a.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "misc/template.hpp"

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
Polygon p(n);
Expand All @@ -13,6 +15,6 @@ int main() {
p[i] = P(x, y);
}
cout << fixed << setprecision(1);
cout << area(p) << endl;
cout << area(p) << "\n";
return 0;
}
4 changes: 3 additions & 1 deletion geometry/polygon.cgl_3_b.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "misc/template.hpp"

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
Polygon p(n);
Expand All @@ -12,6 +14,6 @@ int main() {
cin >> x >> y;
p[i] = P(x, y);
}
cout << (convex(p) ? 1 : 0) << endl;
cout << (convex(p) ? 1 : 0) << "\n";
return 0;
}
8 changes: 5 additions & 3 deletions geometry/polygon.cgl_3_c.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "misc/template.hpp"

int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
cin >> n;
Polygon p(n);
Expand All @@ -18,9 +20,9 @@ int main() {
int x, y;
cin >> x >> y;
int c = contains(p, P(x, y));
if (c == OUT) cout << 0 << endl;
else if (c == ON) cout << 1 << endl;
else cout << 2 << endl;
if (c == OUT) cout << 0 << "\n";
else if (c == ON) cout << 1 << "\n";
else cout << 2 << "\n";
}
return 0;
}
Loading
Loading