This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
#define rep(i, n) for (int i = 0; i < (int)(n); ++i) | |
using ll = long long; | |
vector<pair<char, int>> rle(string s) { | |
vector<pair<char, int>> vp; | |
int l = 0, n = s.size(); | |
while (l < n) { | |
int r = l; | |
while (r < n && s[l] == s[r]) ++r; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
#define rep(i, n) for (int i = 0; i < (int)(n); ++i) | |
using vi = vector<int>; | |
string S; | |
signed main() { | |
cin.tie(0)->sync_with_stdio(0); | |
cin >> S; | |
vi dp(26, 1 << 30); | |
dp[25] = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int n, a[50], s[50], x, y; | |
signed main() { | |
cin.tie(0)->sync_with_stdio(0); | |
cin >> n; | |
#define rep(i, n) for (int i = 0; i < (int)(n); ++i) | |
rep(i, n) cin >> a[i] >> s[i]; | |
cin >> x >> y; | |
vector<pair<int, int>> ans; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
#define rep(i, n) for (int i = 0; i < (int)(n); ++i) | |
using ll = long long; | |
// x < y < z | |
ll count1(ll N) { | |
ll ret = 0; | |
for (ll x = 1; x * x * x < N; ++x) { | |
for (ll y = x + 1; x * y * y < N; ++y) { | |
ll l = y, r = N / (x * y); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
#define rep(i, n) for (int i = 0; i < (int)(n); ++i) | |
using ll = long long; | |
int N; | |
ll R; | |
tuple<ll, ll, ll> XYZ[2 << 10]; | |
pair<ll, int> qi[2 << 10]; | |
vector<vector<int>> g; | |
bool vis[2 << 10]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
#define rep(i, n) for (int i = 0; i < (int)(n); ++i) | |
using ll = long long; | |
constexpr int inf = 1 << 30; | |
int N, Q; | |
string S; | |
vector<ll> path(ll x) { | |
vector<ll> ret = {x}; | |
while (2 <= x) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
#define rep(i, n) for (int i = 0; i < (int)(n); ++i) | |
using ll = long long; | |
int N; | |
signed main() { | |
cin.tie(0)->sync_with_stdio(0); | |
cin >> N; | |
vector<ll> A(N); | |
rep(i, N) cin >> A[i]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
#define rep(i, n) for (int i = 0; i < (int)(n); ++i) | |
using ll = long long; | |
int N, A[3 << 17], B[3 << 17]; | |
map<pair<int, int>, int> mp; | |
signed main() { | |
cin.tie(0)->sync_with_stdio(0); | |
cin >> N; | |
int same = 0; |