problem_id stringlengths 6 6 | language stringclasses 2 values | original_status stringclasses 3 values | original_src stringlengths 19 243k | changed_src stringlengths 19 243k | change stringclasses 3 values | i1 int64 0 8.44k | i2 int64 0 8.44k | j1 int64 0 8.44k | j2 int64 0 8.44k | error stringclasses 270 values | stderr stringlengths 0 226k |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02722 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
typedef pair<ll, ll> pll;
#define MOD 1000000007
#define INF 1000000000
#define mp make_pair
#define pb push_back
#define ss second
#define ff first
#define endl '\n'
#define pl cout << endl;
void fast() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
const long long INFll = 1ll * INF * INF;
const long double PI =
3.141592653589793238462643383279502884197169399375105820974944;
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define gcd(a, b) __gcd((a), (b))
#define lcm(a, b) ((a) * (b)) / gcd((a), (b))
#define debug(x) cout << x << endl;
#define sz(a) int((a).size())
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
struct custom_hash {
static uint64_t splitmix64(uint64_t x) {
// http://xorshift.di.unimi.it/splitmix64.c
x += 0x9e3779b97f4a7c15;
x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
return x ^ (x >> 31);
}
size_t operator()(uint64_t x) const {
static const uint64_t FIXED_RANDOM =
chrono::steady_clock::now().time_since_epoch().count();
return splitmix64(x + FIXED_RANDOM);
}
};
long long genrand(long long L, long long R) {
return uniform_int_distribution<long long>(L, R)(rng);
}
// use brackets before operations if taking MOD
// use map only when necessary
// give long long to arrays and variables properly
int mul(int a, int b, int mod = MOD) { return int(a * 1ll * b % mod); }
int norm(int a, int mod = MOD) {
while (a >= mod)
a -= mod;
while (a < 0)
a += mod;
// a = (a%mod+mod)%mod;
return a;
}
int powmod(int x, int y, int mod = MOD) {
int res = 1;
while (y > 0) {
if (y & 1)
res = mul(res, x, mod);
x = mul(x, x, mod);
y = y >> 1;
}
return res;
}
int inv(int a, int mod = MOD) { return powmod(a, mod - 2); }
int main() {
#ifndef ONLINE_JUDGE
freopen("/home/jam1729/Codes/in.txt", "r", stdin);
freopen("/home/jam1729/Codes/out.txt", "w", stdout);
#endif
fast();
long long n;
cin >> n;
unordered_map<long long, bool> m;
for (long long k = 1; k * k <= n; k++) {
if (n % k == 0) {
long long A = k, B = n / k;
long long X = A, Y = B;
long long temp = n;
if (X != 1) {
while (temp % X == 0) {
temp /= X;
}
if (temp == 1)
m[X] = 1;
}
if (Y != 1) {
temp = n;
while (temp % Y == 0) {
temp /= Y;
}
if (temp == 1)
m[Y] = 1;
}
for (long long i = 1; i * i <= A - 1; i++) {
if ((A - 1) % i == 0) {
long long X = i, Y = (A - 1) / i;
long long temp = B;
if (X != 1) {
while (temp % X == 0) {
temp /= X;
}
if (temp == 1)
m[X] = 1;
}
if (Y != 1) {
temp = B;
while (temp % Y == 0) {
temp /= Y;
}
if (temp == 1)
m[Y] = 1;
}
}
}
swap(A, B);
for (long long i = 1; i * i <= A - 1; i++) {
if ((A - 1) % i == 0) {
long long X = i, Y = (A - 1) / i;
long long temp = B;
if (X != 1) {
while (temp % X == 0) {
temp /= X;
}
if (temp == 1)
m[X] = 1;
}
if (Y != 1) {
temp = B;
while (temp % Y == 0) {
temp /= Y;
}
if (temp == 1)
m[Y] = 1;
}
}
}
}
}
for (long long k = 1; k * k <= n - 1; k++) {
if ((n - 1) % k == 0) {
m[k] = true;
m[(n - 1) / k] = true;
}
}
m[n] = true;
long long res = m.size() - m[1];
// for(auto e: m){
// cerr<<e.ff<<' ';
// }
cout << res << endl;
return 0;
} | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
typedef pair<ll, ll> pll;
#define MOD 1000000007
#define INF 1000000000
#define mp make_pair
#define pb push_back
#define ss second
#define ff first
#define endl '\n'
#define pl cout << endl;
void fast() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
}
const long long INFll = 1ll * INF * INF;
const long double PI =
3.141592653589793238462643383279502884197169399375105820974944;
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define gcd(a, b) __gcd((a), (b))
#define lcm(a, b) ((a) * (b)) / gcd((a), (b))
#define debug(x) cout << x << endl;
#define sz(a) int((a).size())
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
struct custom_hash {
static uint64_t splitmix64(uint64_t x) {
// http://xorshift.di.unimi.it/splitmix64.c
x += 0x9e3779b97f4a7c15;
x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
return x ^ (x >> 31);
}
size_t operator()(uint64_t x) const {
static const uint64_t FIXED_RANDOM =
chrono::steady_clock::now().time_since_epoch().count();
return splitmix64(x + FIXED_RANDOM);
}
};
long long genrand(long long L, long long R) {
return uniform_int_distribution<long long>(L, R)(rng);
}
// use brackets before operations if taking MOD
// use map only when necessary
// give long long to arrays and variables properly
int mul(int a, int b, int mod = MOD) { return int(a * 1ll * b % mod); }
int norm(int a, int mod = MOD) {
while (a >= mod)
a -= mod;
while (a < 0)
a += mod;
// a = (a%mod+mod)%mod;
return a;
}
int powmod(int x, int y, int mod = MOD) {
int res = 1;
while (y > 0) {
if (y & 1)
res = mul(res, x, mod);
x = mul(x, x, mod);
y = y >> 1;
}
return res;
}
int inv(int a, int mod = MOD) { return powmod(a, mod - 2); }
int main() {
fast();
long long n;
cin >> n;
unordered_map<long long, bool> m;
for (long long k = 1; k * k <= n; k++) {
if (n % k == 0) {
long long A = k, B = n / k;
long long X = A, Y = B;
long long temp = n;
if (X != 1) {
while (temp % X == 0) {
temp /= X;
}
if (temp == 1)
m[X] = 1;
}
if (Y != 1) {
temp = n;
while (temp % Y == 0) {
temp /= Y;
}
if (temp == 1)
m[Y] = 1;
}
for (long long i = 1; i * i <= A - 1; i++) {
if ((A - 1) % i == 0) {
long long X = i, Y = (A - 1) / i;
long long temp = B;
if (X != 1) {
while (temp % X == 0) {
temp /= X;
}
if (temp == 1)
m[X] = 1;
}
if (Y != 1) {
temp = B;
while (temp % Y == 0) {
temp /= Y;
}
if (temp == 1)
m[Y] = 1;
}
}
}
swap(A, B);
for (long long i = 1; i * i <= A - 1; i++) {
if ((A - 1) % i == 0) {
long long X = i, Y = (A - 1) / i;
long long temp = B;
if (X != 1) {
while (temp % X == 0) {
temp /= X;
}
if (temp == 1)
m[X] = 1;
}
if (Y != 1) {
temp = B;
while (temp % Y == 0) {
temp /= Y;
}
if (temp == 1)
m[Y] = 1;
}
}
}
}
}
for (long long k = 1; k * k <= n - 1; k++) {
if ((n - 1) % k == 0) {
m[k] = true;
m[(n - 1) / k] = true;
}
}
m[n] = true;
long long res = m.size() - m[1];
// for(auto e: m){
// cerr<<e.ff<<' ';
// }
cout << res << endl;
return 0;
} | delete | 73 | 77 | 73 | 73 | TLE | |
p02722 | C++ | Runtime Error |
#include <bits/stdc++.h>
using namespace std;
int yakusuu(long long a) {
int count = 0;
for (int i = 2; i <= sqrt(a); i++) {
if (a % i == 0) {
if (i == sqrt(a))
count++;
else
count += 2;
}
}
count++;
return count;
}
int main() {
long long n;
cin >> n;
long long count = 0;
count += yakusuu(n - 1);
if (n == 2) {
cout << 1;
return 1;
}
for (int i = 2; i <= sqrt(n); i++) {
long long a = n;
while (a % i == 0) {
a /= i;
if (a == 1) {
count++;
break;
}
}
}
for (int i = 2; i <= sqrt(n); i++) {
long long a = n;
if (a % i != 0)
continue;
while (a % i == 0) {
a /= i;
}
if (a == 1)
continue;
if ((a - 1) % i == 0)
count++;
}
cout << count + 1;
return 0;
} |
#include <bits/stdc++.h>
using namespace std;
int yakusuu(long long a) {
int count = 0;
for (int i = 2; i <= sqrt(a); i++) {
if (a % i == 0) {
if (i == sqrt(a))
count++;
else
count += 2;
}
}
count++;
return count;
}
int main() {
long long n;
cin >> n;
long long count = 0;
count += yakusuu(n - 1);
if (n == 2) {
cout << 1;
return 0;
}
for (int i = 2; i <= sqrt(n); i++) {
long long a = n;
while (a % i == 0) {
a /= i;
if (a == 1) {
count++;
break;
}
}
}
for (int i = 2; i <= sqrt(n); i++) {
long long a = n;
if (a % i != 0)
continue;
while (a % i == 0) {
a /= i;
}
if (a == 1)
continue;
if ((a - 1) % i == 0)
count++;
}
cout << count + 1;
return 0;
} | replace | 25 | 26 | 25 | 26 | 0 | |
p02722 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i, n, k) for (int i = (n); i < (k); i++)
#define ALL(a) (a).begin(), (a).end()
ll ans = 0;
ll calc(ll n, ll k) {
if (n % k == 0)
return n / k;
else
return n - k;
}
vector<ll> divisor(ll n) {
vector<ll> div;
for (ll i = 1; i * i <= n; i++) {
if (n % i == 0) {
if (i != 1)
div.push_back(i);
if (i * i != n)
div.push_back(n / i);
}
}
return div;
}
void Main() {
ll n;
cin >> n;
vector<ll> div1 = divisor(n);
vector<ll> div2 = divisor(n - 1);
for (auto i : div1) {
ll n2 = n;
while (n2 >= i) {
n2 = calc(n2, i);
if (n2 % i == 1) {
ans++;
break;
}
}
}
ans += div2.size();
cout << ans << endl;
}
int main() {
Main();
/*
東方風神録は神が出てくるので当然神ゲー
*/
return 0;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i, n, k) for (int i = (n); i < (k); i++)
#define ALL(a) (a).begin(), (a).end()
ll ans = 0;
ll calc(ll n, ll k) {
if (n % k == 0)
return n / k;
else
return n - k;
}
vector<ll> divisor(ll n) {
vector<ll> div;
for (ll i = 1; i * i <= n; i++) {
if (n % i == 0) {
if (i != 1)
div.push_back(i);
if (i * i != n)
div.push_back(n / i);
}
}
return div;
}
void Main() {
ll n;
cin >> n;
vector<ll> div1 = divisor(n);
vector<ll> div2 = divisor(n - 1);
for (auto i : div1) {
ll n2 = n;
while (n2 >= i) {
n2 = calc(n2, i);
if (n2 % i == 1) {
ans++;
break;
}
if (n2 % i > 1) {
break;
}
}
}
ans += div2.size();
cout << ans << endl;
}
int main() {
Main();
/*
東方風神録は神が出てくるので当然神ゲー
*/
return 0;
} | insert | 37 | 37 | 37 | 40 | TLE | |
p02722 | C++ | Time Limit Exceeded | #include <algorithm>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
// マクロ&定数&関数 ================================================
typedef unsigned int uint;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<bool> vbool;
typedef vector<string> vstring;
typedef vector<pair<int, int>> vpint;
typedef vector<pair<ll, ll>> vpll;
typedef vector<pair<double, double>> vpdouble;
typedef vector<vector<int>> vvint;
typedef vector<vector<ll>> vvll;
typedef vector<vpint> vvpint;
typedef vector<vpll> vvpll;
typedef vector<vector<double>> vvdouble;
typedef vector<vector<string>> vvstring;
typedef vector<vector<bool>> vvbool;
typedef vector<vector<vector<ll>>> vvvll;
typedef vector<vector<vector<bool>>> vvvbool;
const int INF = 1e9 + 1;
const ll LLINF = 1e17 + 1;
const int DX[9] = {0, 0, 1, -1, 1, 1, -1, -1, 0}; // 4;4近傍
const int DY[9] = {1, -1, 0, 0, 1, -1, 1, -1, 0}; // 8:8近傍 9:(0,0)を含む
const double PI = 3.14159265358979323846264338327950288;
// VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
const ll MOD = 1000000007; // 10^9 + 7
// VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
} else
return false;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return 1;
} else
return false;
}
//---------------------------------------------------------------
// オーバーフローチェック
//---------------------------------------------------------------
void is_overflow(ll a, ll b) {
if ((a * b) / b != a)
cout << "OVERFLOW!!!!!" << endl;
}
//---------------------------------------------------------------
// 整数の乱数生成
//---------------------------------------------------------------
ll random_int(ll start, ll last) {
// srand((uint)time(NULL));
return start + rand() % (last - start + 1);
}
//---------------------------------------------------------------
// x∈[a, b)
//---------------------------------------------------------------
bool is_in(ll x, ll a, ll b) { return (a <= x && x < b); }
//---------------------------------------------------------------
// 約数列挙
//---------------------------------------------------------------
vll divisor(ll n) {
vll ret;
for (ll i = 1; i * i <= n; i++) {
if (n % i == 0) {
ret.push_back(i);
if (i * i != n)
ret.push_back(n / i);
}
}
sort(begin(ret), end(ret));
return (ret);
}
//---------------------------------------------------------------
// N以下のすべての素数を列挙する(エラトステネスの篩)
//---------------------------------------------------------------
vbool searchSosuu(ll N) {
vbool sosuu;
for (ll i = 0; i < N; i++) {
sosuu.emplace_back(true);
}
sosuu[0] = false;
sosuu[1] = false;
for (ll i = 2; i < N; i++) {
if (sosuu[i]) {
for (ll j = 2; i * j < N; j++) {
sosuu[i * j] = false;
}
}
}
return sosuu;
}
//---------------------------------------------------------------
// 素因数分解 O(√N)
//---------------------------------------------------------------
vpll to_prime(ll n) {
vpll prime_factor;
for (ll i = 2; i * i <= n; i++) {
ll count = 0;
while (n % i == 0) {
count++;
n /= i;
}
if (count) {
pair<ll, ll> temp = {i, count};
prime_factor.emplace_back(temp);
}
}
if (n != 1) {
pair<ll, ll> temp = {n, 1};
prime_factor.emplace_back(temp);
}
return prime_factor;
}
//---------------------------------------------------------------
// 素数判定
//---------------------------------------------------------------
bool is_sosuu(ll N) {
if (N < 2)
return false;
else if (N == 2)
return true;
else if (N % 2 == 0)
return false;
for (ll i = 3; i <= sqrt(N); i += 2) {
if (N % i == 0)
return false;
}
return true;
}
//---------------------------------------------------------------
// 最大公約数(ユークリッドの互除法)
//---------------------------------------------------------------
ll gcd(ll a, ll b) {
if (a < b) {
ll tmp = a;
a = b;
b = tmp;
}
ll r = a % b;
while (r != 0) {
a = b;
b = r;
r = a % b;
}
return b;
}
//---------------------------------------------------------------
// 最小公倍数
//---------------------------------------------------------------
ll lcm(ll a, ll b) {
ll temp = gcd(a, b);
return temp * (a / temp) * (b / temp);
}
//---------------------------------------------------------------
// 階乗
//---------------------------------------------------------------
ll factorial(ll n) {
if (n <= 1) {
return 1;
}
return (n * (factorial(n - 1))) % MOD;
}
//---------------------------------------------------------------
// 高速コンビネーション計算(前処理:O(N) 計算:O(1))
//---------------------------------------------------------------
// テーブルを作る前処理
ll comb_const = 300005;
vll fac(comb_const), finv(comb_const), inv(comb_const);
bool COMineted = false;
void COMinit(ll mod = MOD) {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (ll i = 2; i < comb_const; i++) {
fac[i] = fac[i - 1] * i % mod;
inv[i] = mod - inv[mod % i] * (mod / i) % mod;
finv[i] = finv[i - 1] * inv[i] % mod;
}
COMineted = true;
}
// 二項係数計算
ll COM(ll n, ll k, ll mod = MOD) {
if (COMineted == false)
COMinit(mod);
if (n < k)
return 0;
if (n < 0 || k < 0)
return 0;
return (fac[n] * (finv[k] * finv[n - k] % mod)) % mod;
}
//---------------------------------------------------------------
// 繰り返し2乗法 base^sisuu
//---------------------------------------------------------------
ll RepeatSquaring(ll base, ll sisuu, ll mod = MOD) {
if (sisuu < 0) {
cout << "RepeatSquaring: 指数が負です!" << endl;
return 0;
}
if (sisuu == 0)
return 1;
if (sisuu % 2 == 0) {
ll t = RepeatSquaring(base, sisuu / 2, mod) % mod;
return (t * t) % mod;
}
return (base * RepeatSquaring(base, sisuu - 1, mod)) % mod;
}
//---------------------------------------------------------------
// 高速単発コンビネーション計算(O(logN))
//---------------------------------------------------------------
ll fast_com(ll a, ll b, ll mod = MOD) {
ll bunshi = 1;
ll bunbo = 1;
for (ll i = 1; i <= b; i++) {
bunbo *= i;
bunbo %= mod;
bunshi *= (a - i + 1);
bunshi %= mod;
}
ll ret = bunshi * RepeatSquaring(bunbo, mod - 2, mod);
ret %= mod;
while (ret < 0) {
ret += mod;
}
return ret;
}
//---------------------------------------------------------------
// 整数をビットのリストに変換する ll->vbool
//---------------------------------------------------------------
vbool to_bitlist(ll bit, ll fixed_size = 1) {
if (bit == 0)
return vbool(fixed_size, 0);
vbool list;
while (bit > 0) {
list.emplace_back(bit & 1);
bit /= 2;
}
while (list.size() < fixed_size) {
list.emplace_back(0);
}
return list;
}
//---------------------------------------------------------------
// 座標圧縮(O(NlogN)) 0スタートになることに注意!
//---------------------------------------------------------------
class PosPress {
/*
配列Pを座圧→instance = PosPress(P);
座圧済み配列→instance.arr
fooの圧縮後→instance.func[foo]
fooの圧縮前→instance.rev[foo]
*/
public:
vll arr;
map<ll, ll> func;
map<ll, ll> rev;
PosPress(vll P) {
arr = P;
sort(P.begin(), P.end());
func[P[0]] = 0;
rev[0] = P[0];
ll next = 1;
for (int i = 1; i < P.size(); i++) {
if (P[i] != P[i - 1]) {
func[P[i]] = next;
rev[next] = P[i];
next++;
}
}
for (int i = 0; i < P.size(); i++) {
arr[i] = func[arr[i]];
}
}
};
//---------------------------------------------------------------
// 行列累乗(O(N^3))
//---------------------------------------------------------------
vvll mat_cross(vvll A, vvll B) {
ll N = A.size();
ll K = B.size();
ll M = B[0].size();
vvll C(N, vll(M));
for (int i = 0; i < N; i++)
for (int j = 0; j < M; j++)
for (int k = 0; k < K; k++)
C[i][j] += A[i][k] * B[k][j];
return C;
}
//---------------------------------------------------------------
// 2直線の交差判定(直線(x1, y1)->(x2, y2) と 直線(X1, Y1)->(X2, Y2))
//---------------------------------------------------------------
bool is_cross(ll x1, ll y1, ll x2, ll y2, ll X1, ll Y1, ll X2, ll Y2) {
ll dx_ai = X1 - x1;
ll dy_ai = Y1 - y1;
ll dx_bi = X1 - x2;
ll dy_bi = Y1 - y2;
ll dx_ai2 = X2 - x1;
ll dy_ai2 = Y2 - y1;
ll dx_bi2 = X2 - x2;
ll dy_bi2 = Y2 - y2;
ll si = dx_ai * dy_bi - dy_ai * dx_bi;
ll si2 = dx_ai2 * dy_bi2 - dy_ai2 * dx_bi2;
ll si3 = dx_ai * dy_ai2 - dy_ai * dx_ai2;
ll si4 = dx_bi * dy_bi2 - dy_bi * dx_bi2;
return (si * si2 < 0 && si3 * si4 < 0);
}
//---------------------------------------------------------------
// 最長増加部分列の長さ(O(NlogN))
//---------------------------------------------------------------
ll LSI(vll vec) {
ll size = vec.size();
vll lsi(size + 1); // 長さjを作った時の右端の最小値
for (ll i = 0; i <= size; i++) {
lsi[i] = LLINF;
}
lsi[0] = 0;
lsi[1] = vec[0];
for (ll i = 1; i < size; i++) {
// 初めてvec[i]の方が小さくなるところを探す
auto Iter = lower_bound(lsi.begin(), lsi.end(), vec[i]);
ll idx = Iter - lsi.begin();
if (idx > 0 && lsi[idx - 1] < vec[i]) {
lsi[idx] = vec[i];
}
}
for (ll i = size; i >= 0; i--) {
if (lsi[i] < LLINF) {
return i;
}
}
}
//---------------------------------------------------------------
// LCS(最長共通部分列) O(|S||T|)
//---------------------------------------------------------------
string LCS(string S, string T) {
vvll dp(S.length() + 1);
for (int i = 0; i < dp.size(); i++) {
vll t(T.length() + 1, 0);
dp[i] = t;
}
for (int i = 0; i < S.length(); i++) {
for (int j = 0; j < T.length(); j++) {
dp[i + 1][j + 1] = max({dp[i][j] + ll(S[i] == T[j]), dp[i + 1][j],
dp[i][j + 1], dp[i + 1][j + 1]});
}
}
ll len = dp[S.length()][T.length()];
string ans = "";
ll i = dp.size() - 1;
ll j = dp[0].size() - 1;
while (len > 0) {
if (dp[i - 1][j] == len) {
i--;
} else if (dp[i][j - 1] == len) {
j--;
} else {
ans += S[i - 1];
i--;
j--;
len--;
}
}
reverse(ans.begin(), ans.end());
return ans;
}
vll LCS(vll S, vll T) {
vvll dp(S.size() + 1);
for (int i = 0; i < dp.size(); i++) {
vll t(T.size() + 1, 0);
dp[i] = t;
}
for (int i = 0; i < S.size(); i++) {
for (int j = 0; j < T.size(); j++) {
dp[i + 1][j + 1] = max({dp[i][j] + ll(S[i] == T[j]), dp[i + 1][j],
dp[i][j + 1], dp[i + 1][j + 1]});
}
}
ll len = dp[S.size()][T.size()];
vll ans;
ll i = dp.size() - 1;
ll j = dp[0].size() - 1;
while (len > 0) {
if (dp[i - 1][j] == len) {
i--;
} else if (dp[i][j - 1] == len) {
j--;
} else {
ans.emplace_back(S[i - 1]);
i--;
j--;
len--;
}
}
reverse(ans.begin(), ans.end());
return ans;
}
//---------------------------------------------------------------
// 木の根からの深さ
//---------------------------------------------------------------
vll tree_depth(vvll edge, ll start_node) {
ll n_node = edge.size();
vll dist(n_node, LLINF);
dist[start_node] = 0;
stack<pll> S;
S.push({start_node, 0});
while (!S.empty()) {
ll node = S.top().first;
ll d = S.top().second;
dist[node] = d;
S.pop();
for (int i = 0; i < edge[node].size(); i++) {
if (dist[edge[node][i]] == LLINF) {
S.push({edge[node][i], d + 1});
}
}
}
return dist;
}
//---------------------------------------------------------------
// ワーシャルフロイド法(O(N^3)) d: 正方行列(N*N)
//---------------------------------------------------------------
vvll warshall_floyd(vvll d) {
ll n = d.size();
for (int k = 0; k < n; k++) { // 経由する頂点
for (int i = 0; i < n; i++) { // 始点
for (int j = 0; j < n; j++) { // 終点
d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
}
}
}
return d;
}
//---------------------------------------------------------------
// Union Find
//---------------------------------------------------------------
class UnionFind {
public:
/*
UnionFind uf(要素の個数);
for(int i = 0;i < 関係の個数; i++)
{
uf.merge(A[i], B[i]);
}
nを含む集合の大きさ = uf.size(n)
nを含む集合の代表者 = uf.root(n)
集合の個数 = uf.n_group
*/
vector<ll> par; // 各元の親を表す配列
vector<ll> siz; // 素集合のサイズを表す配列(1 で初期化)
ll n_group; // 集合の数
// Constructor
UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) {
for (ll i = 0; i < sz_; ++i)
par[i] = i; // 初期では親は自分自身
n_group = sz_;
}
void init(ll sz_) {
par.resize(sz_);
siz.assign(sz_, 1LL); // resize だとなぜか初期化されなかった
for (ll i = 0; i < sz_; ++i)
par[i] = i; // 初期では親は自分自身
}
// Member Function
// Find
ll root(ll x) { // 根の検索
while (par[x] != x) {
x = par[x] = par[par[x]]; // x の親の親を x の親とする
}
return x;
}
// Union(Unite, Merge)
bool merge(ll x, ll y) {
x = root(x);
y = root(y);
if (x == y)
return false;
// merge technique(データ構造をマージするテク.小を大にくっつける)
if (siz[x] < siz[y])
swap(x, y);
siz[x] += siz[y];
par[y] = x;
n_group--;
return true;
}
bool issame(ll x, ll y) { // 連結判定
return root(x) == root(y);
}
ll size(ll x) { // 素集合のサイズ
return siz[root(x)];
}
};
//---------------------------------------------------------------
// ダイクストラ(O(ElogV)) edge: 隣接リスト from->pair{to, cost}
//---------------------------------------------------------------
class Dijkstra {
public:
vll dist; // iまでの最短距離
vll past; // (iまで最短で行くときの一つ前)
// edge[i] -> {to, cost}
Dijkstra(vvpll edge, ll start)
: dist(edge.size(), LLINF), past(edge.size(), -1) {
using Pi = pll;
priority_queue<Pi, vector<Pi>, greater<Pi>> que;
dist[start] = 0;
que.emplace(dist[start], start);
while (!que.empty()) {
ll cost;
int idx;
tie(cost, idx) = que.top();
que.pop();
if (dist[idx] < cost)
continue;
for (int i = 0; i < edge[idx].size(); i++) {
ll next_cost = cost + edge[idx][i].second;
if (dist[edge[idx][i].first] <= next_cost)
continue;
dist[edge[idx][i].first] = next_cost;
past[edge[idx][i].first] = idx;
que.emplace(dist[edge[idx][i].first], edge[idx][i].first);
}
}
}
// goalまでの最短経路
vll shortest(ll goal) {
vll ret;
while (goal != -1) {
ret.emplace_back(goal);
goal = past[goal];
}
reverse(ret.begin(), ret.end());
return ret;
}
};
//---------------------------------------------------------------
// LCA: 最近共通祖先 (O())
//---------------------------------------------------------------
class Lca {
public:
vll depth; // 根0からiまでの最短距離
vvll doubling;
ll n_bit = 30;
// edge[i] -> {to, cost}
Lca(vvll edge) : doubling(50, vll(edge.size(), -1)) {
// 深さ
depth = tree_depth(edge, 0);
// ダブリングで親を辿れるようにする
// jから2^i回親を辿ったノード
doubling[0][0] = -1;
for (int i = 1; i < edge.size(); i++)
for (int j : edge[i])
if (depth[i] > depth[j]) {
doubling[0][i] = j;
break;
}
for (int i = 1; i < n_bit; i++)
for (int j = 0; j < edge.size(); j++) {
if (doubling[i - 1][j] != -1)
doubling[i][j] = doubling[i - 1][doubling[i - 1][j]];
else
doubling[i][j] = -1;
}
}
// aとbの最近共通祖先
ll get_lca(ll a, ll b) {
// depth[a] >= depth[b]にする
if (depth[a] < depth[b])
swap(a, b);
ll oa = a;
ll ob = b;
ll d = depth[a] - depth[b];
// aをdだけさかのぼる。
vbool bit = to_bitlist(d, n_bit);
for (int i = 0; i < n_bit; i++)
if (bit[i])
a = doubling[i][a];
// depth[a] == depth[b]になっている。
for (int i = n_bit - 1; i >= 0; i--) {
if (doubling[i][a] == doubling[i][b])
continue;
a = doubling[i][a];
b = doubling[i][b];
}
return a == b ? a : doubling[0][a];
}
};
//---------------------------------------------------------------
// Z-algorithm(SとS[i:]の最長接頭辞長) O(|S|)
//---------------------------------------------------------------
vll Zalgorithm(string S) {
ll n = S.size();
vll Z(n, 0);
ll start = -1;
ll last = -1;
for (ll i = 1; i < n; i++) {
if (start >= 0) {
Z[i] = min(Z[i - start], last - i);
chmax(Z[i], 0LL);
}
while (i + Z[i] < S.size() && S[Z[i]] == S[i + Z[i]])
Z[i]++;
if (last < i + Z[i]) {
last = i + Z[i];
start = i;
}
}
Z[0] = n;
return Z;
}
vll Zalgorithm(vll S) {
ll n = S.size();
vll Z(n, 0);
ll start = -1;
ll last = -1;
for (ll i = 1; i < n; i++) {
if (start >= 0) {
Z[i] = min(Z[i - start], last - i);
chmax(Z[i], 0LL);
}
while (i + Z[i] < S.size() && S[Z[i]] == S[i + Z[i]])
Z[i]++;
if (last < i + Z[i]) {
last = i + Z[i];
start = i;
}
}
Z[0] = n;
return Z;
}
//---------------------------------------------------------------
// 二部グラフ判定(O(E)) edge -> リスト
//---------------------------------------------------------------
bool is_bipartite(vvll edge) {
ll N = edge.size();
vll color(N, -1);
color[0] = 0;
queue<ll> Q;
Q.push(0);
while (!Q.empty()) {
ll now = Q.front();
Q.pop();
for (int i : edge[now]) {
if (color[i] == -1) {
color[i] = (color[now] == 0 ? 1 : 0);
Q.push(i);
} else if (color[i] == color[now]) {
return false;
}
}
}
return true;
}
//---------------------------------------------------------------
// セグメント木
//---------------------------------------------------------------
class SegmentTree {
public:
const ll SEG_LEN = 1 << 19;
vector<set<ll>> seg;
ll s;
SegmentTree(vll A) : seg(SEG_LEN * 2, set<ll>({})) {
s = A.size();
for (int i = 0; i < A.size(); i++) {
seg[i + SEG_LEN] = {A[i]};
}
for (int i = 0; i < A.size(); i++) {
ll pos = i + SEG_LEN;
while (true) {
pos /= 2;
if (pos <= 0)
break;
if (seg[pos * 2 + 1].size() < seg[pos * 2].size()) {
seg[pos] = seg[pos * 2];
for (auto itr = seg[pos * 2 + 1].begin();
itr != seg[pos * 2 + 1].end(); ++itr) {
seg[pos].insert(*itr);
}
} else {
seg[pos] = seg[pos * 2 + 1];
for (auto itr = seg[pos * 2].begin(); itr != seg[pos * 2].end();
++itr) {
seg[pos].insert(*itr);
}
}
}
}
}
ll seg_max(ll left, ll right) {
left += SEG_LEN;
right += SEG_LEN + 1;
set<ll> ret = {};
vbool used(s + 1, false);
while (left < right) {
while (left % 2 == 1) {
if (seg[left].size()) {
for (auto itr = seg[left].begin(); itr != seg[left].end(); ++itr) {
if (!used[*itr]) {
ret.insert(*itr);
used[*itr] = true;
}
}
}
left++;
}
while (right % 2 == 1) {
if (seg[right - 1].size()) {
for (auto itr = seg[right - 1].begin(); itr != seg[right - 1].end();
++itr) {
if (!used[*itr]) {
ret.insert(*itr);
used[*itr] = true;
}
}
}
right--;
}
left /= 2;
right /= 2;
}
return ret.size();
}
};
//========================================================================
//========================================================================
//========================================================================
//========================================================================
int main() {
//////==================================
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
cout << fixed << setprecision(25);
//////==================================
/*
~思いついたことはとりあえず絶対メモする!!~
*/
ll N;
cin >> N;
vll all;
vll div = divisor(N);
for (ll d : div) {
all.emplace_back(d);
}
div = divisor(N - 1);
for (ll d : div) {
all.emplace_back(d);
}
ll ans = 0;
map<ll, bool> used;
used[1] = true;
for (ll a : all) {
if (used[a])
continue;
else
used[a] = true;
ll n = N;
while (n >= a) {
if (n % a == 0) {
n /= a;
} else {
n -= a;
}
}
if (n == 1)
ans++;
}
cout << ans << endl;
} | #include <algorithm>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
// マクロ&定数&関数 ================================================
typedef unsigned int uint;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<double> vdouble;
typedef vector<bool> vbool;
typedef vector<string> vstring;
typedef vector<pair<int, int>> vpint;
typedef vector<pair<ll, ll>> vpll;
typedef vector<pair<double, double>> vpdouble;
typedef vector<vector<int>> vvint;
typedef vector<vector<ll>> vvll;
typedef vector<vpint> vvpint;
typedef vector<vpll> vvpll;
typedef vector<vector<double>> vvdouble;
typedef vector<vector<string>> vvstring;
typedef vector<vector<bool>> vvbool;
typedef vector<vector<vector<ll>>> vvvll;
typedef vector<vector<vector<bool>>> vvvbool;
const int INF = 1e9 + 1;
const ll LLINF = 1e17 + 1;
const int DX[9] = {0, 0, 1, -1, 1, 1, -1, -1, 0}; // 4;4近傍
const int DY[9] = {1, -1, 0, 0, 1, -1, 1, -1, 0}; // 8:8近傍 9:(0,0)を含む
const double PI = 3.14159265358979323846264338327950288;
// VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
const ll MOD = 1000000007; // 10^9 + 7
// VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
} else
return false;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return 1;
} else
return false;
}
//---------------------------------------------------------------
// オーバーフローチェック
//---------------------------------------------------------------
void is_overflow(ll a, ll b) {
if ((a * b) / b != a)
cout << "OVERFLOW!!!!!" << endl;
}
//---------------------------------------------------------------
// 整数の乱数生成
//---------------------------------------------------------------
ll random_int(ll start, ll last) {
// srand((uint)time(NULL));
return start + rand() % (last - start + 1);
}
//---------------------------------------------------------------
// x∈[a, b)
//---------------------------------------------------------------
bool is_in(ll x, ll a, ll b) { return (a <= x && x < b); }
//---------------------------------------------------------------
// 約数列挙
//---------------------------------------------------------------
vll divisor(ll n) {
vll ret;
for (ll i = 1; i * i <= n; i++) {
if (n % i == 0) {
ret.push_back(i);
if (i * i != n)
ret.push_back(n / i);
}
}
sort(begin(ret), end(ret));
return (ret);
}
//---------------------------------------------------------------
// N以下のすべての素数を列挙する(エラトステネスの篩)
//---------------------------------------------------------------
vbool searchSosuu(ll N) {
vbool sosuu;
for (ll i = 0; i < N; i++) {
sosuu.emplace_back(true);
}
sosuu[0] = false;
sosuu[1] = false;
for (ll i = 2; i < N; i++) {
if (sosuu[i]) {
for (ll j = 2; i * j < N; j++) {
sosuu[i * j] = false;
}
}
}
return sosuu;
}
//---------------------------------------------------------------
// 素因数分解 O(√N)
//---------------------------------------------------------------
vpll to_prime(ll n) {
vpll prime_factor;
for (ll i = 2; i * i <= n; i++) {
ll count = 0;
while (n % i == 0) {
count++;
n /= i;
}
if (count) {
pair<ll, ll> temp = {i, count};
prime_factor.emplace_back(temp);
}
}
if (n != 1) {
pair<ll, ll> temp = {n, 1};
prime_factor.emplace_back(temp);
}
return prime_factor;
}
//---------------------------------------------------------------
// 素数判定
//---------------------------------------------------------------
bool is_sosuu(ll N) {
if (N < 2)
return false;
else if (N == 2)
return true;
else if (N % 2 == 0)
return false;
for (ll i = 3; i <= sqrt(N); i += 2) {
if (N % i == 0)
return false;
}
return true;
}
//---------------------------------------------------------------
// 最大公約数(ユークリッドの互除法)
//---------------------------------------------------------------
ll gcd(ll a, ll b) {
if (a < b) {
ll tmp = a;
a = b;
b = tmp;
}
ll r = a % b;
while (r != 0) {
a = b;
b = r;
r = a % b;
}
return b;
}
//---------------------------------------------------------------
// 最小公倍数
//---------------------------------------------------------------
ll lcm(ll a, ll b) {
ll temp = gcd(a, b);
return temp * (a / temp) * (b / temp);
}
//---------------------------------------------------------------
// 階乗
//---------------------------------------------------------------
ll factorial(ll n) {
if (n <= 1) {
return 1;
}
return (n * (factorial(n - 1))) % MOD;
}
//---------------------------------------------------------------
// 高速コンビネーション計算(前処理:O(N) 計算:O(1))
//---------------------------------------------------------------
// テーブルを作る前処理
ll comb_const = 300005;
vll fac(comb_const), finv(comb_const), inv(comb_const);
bool COMineted = false;
void COMinit(ll mod = MOD) {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (ll i = 2; i < comb_const; i++) {
fac[i] = fac[i - 1] * i % mod;
inv[i] = mod - inv[mod % i] * (mod / i) % mod;
finv[i] = finv[i - 1] * inv[i] % mod;
}
COMineted = true;
}
// 二項係数計算
ll COM(ll n, ll k, ll mod = MOD) {
if (COMineted == false)
COMinit(mod);
if (n < k)
return 0;
if (n < 0 || k < 0)
return 0;
return (fac[n] * (finv[k] * finv[n - k] % mod)) % mod;
}
//---------------------------------------------------------------
// 繰り返し2乗法 base^sisuu
//---------------------------------------------------------------
ll RepeatSquaring(ll base, ll sisuu, ll mod = MOD) {
if (sisuu < 0) {
cout << "RepeatSquaring: 指数が負です!" << endl;
return 0;
}
if (sisuu == 0)
return 1;
if (sisuu % 2 == 0) {
ll t = RepeatSquaring(base, sisuu / 2, mod) % mod;
return (t * t) % mod;
}
return (base * RepeatSquaring(base, sisuu - 1, mod)) % mod;
}
//---------------------------------------------------------------
// 高速単発コンビネーション計算(O(logN))
//---------------------------------------------------------------
ll fast_com(ll a, ll b, ll mod = MOD) {
ll bunshi = 1;
ll bunbo = 1;
for (ll i = 1; i <= b; i++) {
bunbo *= i;
bunbo %= mod;
bunshi *= (a - i + 1);
bunshi %= mod;
}
ll ret = bunshi * RepeatSquaring(bunbo, mod - 2, mod);
ret %= mod;
while (ret < 0) {
ret += mod;
}
return ret;
}
//---------------------------------------------------------------
// 整数をビットのリストに変換する ll->vbool
//---------------------------------------------------------------
vbool to_bitlist(ll bit, ll fixed_size = 1) {
if (bit == 0)
return vbool(fixed_size, 0);
vbool list;
while (bit > 0) {
list.emplace_back(bit & 1);
bit /= 2;
}
while (list.size() < fixed_size) {
list.emplace_back(0);
}
return list;
}
//---------------------------------------------------------------
// 座標圧縮(O(NlogN)) 0スタートになることに注意!
//---------------------------------------------------------------
class PosPress {
/*
配列Pを座圧→instance = PosPress(P);
座圧済み配列→instance.arr
fooの圧縮後→instance.func[foo]
fooの圧縮前→instance.rev[foo]
*/
public:
vll arr;
map<ll, ll> func;
map<ll, ll> rev;
PosPress(vll P) {
arr = P;
sort(P.begin(), P.end());
func[P[0]] = 0;
rev[0] = P[0];
ll next = 1;
for (int i = 1; i < P.size(); i++) {
if (P[i] != P[i - 1]) {
func[P[i]] = next;
rev[next] = P[i];
next++;
}
}
for (int i = 0; i < P.size(); i++) {
arr[i] = func[arr[i]];
}
}
};
//---------------------------------------------------------------
// 行列累乗(O(N^3))
//---------------------------------------------------------------
vvll mat_cross(vvll A, vvll B) {
ll N = A.size();
ll K = B.size();
ll M = B[0].size();
vvll C(N, vll(M));
for (int i = 0; i < N; i++)
for (int j = 0; j < M; j++)
for (int k = 0; k < K; k++)
C[i][j] += A[i][k] * B[k][j];
return C;
}
//---------------------------------------------------------------
// 2直線の交差判定(直線(x1, y1)->(x2, y2) と 直線(X1, Y1)->(X2, Y2))
//---------------------------------------------------------------
bool is_cross(ll x1, ll y1, ll x2, ll y2, ll X1, ll Y1, ll X2, ll Y2) {
ll dx_ai = X1 - x1;
ll dy_ai = Y1 - y1;
ll dx_bi = X1 - x2;
ll dy_bi = Y1 - y2;
ll dx_ai2 = X2 - x1;
ll dy_ai2 = Y2 - y1;
ll dx_bi2 = X2 - x2;
ll dy_bi2 = Y2 - y2;
ll si = dx_ai * dy_bi - dy_ai * dx_bi;
ll si2 = dx_ai2 * dy_bi2 - dy_ai2 * dx_bi2;
ll si3 = dx_ai * dy_ai2 - dy_ai * dx_ai2;
ll si4 = dx_bi * dy_bi2 - dy_bi * dx_bi2;
return (si * si2 < 0 && si3 * si4 < 0);
}
//---------------------------------------------------------------
// 最長増加部分列の長さ(O(NlogN))
//---------------------------------------------------------------
ll LSI(vll vec) {
ll size = vec.size();
vll lsi(size + 1); // 長さjを作った時の右端の最小値
for (ll i = 0; i <= size; i++) {
lsi[i] = LLINF;
}
lsi[0] = 0;
lsi[1] = vec[0];
for (ll i = 1; i < size; i++) {
// 初めてvec[i]の方が小さくなるところを探す
auto Iter = lower_bound(lsi.begin(), lsi.end(), vec[i]);
ll idx = Iter - lsi.begin();
if (idx > 0 && lsi[idx - 1] < vec[i]) {
lsi[idx] = vec[i];
}
}
for (ll i = size; i >= 0; i--) {
if (lsi[i] < LLINF) {
return i;
}
}
}
//---------------------------------------------------------------
// LCS(最長共通部分列) O(|S||T|)
//---------------------------------------------------------------
string LCS(string S, string T) {
vvll dp(S.length() + 1);
for (int i = 0; i < dp.size(); i++) {
vll t(T.length() + 1, 0);
dp[i] = t;
}
for (int i = 0; i < S.length(); i++) {
for (int j = 0; j < T.length(); j++) {
dp[i + 1][j + 1] = max({dp[i][j] + ll(S[i] == T[j]), dp[i + 1][j],
dp[i][j + 1], dp[i + 1][j + 1]});
}
}
ll len = dp[S.length()][T.length()];
string ans = "";
ll i = dp.size() - 1;
ll j = dp[0].size() - 1;
while (len > 0) {
if (dp[i - 1][j] == len) {
i--;
} else if (dp[i][j - 1] == len) {
j--;
} else {
ans += S[i - 1];
i--;
j--;
len--;
}
}
reverse(ans.begin(), ans.end());
return ans;
}
vll LCS(vll S, vll T) {
vvll dp(S.size() + 1);
for (int i = 0; i < dp.size(); i++) {
vll t(T.size() + 1, 0);
dp[i] = t;
}
for (int i = 0; i < S.size(); i++) {
for (int j = 0; j < T.size(); j++) {
dp[i + 1][j + 1] = max({dp[i][j] + ll(S[i] == T[j]), dp[i + 1][j],
dp[i][j + 1], dp[i + 1][j + 1]});
}
}
ll len = dp[S.size()][T.size()];
vll ans;
ll i = dp.size() - 1;
ll j = dp[0].size() - 1;
while (len > 0) {
if (dp[i - 1][j] == len) {
i--;
} else if (dp[i][j - 1] == len) {
j--;
} else {
ans.emplace_back(S[i - 1]);
i--;
j--;
len--;
}
}
reverse(ans.begin(), ans.end());
return ans;
}
//---------------------------------------------------------------
// 木の根からの深さ
//---------------------------------------------------------------
vll tree_depth(vvll edge, ll start_node) {
ll n_node = edge.size();
vll dist(n_node, LLINF);
dist[start_node] = 0;
stack<pll> S;
S.push({start_node, 0});
while (!S.empty()) {
ll node = S.top().first;
ll d = S.top().second;
dist[node] = d;
S.pop();
for (int i = 0; i < edge[node].size(); i++) {
if (dist[edge[node][i]] == LLINF) {
S.push({edge[node][i], d + 1});
}
}
}
return dist;
}
//---------------------------------------------------------------
// ワーシャルフロイド法(O(N^3)) d: 正方行列(N*N)
//---------------------------------------------------------------
vvll warshall_floyd(vvll d) {
ll n = d.size();
for (int k = 0; k < n; k++) { // 経由する頂点
for (int i = 0; i < n; i++) { // 始点
for (int j = 0; j < n; j++) { // 終点
d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
}
}
}
return d;
}
//---------------------------------------------------------------
// Union Find
//---------------------------------------------------------------
class UnionFind {
public:
/*
UnionFind uf(要素の個数);
for(int i = 0;i < 関係の個数; i++)
{
uf.merge(A[i], B[i]);
}
nを含む集合の大きさ = uf.size(n)
nを含む集合の代表者 = uf.root(n)
集合の個数 = uf.n_group
*/
vector<ll> par; // 各元の親を表す配列
vector<ll> siz; // 素集合のサイズを表す配列(1 で初期化)
ll n_group; // 集合の数
// Constructor
UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) {
for (ll i = 0; i < sz_; ++i)
par[i] = i; // 初期では親は自分自身
n_group = sz_;
}
void init(ll sz_) {
par.resize(sz_);
siz.assign(sz_, 1LL); // resize だとなぜか初期化されなかった
for (ll i = 0; i < sz_; ++i)
par[i] = i; // 初期では親は自分自身
}
// Member Function
// Find
ll root(ll x) { // 根の検索
while (par[x] != x) {
x = par[x] = par[par[x]]; // x の親の親を x の親とする
}
return x;
}
// Union(Unite, Merge)
bool merge(ll x, ll y) {
x = root(x);
y = root(y);
if (x == y)
return false;
// merge technique(データ構造をマージするテク.小を大にくっつける)
if (siz[x] < siz[y])
swap(x, y);
siz[x] += siz[y];
par[y] = x;
n_group--;
return true;
}
bool issame(ll x, ll y) { // 連結判定
return root(x) == root(y);
}
ll size(ll x) { // 素集合のサイズ
return siz[root(x)];
}
};
//---------------------------------------------------------------
// ダイクストラ(O(ElogV)) edge: 隣接リスト from->pair{to, cost}
//---------------------------------------------------------------
class Dijkstra {
public:
vll dist; // iまでの最短距離
vll past; // (iまで最短で行くときの一つ前)
// edge[i] -> {to, cost}
Dijkstra(vvpll edge, ll start)
: dist(edge.size(), LLINF), past(edge.size(), -1) {
using Pi = pll;
priority_queue<Pi, vector<Pi>, greater<Pi>> que;
dist[start] = 0;
que.emplace(dist[start], start);
while (!que.empty()) {
ll cost;
int idx;
tie(cost, idx) = que.top();
que.pop();
if (dist[idx] < cost)
continue;
for (int i = 0; i < edge[idx].size(); i++) {
ll next_cost = cost + edge[idx][i].second;
if (dist[edge[idx][i].first] <= next_cost)
continue;
dist[edge[idx][i].first] = next_cost;
past[edge[idx][i].first] = idx;
que.emplace(dist[edge[idx][i].first], edge[idx][i].first);
}
}
}
// goalまでの最短経路
vll shortest(ll goal) {
vll ret;
while (goal != -1) {
ret.emplace_back(goal);
goal = past[goal];
}
reverse(ret.begin(), ret.end());
return ret;
}
};
//---------------------------------------------------------------
// LCA: 最近共通祖先 (O())
//---------------------------------------------------------------
class Lca {
public:
vll depth; // 根0からiまでの最短距離
vvll doubling;
ll n_bit = 30;
// edge[i] -> {to, cost}
Lca(vvll edge) : doubling(50, vll(edge.size(), -1)) {
// 深さ
depth = tree_depth(edge, 0);
// ダブリングで親を辿れるようにする
// jから2^i回親を辿ったノード
doubling[0][0] = -1;
for (int i = 1; i < edge.size(); i++)
for (int j : edge[i])
if (depth[i] > depth[j]) {
doubling[0][i] = j;
break;
}
for (int i = 1; i < n_bit; i++)
for (int j = 0; j < edge.size(); j++) {
if (doubling[i - 1][j] != -1)
doubling[i][j] = doubling[i - 1][doubling[i - 1][j]];
else
doubling[i][j] = -1;
}
}
// aとbの最近共通祖先
ll get_lca(ll a, ll b) {
// depth[a] >= depth[b]にする
if (depth[a] < depth[b])
swap(a, b);
ll oa = a;
ll ob = b;
ll d = depth[a] - depth[b];
// aをdだけさかのぼる。
vbool bit = to_bitlist(d, n_bit);
for (int i = 0; i < n_bit; i++)
if (bit[i])
a = doubling[i][a];
// depth[a] == depth[b]になっている。
for (int i = n_bit - 1; i >= 0; i--) {
if (doubling[i][a] == doubling[i][b])
continue;
a = doubling[i][a];
b = doubling[i][b];
}
return a == b ? a : doubling[0][a];
}
};
//---------------------------------------------------------------
// Z-algorithm(SとS[i:]の最長接頭辞長) O(|S|)
//---------------------------------------------------------------
vll Zalgorithm(string S) {
ll n = S.size();
vll Z(n, 0);
ll start = -1;
ll last = -1;
for (ll i = 1; i < n; i++) {
if (start >= 0) {
Z[i] = min(Z[i - start], last - i);
chmax(Z[i], 0LL);
}
while (i + Z[i] < S.size() && S[Z[i]] == S[i + Z[i]])
Z[i]++;
if (last < i + Z[i]) {
last = i + Z[i];
start = i;
}
}
Z[0] = n;
return Z;
}
vll Zalgorithm(vll S) {
ll n = S.size();
vll Z(n, 0);
ll start = -1;
ll last = -1;
for (ll i = 1; i < n; i++) {
if (start >= 0) {
Z[i] = min(Z[i - start], last - i);
chmax(Z[i], 0LL);
}
while (i + Z[i] < S.size() && S[Z[i]] == S[i + Z[i]])
Z[i]++;
if (last < i + Z[i]) {
last = i + Z[i];
start = i;
}
}
Z[0] = n;
return Z;
}
//---------------------------------------------------------------
// 二部グラフ判定(O(E)) edge -> リスト
//---------------------------------------------------------------
bool is_bipartite(vvll edge) {
ll N = edge.size();
vll color(N, -1);
color[0] = 0;
queue<ll> Q;
Q.push(0);
while (!Q.empty()) {
ll now = Q.front();
Q.pop();
for (int i : edge[now]) {
if (color[i] == -1) {
color[i] = (color[now] == 0 ? 1 : 0);
Q.push(i);
} else if (color[i] == color[now]) {
return false;
}
}
}
return true;
}
//---------------------------------------------------------------
// セグメント木
//---------------------------------------------------------------
class SegmentTree {
public:
const ll SEG_LEN = 1 << 19;
vector<set<ll>> seg;
ll s;
SegmentTree(vll A) : seg(SEG_LEN * 2, set<ll>({})) {
s = A.size();
for (int i = 0; i < A.size(); i++) {
seg[i + SEG_LEN] = {A[i]};
}
for (int i = 0; i < A.size(); i++) {
ll pos = i + SEG_LEN;
while (true) {
pos /= 2;
if (pos <= 0)
break;
if (seg[pos * 2 + 1].size() < seg[pos * 2].size()) {
seg[pos] = seg[pos * 2];
for (auto itr = seg[pos * 2 + 1].begin();
itr != seg[pos * 2 + 1].end(); ++itr) {
seg[pos].insert(*itr);
}
} else {
seg[pos] = seg[pos * 2 + 1];
for (auto itr = seg[pos * 2].begin(); itr != seg[pos * 2].end();
++itr) {
seg[pos].insert(*itr);
}
}
}
}
}
ll seg_max(ll left, ll right) {
left += SEG_LEN;
right += SEG_LEN + 1;
set<ll> ret = {};
vbool used(s + 1, false);
while (left < right) {
while (left % 2 == 1) {
if (seg[left].size()) {
for (auto itr = seg[left].begin(); itr != seg[left].end(); ++itr) {
if (!used[*itr]) {
ret.insert(*itr);
used[*itr] = true;
}
}
}
left++;
}
while (right % 2 == 1) {
if (seg[right - 1].size()) {
for (auto itr = seg[right - 1].begin(); itr != seg[right - 1].end();
++itr) {
if (!used[*itr]) {
ret.insert(*itr);
used[*itr] = true;
}
}
}
right--;
}
left /= 2;
right /= 2;
}
return ret.size();
}
};
//========================================================================
//========================================================================
//========================================================================
//========================================================================
int main() {
//////==================================
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
cout << fixed << setprecision(25);
//////==================================
/*
~思いついたことはとりあえず絶対メモする!!~
*/
ll N;
cin >> N;
vll all;
vll div = divisor(N);
for (ll d : div) {
all.emplace_back(d);
}
div = divisor(N - 1);
for (ll d : div) {
all.emplace_back(d);
}
ll ans = 0;
map<ll, bool> used;
used[1] = true;
for (ll a : all) {
if (used[a])
continue;
else
used[a] = true;
ll n = N;
while (n >= a) {
if (n % a == 0) {
n /= a;
} else {
n %= a;
}
}
if (n == 1)
ans++;
}
cout << ans << endl;
} | replace | 865 | 866 | 865 | 866 | TLE | |
p02722 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define N 400050
#define int long long
#define pb push_back
#define x first
#define y second
#define all(v) v.begin(), v.end()
#define coffee prince
#define sz(a) (int)a.size()
#define ll long long
#define SIZE N
using namespace std;
ll n, ans;
set<ll> pr;
ll che(ll x) {
ll m = n;
while ((m % x) == 0) {
m /= x;
}
m %= x;
if (m == 1)
return 1;
return 0;
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin >> n;
ll val = n - 1;
for (ll i = 2; i * i <= val; i++) {
if (val % i)
continue;
pr.insert(i);
pr.insert(val / i);
}
pr.insert(n);
pr.insert(n - 1);
for (ll i = 2; i * i <= n; i++) {
if (n % i)
continue;
pr.insert(i);
ll j = n / i;
pr.insert(j);
}
for (auto ch : pr)
if (che(ch))
ans++;
cout << ans;
return 0;
}
| #include <bits/stdc++.h>
#define N 400050
#define int long long
#define pb push_back
#define x first
#define y second
#define all(v) v.begin(), v.end()
#define coffee prince
#define sz(a) (int)a.size()
#define ll long long
#define SIZE N
using namespace std;
ll n, ans;
set<ll> pr;
bool che(int x) {
if (x < 2 || x > n)
return 0;
ll m = n;
while ((m % x) == 0) {
m /= x;
}
m %= x;
if (m == 1)
return 1;
return 0;
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin >> n;
ll val = n - 1;
for (ll i = 2; i * i <= val; i++) {
if (val % i)
continue;
pr.insert(i);
pr.insert(val / i);
}
pr.insert(n);
pr.insert(n - 1);
for (ll i = 2; i * i <= n; i++) {
if (n % i)
continue;
pr.insert(i);
ll j = n / i;
pr.insert(j);
}
for (auto ch : pr)
if (che(ch))
ans++;
cout << ans;
return 0;
}
| replace | 14 | 15 | 14 | 17 | TLE | |
p02722 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
using ll = long long;
bool check(ll n, ll a) {
ll c = n;
while (c >= a) {
if (c % a == 0)
c /= a;
else
c %= a;
}
return (c == 1);
}
int main() {
ll n;
cin >> n;
vector<ll> v;
v.push_back(n);
v.push_back(n - 1);
for (ll i = 2; i * i <= n; i++) {
if (n % i == 0) {
v.push_back(i);
v.push_back(n / i);
}
}
for (ll i = 2; i * i <= n - 1; i++) {
if ((n - 1) % i == 0) {
v.push_back(i);
v.push_back((n - 1) / i);
}
}
set<int> s;
for (auto x : v) {
if (check(n, x))
s.insert(x);
}
cout << s.size() << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
using ll = long long;
bool check(ll n, ll a) {
ll c = n;
while (c >= a) {
if (c % a == 0)
c /= a;
else
c %= a;
}
return (c == 1);
}
int main() {
ll n;
cin >> n;
vector<ll> v;
v.push_back(n);
if (n != 2)
v.push_back(n - 1);
for (ll i = 2; i * i <= n; i++) {
if (n % i == 0) {
v.push_back(i);
v.push_back(n / i);
}
}
for (ll i = 2; i * i <= n - 1; i++) {
if ((n - 1) % i == 0) {
v.push_back(i);
v.push_back((n - 1) / i);
}
}
set<int> s;
for (auto x : v) {
if (check(n, x))
s.insert(x);
}
cout << s.size() << endl;
return 0;
}
| replace | 21 | 22 | 21 | 23 | TLE | |
p02722 | C++ | Runtime Error | #define ll long long
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define mp make_pair
#define fo(i, n) for (ll i = 0; i < n; i++)
// #include<bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
ll pi = acos(-1);
ll z = 998244353;
ll inf = 100000000000000000;
ll p1 = 37;
ll p2 = 53;
ll mod1 = 202976689;
ll mod2 = 203034253;
ll gcd(ll a, ll b) {
if (b > a)
return gcd(b, a);
if (b == 0)
return a;
return gcd(b, a % b);
}
ll power(ll a, ll b, ll p) {
if (b == 0)
return 1;
ll c = power(a, b / 2, p);
if (b % 2 == 0)
return ((c * c) % p);
else
return ((((c * c) % p) * a) % p);
}
ll inverse(ll a, ll n) { return power(a, n - 2, n); }
ll max(ll a, ll b) {
if (a > b)
return a;
return b;
}
ll min(ll a, ll b) {
if (a < b)
return a;
return b;
}
ll left(ll i) { return ((2 * i)); }
ll right(ll i) { return ((2 * i) + 1); }
void swap(ll &a, ll &b) {
ll c = a;
a = b;
b = c;
return;
}
// ios_base::sync_with_stdio(0);
// cin.tie(0); cout.tie(0);
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set \
tree<int, null_type, less<int>, rb_tree_tag, \
tree_order_statistics_node_update>
// ordered_set s ; s.order_of_key(val) no. of elements strictly less than val
// s.find_by_order(i) itertor to ith element (0 indexed)
void solve() {
ll n;
cin >> n;
ll m = n - 1;
vector<ll> fact_1, fact_2;
for (ll i = 1; i * i <= n; i++) {
if (n % i == 0) {
if (i != 1)
fact_1.pub(i);
if (i * i != n)
fact_1.pub(n / i);
}
}
for (ll i = 1; i * i <= m; i++) {
if (m % i == 0) {
if (i != 1)
fact_2.pub(i);
if (i * i != m && (m / i != 1))
fact_2.pub(m / i);
}
}
ll ans = fact_2.size();
fo(i, fact_1.size()) {
ll a = n;
ll f = fact_1[i];
while (a % f == 0)
a /= f;
if ((a - 1) % f == 0)
ans++;
}
cout << ans << endl;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
#ifndef ONLINE_JUDGE
freopen("inputf.txt", "r", stdin);
freopen("outputf.txt", "w", stdout);
freopen("error.txt", "w", stderr);
#endif
ll t;
// cin >> t ;
t = 1;
while (t--) {
solve();
}
cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
<< "ms\n";
return 0;
} | #define ll long long
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define mp make_pair
#define fo(i, n) for (ll i = 0; i < n; i++)
// #include<bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
ll pi = acos(-1);
ll z = 998244353;
ll inf = 100000000000000000;
ll p1 = 37;
ll p2 = 53;
ll mod1 = 202976689;
ll mod2 = 203034253;
ll gcd(ll a, ll b) {
if (b > a)
return gcd(b, a);
if (b == 0)
return a;
return gcd(b, a % b);
}
ll power(ll a, ll b, ll p) {
if (b == 0)
return 1;
ll c = power(a, b / 2, p);
if (b % 2 == 0)
return ((c * c) % p);
else
return ((((c * c) % p) * a) % p);
}
ll inverse(ll a, ll n) { return power(a, n - 2, n); }
ll max(ll a, ll b) {
if (a > b)
return a;
return b;
}
ll min(ll a, ll b) {
if (a < b)
return a;
return b;
}
ll left(ll i) { return ((2 * i)); }
ll right(ll i) { return ((2 * i) + 1); }
void swap(ll &a, ll &b) {
ll c = a;
a = b;
b = c;
return;
}
// ios_base::sync_with_stdio(0);
// cin.tie(0); cout.tie(0);
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set \
tree<int, null_type, less<int>, rb_tree_tag, \
tree_order_statistics_node_update>
// ordered_set s ; s.order_of_key(val) no. of elements strictly less than val
// s.find_by_order(i) itertor to ith element (0 indexed)
void solve() {
ll n;
cin >> n;
ll m = n - 1;
vector<ll> fact_1, fact_2;
for (ll i = 1; i * i <= n; i++) {
if (n % i == 0) {
if (i != 1)
fact_1.pub(i);
if (i * i != n)
fact_1.pub(n / i);
}
}
for (ll i = 1; i * i <= m; i++) {
if (m % i == 0) {
if (i != 1)
fact_2.pub(i);
if (i * i != m && (m / i != 1))
fact_2.pub(m / i);
}
}
ll ans = fact_2.size();
fo(i, fact_1.size()) {
ll a = n;
ll f = fact_1[i];
while (a % f == 0)
a /= f;
if ((a - 1) % f == 0)
ans++;
}
cout << ans << endl;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
/*#ifndef ONLINE_JUDGE
freopen("inputf.txt" , "r" , stdin) ;
freopen("outputf.txt" , "w" , stdout) ;
freopen("error.txt" , "w" , stderr) ;
#endif*/
ll t;
// cin >> t ;
t = 1;
while (t--) {
solve();
}
cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC
<< "ms\n";
return 0;
} | replace | 111 | 116 | 111 | 116 | 0 | |
p02722 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i <= (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
vector<ll> Yakusu(ll n) {
vector<ll> res;
for (ll i = 1; i * i <= n; ++i) {
if (n % i != 0)
continue;
res.push_back(i);
if (i * i != n)
res.push_back(n / i);
}
return res;
}
int main() {
ll n;
cin >> n;
int ans = 0;
for (ll x : Yakusu(n)) {
if (x == 1)
continue;
ll tmp = n;
while (tmp %= 0)
tmp /= x;
tmp %= x;
if (tmp == 1)
++ans;
}
ans += Yakusu(n - 1).size() - 1;
cout << ans << endl;
return 0;
} | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i <= (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
vector<ll> Yakusu(ll n) {
vector<ll> res;
for (ll i = 1; i * i <= n; ++i) {
if (n % i != 0)
continue;
res.push_back(i);
if (i * i != n)
res.push_back(n / i);
}
return res;
}
int main() {
ll n;
cin >> n;
int ans = 0;
for (ll x : Yakusu(n)) {
if (x == 1)
continue;
ll tmp = n;
while (tmp % x == 0)
tmp /= x;
tmp %= x;
if (tmp == 1)
++ans;
}
ans += Yakusu(n - 1).size() - 1;
cout << ans << endl;
return 0;
} | replace | 29 | 30 | 29 | 30 | -8 | |
p02722 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip> //double精度 setprecision
#include <iostream>
#include <map>
#include <numeric> //lcm
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = n - 1; i >= 0; --i)
#define rep1(i, n) for (int i = 1; i <= (n); ++i)
#define rrep1(i, n) for (int i = (n); i >= 1; --i)
#define REP(i, n, m) for (int i = (n); i < (m); ++i)
#define all(vec) (vec).begin(), (vec).end()
#define debug(vec) \
for (auto v : vec) \
cerr << v << " "; \
cerr << endl;
#define debug2D(vec2D) \
for (auto vec : vec2D) { \
for (auto v : vec) \
cerr << v << " "; \
cerr << endl; \
}
#define debugP(vec) \
for (auto v : vec) \
cerr << "(" << v.first << "," << v.second << ") "; \
cerr << endl;
#define debug2DP(vec2D) \
for (auto vec : vec2D) { \
for (auto v : vec) \
cerr << "(" << v.first << "," << v.second << ") "; \
cerr << endl; \
}
typedef long long ll;
constexpr ll INF = 1000000000; // 10^10
// const ll MOD = 998244353;
constexpr ll MOD = 1000000007;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
} else
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
} else
return false;
}
int main() {
ll n;
cin >> n;
vector<ll> enumDivisor;
for (ll i = 1; i * i <= n - 1; ++i) {
if ((n - 1) % i == 0) {
enumDivisor.push_back(i);
if (i * i != n - 1)
enumDivisor.push_back((n - 1) / i);
}
}
debug(enumDivisor)
ll ans = enumDivisor.size() - 1;
vector<ll> enumDivisor2;
for (ll i = 1; i * i <= n; ++i) {
if (n % i == 0) {
enumDivisor2.push_back(i);
if (i * i != n)
enumDivisor2.push_back(n / i);
}
}
debug(enumDivisor2)
for (int d : enumDivisor2) {
if (d == 1)
continue;
ll m = n;
while (m % d == 0)
m /= d;
if (m % d == 1) {
ans++;
cerr << d << " ";
}
}
cerr << endl;
cout << ans << endl;
} | #include <algorithm>
#include <bitset>
#include <cmath>
#include <iomanip> //double精度 setprecision
#include <iostream>
#include <map>
#include <numeric> //lcm
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = n - 1; i >= 0; --i)
#define rep1(i, n) for (int i = 1; i <= (n); ++i)
#define rrep1(i, n) for (int i = (n); i >= 1; --i)
#define REP(i, n, m) for (int i = (n); i < (m); ++i)
#define all(vec) (vec).begin(), (vec).end()
#define debug(vec) \
for (auto v : vec) \
cerr << v << " "; \
cerr << endl;
#define debug2D(vec2D) \
for (auto vec : vec2D) { \
for (auto v : vec) \
cerr << v << " "; \
cerr << endl; \
}
#define debugP(vec) \
for (auto v : vec) \
cerr << "(" << v.first << "," << v.second << ") "; \
cerr << endl;
#define debug2DP(vec2D) \
for (auto vec : vec2D) { \
for (auto v : vec) \
cerr << "(" << v.first << "," << v.second << ") "; \
cerr << endl; \
}
typedef long long ll;
constexpr ll INF = 1000000000; // 10^10
// const ll MOD = 998244353;
constexpr ll MOD = 1000000007;
template <class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return true;
} else
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
} else
return false;
}
int main() {
ll n;
cin >> n;
vector<ll> enumDivisor;
for (ll i = 1; i * i <= n - 1; ++i) {
if ((n - 1) % i == 0) {
enumDivisor.push_back(i);
if (i * i != n - 1)
enumDivisor.push_back((n - 1) / i);
}
}
debug(enumDivisor)
ll ans = enumDivisor.size() - 1;
vector<ll> enumDivisor2;
for (ll i = 1; i * i <= n; ++i) {
if (n % i == 0) {
enumDivisor2.push_back(i);
if (i * i != n)
enumDivisor2.push_back(n / i);
}
}
debug(enumDivisor2)
for (ll d : enumDivisor2) {
if (d == 1)
continue;
ll m = n;
while (m % d == 0)
m /= d;
if (m % d == 1) {
ans++;
cerr << d << " ";
}
}
cerr << endl;
cout << ans << endl;
} | replace | 92 | 93 | 92 | 93 | 0 | 1 5
1 6 2 3
6 2
|
p02722 | C++ | Runtime Error | #include <cmath>
#include <iostream>
using namespace std;
int main() {
long long n;
cin >> n;
if (n == 2) {
cout << "1\n";
return 1;
}
double level = sqrt(n);
long long count = 2;
long long work;
long long j;
for (long long i = 2; i <= level; i++) {
if (n % i == 0) {
work = n;
while (work >= i) {
if (work % i == 0)
work /= i;
else
work %= i;
}
if (work == 1)
count++;
if ((double)i != level) {
work = n;
j = n / i;
while (work >= j) {
if (work % j == 0)
work /= j;
else
work %= j;
}
if (work == 1)
count++;
}
}
if ((n - 1) % i == 0) {
if ((double)i == sqrt(n - 1))
count++;
else
count += 2;
}
}
cout << count << "\n";
}
| #include <cmath>
#include <iostream>
using namespace std;
int main() {
long long n;
cin >> n;
if (n == 2) {
cout << "1\n";
return 0;
}
double level = sqrt(n);
long long count = 2;
long long work;
long long j;
for (long long i = 2; i <= level; i++) {
if (n % i == 0) {
work = n;
while (work >= i) {
if (work % i == 0)
work /= i;
else
work %= i;
}
if (work == 1)
count++;
if ((double)i != level) {
work = n;
j = n / i;
while (work >= j) {
if (work % j == 0)
work /= j;
else
work %= j;
}
if (work == 1)
count++;
}
}
if ((n - 1) % i == 0) {
if ((double)i == sqrt(n - 1))
count++;
else
count += 2;
}
}
cout << count << "\n";
}
| replace | 10 | 11 | 10 | 11 | 0 | |
p02722 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef pair<int, int> pii;
typedef pair<int, pii> p;
typedef long long ll;
typedef pair<ll, ll> pll;
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
const int MAXN = 100000;
const int MAXE = 100000;
const int MAXV = 10000;
const ll INF = 2e9;
const ll MOD = 1e9 + 7;
struct edge {
int to;
int cost;
};
vector<ll> diviser(ll X) {
vector<ll> res;
for (int i = 1; i * i <= X; ++i) {
if (X % i == 0) {
res.push_back(i);
if (i != X / i)
res.push_back(X / i);
}
}
sort(res.begin(), res.end());
return res;
}
int main() {
ll N;
cin >> N;
auto res1 = diviser(N - 1);
auto res2 = diviser(N);
ll ans = (int)res1.size() - 1;
for (auto it : res2) {
if (it == 1)
continue;
ll M = N;
while (M % it == 0)
M /= it;
if (M % it == 1)
ans++;
}
cout << ans << endl;
return 0;
} | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef pair<int, int> pii;
typedef pair<int, pii> p;
typedef long long ll;
typedef pair<ll, ll> pll;
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
const int MAXN = 100000;
const int MAXE = 100000;
const int MAXV = 10000;
const ll INF = 2e9;
const ll MOD = 1e9 + 7;
struct edge {
int to;
int cost;
};
vector<ll> diviser(ll X) {
vector<ll> res;
for (ll i = 1; i * i <= X; ++i) {
if (X % i == 0) {
res.push_back(i);
if (i != X / i)
res.push_back(X / i);
}
}
sort(res.begin(), res.end());
return res;
}
int main() {
ll N;
cin >> N;
auto res1 = diviser(N - 1);
auto res2 = diviser(N);
ll ans = (int)res1.size() - 1;
for (auto it : res2) {
if (it == 1)
continue;
ll M = N;
while (M % it == 0)
M /= it;
if (M % it == 1)
ans++;
}
cout << ans << endl;
return 0;
} | replace | 30 | 31 | 30 | 31 | TLE | |
p02722 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 7;
const int M = 1e6 + 7;
const int INF = 1e9 + 7;
ll ans = 0, n;
map<ll, bool> m1;
void check(ll x) {
if (x == 0)
return;
ll m = n;
while (m % x == 0)
m = m / x;
m = m % x;
if (m == 1) {
if (!m1[x]) {
ans++;
m1[x] = 1;
}
}
}
void judge(ll x) {
for (ll i = 1; i * i <= x; i++) {
if (x % i == 0) {
check(i);
check(x / i);
}
}
}
int main() {
cin >> n;
judge(n - 1);
judge(n);
cout << ans << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 7;
const int M = 1e6 + 7;
const int INF = 1e9 + 7;
ll ans = 0, n;
map<ll, bool> m1;
void check(ll x) {
if (x == 1)
return;
ll m = n;
while (m % x == 0)
m = m / x;
m = m % x;
if (m == 1) {
if (!m1[x]) {
ans++;
m1[x] = 1;
}
}
}
void judge(ll x) {
for (ll i = 1; i * i <= x; i++) {
if (x % i == 0) {
check(i);
check(x / i);
}
}
}
int main() {
cin >> n;
judge(n - 1);
judge(n);
cout << ans << endl;
return 0;
}
| replace | 9 | 10 | 9 | 10 | TLE | |
p02722 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
vector<long long> div(long long n) {
vector<long long> a;
for (int i = 1; i * i <= n; ++i) {
if (n % i != 0)
continue;
a.push_back(i);
if (i * i != n)
a.push_back(n / i);
}
return a;
}
int main() {
long long n;
cin >> n;
long long ans = 0;
for (long long x : div(n)) {
if (x == 1)
continue;
long long k = n;
while (k % x == 0)
k /= x;
if (k % x == 1)
ans++;
}
ans += div(n - 1).size() - 1;
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
vector<long long> div(long long n) {
vector<long long> a;
for (long long i = 1; i * i <= n; ++i) {
if (n % i != 0)
continue;
a.push_back(i);
if (i * i != n)
a.push_back(n / i);
}
return a;
}
int main() {
long long n;
cin >> n;
long long ans = 0;
for (long long x : div(n)) {
if (x == 1)
continue;
long long k = n;
while (k % x == 0)
k /= x;
if (k % x == 1)
ans++;
}
ans += div(n - 1).size() - 1;
cout << ans << endl;
} | replace | 6 | 7 | 6 | 7 | TLE | |
p02722 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define lli long long int
#define fr(i, a, b) for (lli i = a; i < b; i++)
#define bfr(i, a, b) for (lli i = a; i >= b; i--)
#define fio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL), cout.tie(NULL);
#define tc \
int t; \
cin >> t; \
while (t--)
#define mod 1000000007LL
#define mod2 998244353LL
#define all(vec) vec.begin(), vec.end()
#define ld long double
#define pb push_back
#define ordered_set \
tree<lli, null_type, less<lli>, rb_tree_tag, \
tree_order_statistics_node_update>
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
fio
set<lli>
ans;
lli n;
cin >> n;
ans.insert(n);
for (lli i = 2; i <= sqrt(n); i++)
if (n % i == 0) {
lli x = n;
while (x % i == 0)
x /= i;
if (x % i == 1)
ans.insert(i);
}
n--;
ans.insert(n);
for (lli i = 2; i <= sqrt(n); i++)
if (n % i == 0) {
ans.insert(i);
ans.insert(n / i);
}
ans.erase(1);
cout << ans.size();
return 0;
} | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define lli long long int
#define fr(i, a, b) for (lli i = a; i < b; i++)
#define bfr(i, a, b) for (lli i = a; i >= b; i--)
#define fio \
ios_base::sync_with_stdio(false); \
cin.tie(NULL), cout.tie(NULL);
#define tc \
int t; \
cin >> t; \
while (t--)
#define mod 1000000007LL
#define mod2 998244353LL
#define all(vec) vec.begin(), vec.end()
#define ld long double
#define pb push_back
#define ordered_set \
tree<lli, null_type, less<lli>, rb_tree_tag, \
tree_order_statistics_node_update>
int main() {
fio
set<lli>
ans;
lli n;
cin >> n;
ans.insert(n);
for (lli i = 2; i <= sqrt(n); i++)
if (n % i == 0) {
lli x = n;
while (x % i == 0)
x /= i;
if (x % i == 1)
ans.insert(i);
}
n--;
ans.insert(n);
for (lli i = 2; i <= sqrt(n); i++)
if (n % i == 0) {
ans.insert(i);
ans.insert(n / i);
}
ans.erase(1);
cout << ans.size();
return 0;
} | delete | 26 | 31 | 26 | 26 | 0 | |
p02722 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define debug(n) cerr << #n << ':' << n << endl;
#define dline cerr << __LINE__ << endl;
using ll = long long;
template <class T, class U> using P = pair<T, U>;
template <class T> using Heap = priority_queue<T>;
template <class T> using heaP = priority_queue<T, vector<T>, greater<T>>;
template <class T, class U> using umap = unordered_map<T, U>;
template <class T> using uset = unordered_set<T>;
template <class T> bool ChangeMax(T &a, const T &b) {
if (a >= b)
return false;
a = b;
return true;
}
template <class T> bool ChangeMin(T &a, const T &b) {
if (a <= b)
return false;
a = b;
return true;
}
template <class T, size_t N, class U> void Fill(T (&a)[N], const U &v) {
fill((U *)a, (U *)(a + N), v);
}
template <class T> istream &operator>>(istream &is, vector<T> &v) {
for (auto &e : v)
is >> e;
return is;
}
int main() {
ll n;
cin >> n;
set<ll> d;
d.insert(n);
if (n > 2)
d.insert(n - 1);
for (int i = 2; i * i <= n; ++i) {
if (n % i == 0)
d.insert(i);
if ((n - 1) % i == 0) {
d.insert(i);
if ((n - 1) / i > 1)
d.insert((n - 1) / i);
}
}
int cnt = 0;
for (auto e : d) {
ll x = n;
while (x % e == 0)
x /= e;
cnt += x % e == 1;
}
cout << cnt << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define debug(n) cerr << #n << ':' << n << endl;
#define dline cerr << __LINE__ << endl;
using ll = long long;
template <class T, class U> using P = pair<T, U>;
template <class T> using Heap = priority_queue<T>;
template <class T> using heaP = priority_queue<T, vector<T>, greater<T>>;
template <class T, class U> using umap = unordered_map<T, U>;
template <class T> using uset = unordered_set<T>;
template <class T> bool ChangeMax(T &a, const T &b) {
if (a >= b)
return false;
a = b;
return true;
}
template <class T> bool ChangeMin(T &a, const T &b) {
if (a <= b)
return false;
a = b;
return true;
}
template <class T, size_t N, class U> void Fill(T (&a)[N], const U &v) {
fill((U *)a, (U *)(a + N), v);
}
template <class T> istream &operator>>(istream &is, vector<T> &v) {
for (auto &e : v)
is >> e;
return is;
}
int main() {
ll n;
cin >> n;
set<ll> d;
d.insert(n);
if (n > 2)
d.insert(n - 1);
for (ll i = 2; i * i <= n; ++i) {
if (n % i == 0)
d.insert(i);
if ((n - 1) % i == 0) {
d.insert(i);
if ((n - 1) / i > 1)
d.insert((n - 1) / i);
}
}
int cnt = 0;
for (auto e : d) {
ll x = n;
while (x % e == 0)
x /= e;
cnt += x % e == 1;
}
cout << cnt << endl;
return 0;
}
| replace | 45 | 46 | 45 | 46 | TLE | |
p02722 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int lli;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<lli> vli;
typedef vector<pii> vii;
typedef tree<int, null_type, less<int>, rb_tree_tag,
tree_order_statistics_node_update>
OrderedSet;
const int MOD = 1e9 + 7;
const double PI = acos(-1.0);
#define fastio \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define sz(a) int((a).size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define all(c) (c).begin(), (c).end()
#define tr(c, i) for (auto &i : c)
#define present(c, x) ((c).find(x) != (c).end())
#define cpresent(c, x) (find(all(c), x) != (c).end())
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repA(i, a, n) for (int i = a; i <= (n); ++i)
#define repD(i, a, n) for (int i = a; i >= (n); --i)
#define fill(a) memset(a, 0, sizeof(a))
#define error(x) cerr << #x << " = " << (x) << endl
#define errorp(p) cerr << #p << " = " << (p.first) << ", " << (p.second) << endl
template <typename T> T gcd(T a, T b) { return (b ? __gcd(a, b) : a); }
template <typename T> T lcm(T a, T b) { return (a * b) / gcd(a, b); }
int mul(int a, int b, int c) {
lli res = (lli)a * b;
return (int)(res >= c ? res % c : res);
}
template <typename T> T power(T e, T n, T m) {
T x = 1, p = e;
while (n) {
if (n & 1)
x = mul(x, p, m);
p = mul(p, p, m);
n >>= 1;
}
return x;
}
int mod_neg(int a, int b, int c) {
int res;
if (abs(a - b) < c)
res = a - b;
else
res = (a - b) % c;
return (res < 0 ? res + c : res);
}
template <typename T> T extended_euclid(T a, T b, T &x, T &y) {
T xx = 0, yy = 1;
y = 0;
x = 1;
while (b) {
T q = a / b, t = b;
b = a % b;
a = t;
t = xx;
xx = x - q * xx;
x = t;
t = yy;
yy = y - q * yy;
y = t;
}
return a;
}
template <typename T> T mod_inverse(T a, T n) {
T x, y, z = 0;
T d = extended_euclid(a, n, x, y);
return (d > 1 ? -1 : mod_neg(x, z, n));
}
template <class T> inline void smax(T &x, T y) { x = max((x), (y)); }
template <class T> inline void smin(T &x, T y) { x = min((x), (y)); }
void get_divisors(lli n, vli &v) {
lli temp = lli(ceil(sqrt(n)));
for (int i = 2; i < temp; i++) {
if (n % i == 0) {
v.pb(i);
v.pb(n / i);
}
}
if (temp * temp == n) {
v.pb(temp);
}
}
int main() {
#ifndef ONLINE_JUDGE
freopen("test", "r", stdin);
#endif
fastio;
lli N;
cin >> N;
if (N == 2) {
cout << 1 << endl;
return 0;
}
set<lli> count;
count.insert(N);
vli v;
v.pb(N - 1);
get_divisors(N - 1, v);
count.insert(all(v));
v.clear();
get_divisors(N, v);
tr(v, div) {
lli tp = N;
while (tp % div == 0) {
tp /= div;
}
if (tp % div == 1) {
count.insert(div);
}
}
cout << sz(count) << endl;
return 0;
}
| #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int lli;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<lli> vli;
typedef vector<pii> vii;
typedef tree<int, null_type, less<int>, rb_tree_tag,
tree_order_statistics_node_update>
OrderedSet;
const int MOD = 1e9 + 7;
const double PI = acos(-1.0);
#define fastio \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define sz(a) int((a).size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define all(c) (c).begin(), (c).end()
#define tr(c, i) for (auto &i : c)
#define present(c, x) ((c).find(x) != (c).end())
#define cpresent(c, x) (find(all(c), x) != (c).end())
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repA(i, a, n) for (int i = a; i <= (n); ++i)
#define repD(i, a, n) for (int i = a; i >= (n); --i)
#define fill(a) memset(a, 0, sizeof(a))
#define error(x) cerr << #x << " = " << (x) << endl
#define errorp(p) cerr << #p << " = " << (p.first) << ", " << (p.second) << endl
template <typename T> T gcd(T a, T b) { return (b ? __gcd(a, b) : a); }
template <typename T> T lcm(T a, T b) { return (a * b) / gcd(a, b); }
int mul(int a, int b, int c) {
lli res = (lli)a * b;
return (int)(res >= c ? res % c : res);
}
template <typename T> T power(T e, T n, T m) {
T x = 1, p = e;
while (n) {
if (n & 1)
x = mul(x, p, m);
p = mul(p, p, m);
n >>= 1;
}
return x;
}
int mod_neg(int a, int b, int c) {
int res;
if (abs(a - b) < c)
res = a - b;
else
res = (a - b) % c;
return (res < 0 ? res + c : res);
}
template <typename T> T extended_euclid(T a, T b, T &x, T &y) {
T xx = 0, yy = 1;
y = 0;
x = 1;
while (b) {
T q = a / b, t = b;
b = a % b;
a = t;
t = xx;
xx = x - q * xx;
x = t;
t = yy;
yy = y - q * yy;
y = t;
}
return a;
}
template <typename T> T mod_inverse(T a, T n) {
T x, y, z = 0;
T d = extended_euclid(a, n, x, y);
return (d > 1 ? -1 : mod_neg(x, z, n));
}
template <class T> inline void smax(T &x, T y) { x = max((x), (y)); }
template <class T> inline void smin(T &x, T y) { x = min((x), (y)); }
void get_divisors(lli n, vli &v) {
lli temp = lli(ceil(sqrt(n)));
for (int i = 2; i < temp; i++) {
if (n % i == 0) {
v.pb(i);
v.pb(n / i);
}
}
if (temp * temp == n) {
v.pb(temp);
}
}
int main() {
fastio;
lli N;
cin >> N;
if (N == 2) {
cout << 1 << endl;
return 0;
}
set<lli> count;
count.insert(N);
vli v;
v.pb(N - 1);
get_divisors(N - 1, v);
count.insert(all(v));
v.clear();
get_divisors(N, v);
tr(v, div) {
lli tp = N;
while (tp % div == 0) {
tp /= div;
}
if (tp % div == 1) {
count.insert(div);
}
}
cout << sz(count) << endl;
return 0;
}
| replace | 100 | 103 | 100 | 101 | 0 | |
p02722 | C++ | Runtime Error | #pragma GCC optimize("fast-math")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC diagnostic ignored "-Woverflow"
#include <bits/stdc++.h>
using namespace std;
#define to_s to_string
#define MP make_pair
#define fi first
#define se second
#define pb push_back
// #define all(x) x.begin(), x.end()
#define gen_clock(x) \
ll x = clock(); \
cout << "Clock " << #x << " created" << endl;
#define check_clock(x) \
cout << "Time spent in " << #x << ": " << clock() - x << endl; \
x = clock();
#define reset_clock(x) \
x = clock(); \
cout << "Clock " << #x << " reseted" << endl;
//__builtin_popcount(x) - int
//__builtin_popcountll(x) - long long
typedef short sh;
typedef double db;
typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<ld, ld> pld;
typedef pair<int, int> pii;
typedef pair<sh, sh> pshsh;
typedef pair<bool, int> pbi;
typedef pair<char, int> pci;
typedef pair<char, char> pchch;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<ld> vld;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<sh> vsh;
typedef vector<pii> vpii;
typedef vector<pbi> vpbi;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<pci> vpci;
typedef vector<vsh> vvsh;
typedef vector<pld> vpld;
typedef vector<bool> vbool;
typedef vector<char> vchar;
typedef vector<vpii> vvpii;
typedef vector<vchar> vvchar;
typedef vector<vbool> vvbool;
typedef vector<string> vstring;
const short INF16 = ~(1 << 15);
const int INF32 = 2e9 + 11;
const int SZ = 4e5 + 11;
const int SZ2 = int(1e6 + 11);
const int mod = 1e9 + 7;
const int mod2 = 998244353;
const int PIVO = 4e5 + 11;
const long long INF64 = 8e18;
const long long P1 = 53;
const long long P2 = 47;
const long double eps = 1e-10;
const long double PI = acosl(-1);
inline long long MOD(long long x) {
x %= mod, x += mod;
return x % mod;
}
inline long long MOD(long long x, long long m) {
x %= m, x += m;
return x % m;
}
inline long long T(int x) { return 1ll * x * (x + 1) >> 1; }
inline long long TT(int x) { return 1ll * x * (x + 1) * (x + 2) / 6; }
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
long long fpow(long long a, long long b, long long mod) {
if (!b)
return 1;
if (b == 1)
return a % mod;
if (b & 1)
return fpow(a, b ^ 1, mod) * a % mod;
ll d = fpow(a, b >> 1, mod);
return d * d % mod;
}
long long fpow(long long a, long long b) {
if (!b)
return 1;
if (b == 1)
return a;
if (b & 1)
return fpow(a, b ^ 1) * a;
ll d = fpow(a, b >> 1);
return d * d;
}
vector<long long> f(long long n) {
vector<long long> res;
for (int i = 2; 1ll * i * i <= n; i++)
if (n % i == 0) {
res.push_back(i);
if (i != n / i)
res.push_back(n / i);
}
return res;
}
signed Solve(int num_test) {
long long n;
cin >> n;
int ans = 1 + (n != 2);
for (long long k : f(n)) {
long long m = n;
while (m % k == 0)
m /= k;
ans += (m % k == 1);
}
for (long long k : f(n - 1)) {
long long m = n;
while (m % k == 0)
m /= k;
ans += (m % k == 1);
}
cout << ans << endl;
}
signed main() {
ios_base::sync_with_stdio(NULL);
cin.tie(NULL);
cout.tie(NULL);
cout << fixed << setprecision(10);
srand(time(NULL));
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// freopen("paths.in", "r", stdin);
// freopen("paths.out", "w", stdout);
int test = 1;
// cin >> test;
for (int i = 1; i <= test; i++)
Solve(i);
} | #pragma GCC optimize("fast-math")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC diagnostic ignored "-Woverflow"
#include <bits/stdc++.h>
using namespace std;
#define to_s to_string
#define MP make_pair
#define fi first
#define se second
#define pb push_back
// #define all(x) x.begin(), x.end()
#define gen_clock(x) \
ll x = clock(); \
cout << "Clock " << #x << " created" << endl;
#define check_clock(x) \
cout << "Time spent in " << #x << ": " << clock() - x << endl; \
x = clock();
#define reset_clock(x) \
x = clock(); \
cout << "Clock " << #x << " reseted" << endl;
//__builtin_popcount(x) - int
//__builtin_popcountll(x) - long long
typedef short sh;
typedef double db;
typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<ld, ld> pld;
typedef pair<int, int> pii;
typedef pair<sh, sh> pshsh;
typedef pair<bool, int> pbi;
typedef pair<char, int> pci;
typedef pair<char, char> pchch;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<ld> vld;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<sh> vsh;
typedef vector<pii> vpii;
typedef vector<pbi> vpbi;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<pci> vpci;
typedef vector<vsh> vvsh;
typedef vector<pld> vpld;
typedef vector<bool> vbool;
typedef vector<char> vchar;
typedef vector<vpii> vvpii;
typedef vector<vchar> vvchar;
typedef vector<vbool> vvbool;
typedef vector<string> vstring;
const short INF16 = ~(1 << 15);
const int INF32 = 2e9 + 11;
const int SZ = 4e5 + 11;
const int SZ2 = int(1e6 + 11);
const int mod = 1e9 + 7;
const int mod2 = 998244353;
const int PIVO = 4e5 + 11;
const long long INF64 = 8e18;
const long long P1 = 53;
const long long P2 = 47;
const long double eps = 1e-10;
const long double PI = acosl(-1);
inline long long MOD(long long x) {
x %= mod, x += mod;
return x % mod;
}
inline long long MOD(long long x, long long m) {
x %= m, x += m;
return x % m;
}
inline long long T(int x) { return 1ll * x * (x + 1) >> 1; }
inline long long TT(int x) { return 1ll * x * (x + 1) * (x + 2) / 6; }
inline long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
inline long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
long long fpow(long long a, long long b, long long mod) {
if (!b)
return 1;
if (b == 1)
return a % mod;
if (b & 1)
return fpow(a, b ^ 1, mod) * a % mod;
ll d = fpow(a, b >> 1, mod);
return d * d % mod;
}
long long fpow(long long a, long long b) {
if (!b)
return 1;
if (b == 1)
return a;
if (b & 1)
return fpow(a, b ^ 1) * a;
ll d = fpow(a, b >> 1);
return d * d;
}
vector<long long> f(long long n) {
vector<long long> res;
for (int i = 2; 1ll * i * i <= n; i++)
if (n % i == 0) {
res.push_back(i);
if (i != n / i)
res.push_back(n / i);
}
return res;
}
signed Solve(int num_test) {
long long n;
cin >> n;
int ans = 1 + (n != 2);
for (long long k : f(n)) {
long long m = n;
while (m % k == 0)
m /= k;
ans += (m % k == 1);
}
for (long long k : f(n - 1)) {
long long m = n;
while (m % k == 0)
m /= k;
ans += (m % k == 1);
}
cout << ans << endl;
return 0;
}
signed main() {
ios_base::sync_with_stdio(NULL);
cin.tie(NULL);
cout.tie(NULL);
cout << fixed << setprecision(10);
srand(time(NULL));
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// freopen("paths.in", "r", stdin);
// freopen("paths.out", "w", stdout);
int test = 1;
// cin >> test;
for (int i = 1; i <= test; i++)
Solve(i);
} | insert | 146 | 146 | 146 | 148 | -11 | |
p02722 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#pragma region Macros
using ll = long long;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
template <class T = ll> using V = vector<T>;
template <class T = ll> using VV = V<V<T>>;
#define int ll
#define IOS \
ios::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define FOR(i, l, r) for (ll i = (l); i < (r); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FOR(i, 1, n + 1)
#define RFOR(i, l, r) for (ll i = (l); i >= (r); --i)
#define RREP(i, n) RFOR(i, n - 1, 0)
#define RREPS(i, n) RFOR(i, n, 1)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define SORT(name) sort(name.begin(), name.end())
#define RSORT(name) \
SORT(name); \
reverse(all(name));
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#define DBG(fmt, ...)
#endif
inline void Yes(bool b = true) { cout << (b ? "Yes" : "No") << '\n'; }
inline void YES(bool b = true) { cout << (b ? "YES" : "NO") << '\n'; }
template <class T> inline void print(T x) { cout << x << '\n'; }
template <typename T1, typename T2> inline void chmin(T1 &a, T2 b) {
if (a > b)
a = b;
}
template <typename T1, typename T2> inline void chmax(T1 &a, T2 b) {
if (a < b)
a = b;
}
const ll LLINF = (1LL << 60);
const int INF = (1LL << 30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#pragma endregion
vector<int> GetDivisor(int n) {
vector<int> v;
for (int i = 1; i * i <= n; ++i) {
if (n % i == 0) {
v.push_back(i);
if (i != n / i) {
v.push_back(n / i);
}
}
}
sort(v.begin(), v.end());
return v;
}
int func(int n, int k) {
while (n >= k) {
if (n % k == 0) {
n /= k;
} else {
n -= k;
}
}
return n;
}
signed main() {
IOS;
int N;
cin >> N;
int ans = GetDivisor(N - 1).size() - 1;
auto res = GetDivisor(N);
for (auto val : res) {
if (val == 1) {
continue;
}
if (func(N, val) == 1) {
ans++;
}
}
print(ans);
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#pragma region Macros
using ll = long long;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
template <class T = ll> using V = vector<T>;
template <class T = ll> using VV = V<V<T>>;
#define int ll
#define IOS \
ios::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define FOR(i, l, r) for (ll i = (l); i < (r); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FOR(i, 1, n + 1)
#define RFOR(i, l, r) for (ll i = (l); i >= (r); --i)
#define RREP(i, n) RFOR(i, n - 1, 0)
#define RREPS(i, n) RFOR(i, n, 1)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define SORT(name) sort(name.begin(), name.end())
#define RSORT(name) \
SORT(name); \
reverse(all(name));
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#define DBG(fmt, ...)
#endif
inline void Yes(bool b = true) { cout << (b ? "Yes" : "No") << '\n'; }
inline void YES(bool b = true) { cout << (b ? "YES" : "NO") << '\n'; }
template <class T> inline void print(T x) { cout << x << '\n'; }
template <typename T1, typename T2> inline void chmin(T1 &a, T2 b) {
if (a > b)
a = b;
}
template <typename T1, typename T2> inline void chmax(T1 &a, T2 b) {
if (a < b)
a = b;
}
const ll LLINF = (1LL << 60);
const int INF = (1LL << 30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#pragma endregion
vector<int> GetDivisor(int n) {
vector<int> v;
for (int i = 1; i * i <= n; ++i) {
if (n % i == 0) {
v.push_back(i);
if (i != n / i) {
v.push_back(n / i);
}
}
}
sort(v.begin(), v.end());
return v;
}
int func(int n, int k) {
while (n >= k) {
if (n % k == 0) {
n /= k;
} else {
n %= k;
}
}
return n;
}
signed main() {
IOS;
int N;
cin >> N;
int ans = GetDivisor(N - 1).size() - 1;
auto res = GetDivisor(N);
for (auto val : res) {
if (val == 1) {
continue;
}
if (func(N, val) == 1) {
ans++;
}
}
print(ans);
return 0;
}
| replace | 73 | 74 | 73 | 74 | TLE | |
p02722 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <vector>
using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constexpr lint LINF = 1LL << 60;
template <class T> ostream &operator<<(ostream &os, const vector<T> &vec) {
for (const auto &e : vec)
os << e << (&e == &vec.back() ? "\n" : " ");
return os;
}
#ifdef _DEBUG
template <class T> void dump(const char *str, T &&h) {
cerr << str << " = " << h << "\n";
};
template <class Head, class... Tail>
void dump(const char *str, Head &&h, Tail &&...t) {
while (*str != ',')
cerr << *str++;
cerr << " = " << h << "\n";
dump(str + (*(str + 1) == ' ' ? 2 : 1), t...);
}
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else
#define DMP(...) ((void)0)
#endif
template <class T> vector<T> divisor(const T n) {
vector<T> res;
for (T i = 1; i * i <= n; i++) {
if (n % i == 0) {
res.emplace_back(i);
if (i * i != n)
res.emplace_back(n / i);
}
}
sort(res.begin(), res.end());
return res;
}
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
lint N;
cin >> N;
int ans = (int)divisor(N - 1).size() - 1;
auto div = divisor(N);
for (const auto &e : div) {
if (e == 1)
continue;
lint tmp = N;
while (tmp >= e) {
if (tmp % e) {
tmp -= e;
} else
tmp /= e;
}
if (tmp == 1)
ans++;
}
cout << ans << endl;
return 0;
} | #include <algorithm>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <vector>
using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constexpr lint LINF = 1LL << 60;
template <class T> ostream &operator<<(ostream &os, const vector<T> &vec) {
for (const auto &e : vec)
os << e << (&e == &vec.back() ? "\n" : " ");
return os;
}
#ifdef _DEBUG
template <class T> void dump(const char *str, T &&h) {
cerr << str << " = " << h << "\n";
};
template <class Head, class... Tail>
void dump(const char *str, Head &&h, Tail &&...t) {
while (*str != ',')
cerr << *str++;
cerr << " = " << h << "\n";
dump(str + (*(str + 1) == ' ' ? 2 : 1), t...);
}
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else
#define DMP(...) ((void)0)
#endif
template <class T> vector<T> divisor(const T n) {
vector<T> res;
for (T i = 1; i * i <= n; i++) {
if (n % i == 0) {
res.emplace_back(i);
if (i * i != n)
res.emplace_back(n / i);
}
}
sort(res.begin(), res.end());
return res;
}
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
lint N;
cin >> N;
int ans = (int)divisor(N - 1).size() - 1;
auto div = divisor(N);
for (const auto &e : div) {
if (e == 1)
continue;
lint tmp = N;
while (tmp >= e) {
if (tmp % e) {
tmp %= e;
} else
tmp /= e;
}
if (tmp == 1)
ans++;
}
cout << ans << endl;
return 0;
} | replace | 71 | 72 | 71 | 72 | TLE | |
p02722 | C++ | Time Limit Exceeded | #include <stdio.h>
#include <stdlib.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <stdint.h>
#include <string.h>
// #define _USE_MATH_DEFINES
// #include <math.h>
#include <deque>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <algorithm>
#include <bitset>
#include <chrono>
#include <functional>
#include <random>
#define sqr(x) (x) * (x)
typedef unsigned int u32;
typedef int i32;
typedef unsigned long long int u64;
typedef long long int i64;
typedef uint16_t u16;
typedef int16_t i16;
typedef uint8_t u8;
typedef int8_t i8;
using namespace std;
using namespace std::chrono;
// const i64 mod = 1000000007ll;
const i64 smod = 11; // 998244353ll;
// const i64 inf = 1000000007; // 10000000000000007ll;
const double eps = 1e-8;
const i64 MAXN = 4 * 1'000'000 + 6;
i64 T;
i64 n, k, c;
void divs(i64 v, set<i64> &q) {
for (i64 i = 2; i <= sqrt(v) + 2; i++) {
if (v % i == 0) {
q.insert(i);
q.insert(v / i);
}
}
q.insert(v);
}
int main(int argc, char *argv[]) {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cout.precision(15);
cout.setf(ios::fixed);
cin >> n;
set<i64> p1;
divs(n - 1, p1);
i64 R = p1.size();
set<i64> p;
divs(n, p);
for (auto t : p) {
i64 v = n;
while (v % t == 0) {
v /= t;
}
if (v > t) {
v -= v / t * t;
}
if (v == 1) {
R += 1;
}
}
cout << R << endl;
return 0;
} | #include <stdio.h>
#include <stdlib.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <stdint.h>
#include <string.h>
// #define _USE_MATH_DEFINES
// #include <math.h>
#include <deque>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <algorithm>
#include <bitset>
#include <chrono>
#include <functional>
#include <random>
#define sqr(x) (x) * (x)
typedef unsigned int u32;
typedef int i32;
typedef unsigned long long int u64;
typedef long long int i64;
typedef uint16_t u16;
typedef int16_t i16;
typedef uint8_t u8;
typedef int8_t i8;
using namespace std;
using namespace std::chrono;
// const i64 mod = 1000000007ll;
const i64 smod = 11; // 998244353ll;
// const i64 inf = 1000000007; // 10000000000000007ll;
const double eps = 1e-8;
const i64 MAXN = 4 * 1'000'000 + 6;
i64 T;
i64 n, k, c;
void divs(i64 v, set<i64> &q) {
for (i64 i = 2; i <= sqrt(v) + 2; i++) {
if (v % i == 0) {
q.insert(i);
q.insert(v / i);
}
}
q.insert(v);
q.erase(1);
}
int main(int argc, char *argv[]) {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cout.precision(15);
cout.setf(ios::fixed);
cin >> n;
set<i64> p1;
divs(n - 1, p1);
i64 R = p1.size();
set<i64> p;
divs(n, p);
for (auto t : p) {
i64 v = n;
while (v % t == 0) {
v /= t;
}
if (v > t) {
v -= v / t * t;
}
if (v == 1) {
R += 1;
}
}
cout << R << endl;
return 0;
} | insert | 63 | 63 | 63 | 64 | TLE | |
p02722 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
using namespace std;
int main() {
long long N;
cin >> N;
vector<long long> ANS;
for (long long i = 2; i * i <= N; i++) {
if (N % i == 0) {
ANS.push_back(i);
if (i * i != N)
ANS.push_back(N / i);
} else if ((N - 1) % i == 0) {
ANS.push_back(i);
if (i * i + 1 != N)
ANS.push_back((N - 1) / i);
}
}
ANS.push_back(N - 1);
ANS.push_back(N);
sort(ANS.begin(), ANS.end());
ANS.erase(unique(ANS.begin(), ANS.end()), ANS.end());
long long COUNT = 0;
for (int i = 0; i < ANS.size(); i++) {
long long NOW = N;
while (NOW % ANS[i] == 0)
NOW /= ANS[i];
if (NOW % ANS[i] == 1)
COUNT++;
}
cout << COUNT << endl;
} | #include "bits/stdc++.h"
using namespace std;
int main() {
long long N;
cin >> N;
vector<long long> ANS;
for (long long i = 2; i * i <= N; i++) {
if (N % i == 0) {
ANS.push_back(i);
if (i * i != N)
ANS.push_back(N / i);
} else if ((N - 1) % i == 0) {
ANS.push_back(i);
if (i * i + 1 != N)
ANS.push_back((N - 1) / i);
}
}
ANS.push_back(N - 1);
ANS.push_back(N);
sort(ANS.begin(), ANS.end());
ANS.erase(unique(ANS.begin(), ANS.end()), ANS.end());
long long COUNT = 0;
for (int i = 0; i < ANS.size(); i++) {
if (ANS[i] == 1)
continue;
long long NOW = N;
while (NOW % ANS[i] == 0)
NOW /= ANS[i];
if (NOW % ANS[i] == 1)
COUNT++;
}
cout << COUNT << endl;
} | insert | 24 | 24 | 24 | 26 | TLE | |
p02722 | C++ | Time Limit Exceeded | #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include "bits/stdc++.h"
#define int long long
#define endl '\n'
using namespace std;
typedef long long ll;
#define error(args...) \
{ \
string _s = #args; \
replace(_s.begin(), _s.end(), ',', ' '); \
stringstream _ss(_s); \
istream_iterator<string> _it(_ss); \
err(_it, args); \
}
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
cout << *it << " = " << a << endl;
err(++it, args...);
}
#define read(a) \
int a; \
cin >> a;
#define readb(a, b) \
int a, b; \
cin >> a >> b;
#define readc(a, b, c) \
int a, b, c; \
cin >> a >> b >> c;
#define readarr(a, n) \
int a[(n) + 1] = {}; \
FOR(i, 1, (n)) { cin >> a[i]; }
#define readmat(a, n, m) \
int a[n + 1][m + 1] = {}; \
FOR(i, 1, n) { FOR(j, 1, m) cin >> a[i][j]; }
#define print(a) cout << a << endl;
#define printarr(a, n) \
FOR(i, 1, n) cout << a[i] << " "; \
cout << endl;
#define printv(v) \
for (int i : v) \
cout << i << " "; \
cout << endl;
#define printmat(a, n, m) \
FOR(i, 1, n) { \
FOR(j, 1, m) cout << a[i][j] << " "; \
cout << endl; \
} \
cout << endl;
#define all(v) v.begin(), v.end()
#define sz(v) (int)(v.size())
#define pb push_back
#define fi first
#define se second
#define vi vector<int>
#define pi pair<int, int>
#define vpi vector<pi>
#define vvi vector<vi>
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
const ll inf = 1e13;
const ll mod = 1e9 + 7;
const ll N = 2e4 + 1;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
read(n);
int sqr = sqrt(n + 4);
unordered_set<int> s;
FOR(i, 2, sqr) {
if ((n - 1) % i == 0)
s.insert(i), s.insert(n / i);
}
s.insert(n - 1);
s.insert(n);
FOR(i, 2, sqr) {
if (n % i == 0) {
int t = i, icpy = i, x = inf / icpy;
while (true) {
if (t > x || (n % (t * i)))
break;
t *= i;
}
int cpy = n / t;
if (cpy % icpy == 1)
s.insert(i);
t = n / i, icpy = n / i, x = inf / icpy;
while (true) {
if (t > x || (n % (t * icpy)))
break;
t *= icpy;
}
cpy = n / t;
if (cpy % icpy == 1)
s.insert(icpy);
}
}
cout << sz(s);
}
| #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include "bits/stdc++.h"
#define int long long
#define endl '\n'
using namespace std;
typedef long long ll;
#define error(args...) \
{ \
string _s = #args; \
replace(_s.begin(), _s.end(), ',', ' '); \
stringstream _ss(_s); \
istream_iterator<string> _it(_ss); \
err(_it, args); \
}
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
cout << *it << " = " << a << endl;
err(++it, args...);
}
#define read(a) \
int a; \
cin >> a;
#define readb(a, b) \
int a, b; \
cin >> a >> b;
#define readc(a, b, c) \
int a, b, c; \
cin >> a >> b >> c;
#define readarr(a, n) \
int a[(n) + 1] = {}; \
FOR(i, 1, (n)) { cin >> a[i]; }
#define readmat(a, n, m) \
int a[n + 1][m + 1] = {}; \
FOR(i, 1, n) { FOR(j, 1, m) cin >> a[i][j]; }
#define print(a) cout << a << endl;
#define printarr(a, n) \
FOR(i, 1, n) cout << a[i] << " "; \
cout << endl;
#define printv(v) \
for (int i : v) \
cout << i << " "; \
cout << endl;
#define printmat(a, n, m) \
FOR(i, 1, n) { \
FOR(j, 1, m) cout << a[i][j] << " "; \
cout << endl; \
} \
cout << endl;
#define all(v) v.begin(), v.end()
#define sz(v) (int)(v.size())
#define pb push_back
#define fi first
#define se second
#define vi vector<int>
#define pi pair<int, int>
#define vpi vector<pi>
#define vvi vector<vi>
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
const ll inf = 1e13;
const ll mod = 1e9 + 7;
const ll N = 2e4 + 1;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
read(n);
if (n == 2) {
cout << 1;
return 0;
}
int sqr = sqrt(n);
set<int> s;
FOR(i, 2, sqr) {
if ((n - 1) % i == 0)
s.insert(i), s.insert(n / i);
}
s.insert(n - 1);
s.insert(n);
FOR(i, 2, sqr) {
if (n % i == 0) {
int t = i, icpy = i, x = inf / icpy;
while (true) {
if (t > x || (n % (t * i)))
break;
t *= i;
}
int cpy = n / t;
if (cpy % icpy == 1)
s.insert(i);
t = n / i, icpy = n / i, x = inf / icpy;
while (true) {
if (t > x || (n % (t * icpy)))
break;
t *= icpy;
}
cpy = n / t;
if (cpy % icpy == 1)
s.insert(icpy);
}
}
cout << sz(s);
}
| replace | 76 | 78 | 76 | 82 | TLE | |
p02722 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define all(a) (a).begin(), (a).end()
using ll = long long;
using pii = pair<int, int>;
bool check(ll n, ll x) {
while (n % x == 0)
n /= x;
return (n % x == 1);
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll n;
cin >> n;
set<ll> ans;
ll t = n - 1;
ans.insert(n - 1);
for (ll i = 2; i * i <= t; ++i) {
if (t % i == 0) {
ans.insert(i);
ans.insert(t / i);
}
}
ans.insert(n);
for (ll i = 2; i * i <= n; ++i) {
if (n % i == 0) {
if (check(n, i))
ans.insert(i);
if (check(n, n / i))
ans.insert(n / i);
}
}
assert(!ans.count(1));
cout << ans.size() << '\n';
} | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define all(a) (a).begin(), (a).end()
using ll = long long;
using pii = pair<int, int>;
bool check(ll n, ll x) {
while (n % x == 0)
n /= x;
return (n % x == 1);
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll n;
cin >> n;
if (n == 2) {
cout << 1;
return 0;
}
set<ll> ans;
ll t = n - 1;
ans.insert(n - 1);
for (ll i = 2; i * i <= t; ++i) {
if (t % i == 0) {
ans.insert(i);
ans.insert(t / i);
}
}
ans.insert(n);
for (ll i = 2; i * i <= n; ++i) {
if (n % i == 0) {
if (check(n, i))
ans.insert(i);
if (check(n, n / i))
ans.insert(n / i);
}
}
assert(!ans.count(1));
cout << ans.size() << '\n';
} | insert | 20 | 20 | 20 | 24 | 0 | |
p02722 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define DEBUG_ //!!提出時にコメントアウト!!
#ifdef DEBUG_
#define dump(x) cerr << #x << " = " << (x) << endl;
#else
#define dump(x) ;
#endif
#define equals(a, b) (fabs((a) - (b)) < EPS)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define SZ(x) ((int)(x).size())
#define pb push_back
#define eb emplace_back
// #define int long long
typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return 1;
}
return 0;
}
template <typename T> std::string printVector(const std::vector<T> &data) {
std::stringstream ss;
std::ostream_iterator<T> out_it(ss, ", ");
ss << "[";
std::copy(data.begin(), data.end() - 1, out_it);
ss << data.back() << "]";
return ss.str();
}
template <typename T> void print_array(const T &ary, int size) {
REP(i, size) { cout << ary[i] << " "; }
cout << endl;
}
const int MOD = 1e9 + 7;
const LL LINF = 1001002003004005006ll;
const int INF = 1001001001;
const double EPS = (1e-10);
LL N;
bool valid(LL x) {
LL A = N;
while (A >= x) {
if (A % x == 0) {
A /= x;
} else {
A %= x;
}
}
if (A == 1)
return true;
else
return false;
}
signed main(int argc, char const *argv[]) {
cin.tie(0);
ios::sync_with_stdio(false);
cout << setprecision(12);
cin >> N;
set<LL> cand;
for (LL i = 2; i * i <= N - 1; i++) {
if ((N - 1) % i == 0) {
cand.insert(i);
cand.insert((N - 1) / i);
}
}
for (LL i = 2; i * i <= N; i++) {
if ((N) % i == 0) {
cand.insert(i);
cand.insert((N) / i);
}
}
cand.insert(N);
cand.insert(N - 1);
LL ans = 0;
for (LL i : cand) {
if (valid(i)) {
ans++;
}
}
cout << ans << endl;
}
| #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
#define DEBUG_ //!!提出時にコメントアウト!!
#ifdef DEBUG_
#define dump(x) cerr << #x << " = " << (x) << endl;
#else
#define dump(x) ;
#endif
#define equals(a, b) (fabs((a) - (b)) < EPS)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define SZ(x) ((int)(x).size())
#define pb push_back
#define eb emplace_back
// #define int long long
typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
template <class T> bool chmax(T &a, const T &b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template <class T> bool chmin(T &a, const T &b) {
if (b < a) {
a = b;
return 1;
}
return 0;
}
template <typename T> std::string printVector(const std::vector<T> &data) {
std::stringstream ss;
std::ostream_iterator<T> out_it(ss, ", ");
ss << "[";
std::copy(data.begin(), data.end() - 1, out_it);
ss << data.back() << "]";
return ss.str();
}
template <typename T> void print_array(const T &ary, int size) {
REP(i, size) { cout << ary[i] << " "; }
cout << endl;
}
const int MOD = 1e9 + 7;
const LL LINF = 1001002003004005006ll;
const int INF = 1001001001;
const double EPS = (1e-10);
LL N;
bool valid(LL x) {
LL A = N;
while (A >= x) {
if (A % x == 0) {
A /= x;
} else {
A %= x;
}
}
if (A == 1)
return true;
else
return false;
}
signed main(int argc, char const *argv[]) {
cin.tie(0);
ios::sync_with_stdio(false);
cout << setprecision(12);
cin >> N;
set<LL> cand;
for (LL i = 2; i * i <= N - 1; i++) {
if ((N - 1) % i == 0) {
cand.insert(i);
cand.insert((N - 1) / i);
}
}
for (LL i = 2; i * i <= N; i++) {
if ((N) % i == 0) {
cand.insert(i);
cand.insert((N) / i);
}
}
cand.insert(N);
if (N != 2)
cand.insert(N - 1);
LL ans = 0;
for (LL i : cand) {
if (valid(i)) {
ans++;
}
}
cout << ans << endl;
}
| replace | 115 | 116 | 115 | 117 | TLE | |
p02723 | C++ | Runtime Error | #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(3) == s.at(4) && s.at(5) == s.at(6)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
} | #include <iostream>
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(2) == s.at(3) && s.at(4) == s.at(5)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| replace | 6 | 7 | 6 | 7 | 0 | |
p02723 | C++ | Runtime Error | /*
In the name of ALLAH
Author : Raashid Anwar
*/
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
const int M = 1000000007;
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
#endif
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes\n";
else
cout << "No\n";
} | /*
In the name of ALLAH
Author : Raashid Anwar
*/
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
const int M = 1000000007;
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
// #ifndef ONLINE_JUDGE
// freopen("input.txt","r",stdin);
// #endif
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes\n";
else
cout << "No\n";
} | replace | 14 | 17 | 14 | 17 | 0 | |
p02723 | C++ | Runtime Error | #include "stdio.h"
#include <iostream>
#include <string.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s.length() < 6)
cout << "No";
else if (s[2] == s[3] && s[4] == s[5]) {
cout << "Yes";
} else
cout << "No";
return 1;
} | #include "stdio.h"
#include <iostream>
#include <string.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s.length() < 6)
cout << "No";
else if (s[2] == s[3] && s[4] == s[5]) {
cout << "Yes";
} else
cout << "No";
return 0;
} | replace | 14 | 15 | 14 | 15 | 1 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
if (s.at(2) == s.at(3) && s.at(4) == s.at(5)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(2) == s.at(3) && s.at(4) == s.at(5)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | insert | 4 | 4 | 4 | 5 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 2) >= this->size() (which is 0)
|
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(3) == S.at(4) && S.at(5) == S.at(6)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(2) == S.at(3) && S.at(4) == S.at(5)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| replace | 6 | 7 | 6 | 7 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
ios::sync_with_stdio(0);
cin.tie(0);
// Write from here.
char s[6];
cin >> s;
if (s[2] == s[3] && s[4] == s[5]) {
cout << "Yes\n";
} else {
cout << "No\n";
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
char s[6];
cin >> s;
if (s[2] == s[3] && s[4] == s[5]) {
cout << "Yes\n";
} else {
cout << "No\n";
}
return 0;
} | delete | 4 | 11 | 4 | 4 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long
#define MOD 1000000007
#define MAX 100005
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define mii map<int, int>
#define vi vector<int>
#define ff first
#define ss second
#define T \
int t; \
cin >> t; \
while (t--)
#define loop(i, a, b) for (int i = a; i < b; i++)
#define umi unordered_map<int, int>
#define maxheap priority_queue<int>
#define minheap priority_queue<int, vector<int>, greater<int>>
#define inp(n) for (int i = 0; i < n; i++)
#define N 200005
#define mxN 2000005
#define all(v) v.begin(), v.end()
#define lb(v, val) (int)(lower_bound(v.begin(), v.end(), val) - v.begin())
#define ub(v, val) (int)(upper_bound(v.begin(), v.end(), val) - v.begin())
using namespace std;
using namespace std::chrono;
int v[N];
void solve() {
string s;
cin >> s;
if (s.length() < 6) {
cout << "Yes";
} else {
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes";
else
cout << "No";
}
}
signed main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t = 1, tt = 0;
// cin >> t;
while (t--) {
tt++;
// cout << "Case #" <<tt<<": ";
solve();
cout << "\n";
}
}
| #include <bits/stdc++.h>
#define int long long
#define MOD 1000000007
#define MAX 100005
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define mii map<int, int>
#define vi vector<int>
#define ff first
#define ss second
#define T \
int t; \
cin >> t; \
while (t--)
#define loop(i, a, b) for (int i = a; i < b; i++)
#define umi unordered_map<int, int>
#define maxheap priority_queue<int>
#define minheap priority_queue<int, vector<int>, greater<int>>
#define inp(n) for (int i = 0; i < n; i++)
#define N 200005
#define mxN 2000005
#define all(v) v.begin(), v.end()
#define lb(v, val) (int)(lower_bound(v.begin(), v.end(), val) - v.begin())
#define ub(v, val) (int)(upper_bound(v.begin(), v.end(), val) - v.begin())
using namespace std;
using namespace std::chrono;
int v[N];
void solve() {
string s;
cin >> s;
if (s.length() < 6) {
cout << "Yes";
} else {
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes";
else
cout << "No";
}
}
signed main() {
/*#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif */
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t = 1, tt = 0;
// cin >> t;
while (t--) {
tt++;
// cout << "Case #" <<tt<<": ";
solve();
cout << "\n";
}
}
| replace | 44 | 48 | 44 | 48 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(3) == s.at(4) && s.at(5) == s.at(6))
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(2) == s.at(3) && s.at(4) == s.at(5))
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| replace | 5 | 6 | 5 | 6 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(3) == S.at(4) && S.at(5) == S.at(6)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(2) == S.at(3) && S.at(5) == S.at(4)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| replace | 6 | 7 | 6 | 7 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define endl "\n"
#define loop(i, s, e) for (int i = s; i < e; i++)
#define int long long
#define mp make_pair
#define pii pair<int, int>
#define mset(a, f) memset(a, f, sizeof(a))
#define pb push_back
const int N = 2e6 + 6;
const int M = 1e9 + 7;
int A[N];
int n;
void solve() {
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5]) {
cout << "Yes";
} else
cout << "No";
}
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int t = 1;
// cin >> t;
while (t--)
solve();
}
| #include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define endl "\n"
#define loop(i, s, e) for (int i = s; i < e; i++)
#define int long long
#define mp make_pair
#define pii pair<int, int>
#define mset(a, f) memset(a, f, sizeof(a))
#define pb push_back
const int N = 2e6 + 6;
const int M = 1e9 + 7;
int A[N];
int n;
void solve() {
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5]) {
cout << "Yes";
} else
cout << "No";
}
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int t = 1;
// cin >> t;
while (t--)
solve();
}
| delete | 33 | 38 | 33 | 33 | 0 | |
p02723 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <ctime>
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int ti = clock();
// start-----------------------------------------------
ll x, y, a, b, c;
cin >> x >> y >> a >> b >> c;
vector<ll> p(a), q(b), r(c);
vector<pair<ll, int>> all;
for (int i = 0; i < a; i++)
cin >> p[i], all.push_back({p[i], 0});
for (int i = 0; i < b; i++)
cin >> q[i], all.push_back({q[i], 1});
for (int i = 0; i < c; i++)
cin >> r[i], all.push_back({r[i], 2});
sort(all.begin(), all.end(), greater<pair<ll, int>>());
int ux = 0, uy = 0, uz = 0;
int ans = 0;
for (int i = 0; i < all.size(); i++) {
int nowf = all[i].first;
int nows = all[i].second;
if (nows == 0 && ux < x) {
ux++;
ans += nowf;
} else if (nows == 1 && uy < y) {
uy++;
ans += nowf;
} else if (nows == 2) {
uz++;
ans += nowf;
}
if (ux + uy + uz == x + y)
break;
}
cout << ans << endl;
// end-----------------------------------------------
// cerr << 1.0 * (clock() - ti) / CLOCKS_PER_SEC << endl;
}
| #include <algorithm>
#include <cmath>
#include <ctime>
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int ti = clock();
// start-----------------------------------------------
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes" << endl;
else
cout << "No" << endl;
// end-----------------------------------------------
// cerr << 1.0 * (clock() - ti) / CLOCKS_PER_SEC << endl;
}
| replace | 14 | 45 | 14 | 20 | -6 | terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
|
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(3) == S.at(4) && S.at(5) == S.at(6)) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(2) == S.at(3) && S.at(4) == S.at(5)) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
}
| replace | 7 | 8 | 7 | 8 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(3) == S.at(4) && S.at(5) == S.at(6)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(2) == S.at(3) && S.at(4) == S.at(5)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | replace | 6 | 7 | 6 | 7 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string R;
cin >> R;
if (R.at(3) == R.at(4) && R.at(5) == R.at(6))
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string R;
cin >> R;
if (R.at(2) == R.at(3) && R.at(4) == R.at(5))
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| replace | 5 | 6 | 5 | 6 | 0 | |
p02723 | C++ | Runtime Error | /**
* abc 160 a
* Kartikeya (doomsday861)
**/
#include <bits/stdc++.h>
#include <time.h>
#define ll long long
#define testcase \
ll t; \
cin >> t; \
while (t--)
#define timeb auto start = high_resolution_clock::now();
#define timee \
auto stop = high_resolution_clock::now(); \
auto duration = duration_cast<seconds>(stop - start); \
cout << "Time taken by function: " << duration.count() << "seconds" << endl;
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
freopen("output.ans", "w", stdout);
#endif
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
using namespace std::chrono;
// timeb
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes" << endl;
else
cout << "No" << endl;
// timee
return 0;
} | /**
* abc 160 a
* Kartikeya (doomsday861)
**/
#include <bits/stdc++.h>
#include <time.h>
#define ll long long
#define testcase \
ll t; \
cin >> t; \
while (t--)
#define timeb auto start = high_resolution_clock::now();
#define timee \
auto stop = high_resolution_clock::now(); \
auto duration = duration_cast<seconds>(stop - start); \
cout << "Time taken by function: " << duration.count() << "seconds" << endl;
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
using namespace std::chrono;
// timeb
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes" << endl;
else
cout << "No" << endl;
// timee
return 0;
} | replace | 18 | 22 | 18 | 19 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string a;
cin >> a;
if (a.at(3) == a.at(4) || a.at(5) == a.at(6)) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string a;
cin >> a;
if (a.at(2) == a.at(3) && a.at(4) == a.at(5)) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
}
| replace | 8 | 9 | 8 | 9 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 6) >= this->size() (which is 6)
|
p02723 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <chrono>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
int main() {
char x[5];
int f = 0;
int e = 0;
for (int i = 0; i < 6; i++)
cin >> x[i];
// for(int i = 0; i < 6; i++) cout << x[i] << endl;
if (x[3] == x[2] and x[5] == x[4])
cout << "Yes" << endl;
else
cout << "No" << endl;
} | #include <algorithm>
#include <bitset>
#include <chrono>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
int main() {
char x[6];
for (int i = 0; i < 6; i++)
cin >> x[i];
// for(int i = 0; i < 6; i++) cout << x[i] << endl;
if (x[3] == x[2] and x[5] == x[4])
cout << "Yes" << endl;
else
cout << "No" << endl;
}
| replace | 11 | 14 | 11 | 12 | -6 | *** stack smashing detected ***: terminated
|
p02723 | C++ | Runtime Error |
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0);
ios_base::sync_with_stdio(0);
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
#endif // ONLINE_JUDGE
string s;
cin >> s;
bool coffe = s.size() >= 5 && (s[2] == s[3]) && (s[4] == s[5]);
cout << (coffe ? "Yes\n" : "No");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(0);
ios_base::sync_with_stdio(0);
#ifndef ONLINE_JUDGE
// freopen("in.txt", "r", stdin);
// freopen("out.txt", "w", stdout);
#endif // ONLINE_JUDGE
string s;
cin >> s;
bool coffe = s.size() >= 5 && (s[2] == s[3]) && (s[4] == s[5]);
cout << (coffe ? "Yes\n" : "No");
return 0;
}
| replace | 10 | 12 | 10 | 12 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
if (str.at(2) == str.at(3) && str.at(4) == str.at(5)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string str;
cin >> str;
if (str.at(2) == str.at(3) && str.at(4) == str.at(5)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| insert | 5 | 5 | 5 | 6 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 2) >= this->size() (which is 0)
|
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef long double ld;
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
ios_base::sync_with_stdio(false);
cin.tie(0);
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes\n";
else
cout << "No\n";
return 0;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef long double ld;
int main() {
// #ifndef ONLINE_JUDGE
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// #endif
ios_base::sync_with_stdio(false);
cin.tie(0);
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes\n";
else
cout << "No\n";
return 0;
} | replace | 10 | 14 | 10 | 14 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define sz(x) ((int)(x).size())
#define F first
#define S second
int main() {
#ifndef ONLINE_JUDGE
// for getting input from input.txt
freopen("input1.txt", "r", stdin);
// for writing output to output.txt
freopen("output1.txt", "w", stdout);
#endif
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
string s;
cin >> s;
if (s.length() == 6 and s[2] == s[3] and s[4] == s[5])
cout << "Yes\n";
else
cout << "No\n";
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define sz(x) ((int)(x).size())
#define F first
#define S second
int main() {
// #ifndef ONLINE_JUDGE
// for getting input from input.txt
// freopen("input1.txt", "r", stdin);
// for writing output to output.txt
// freopen("output1.txt", "w", stdout);
// #endif
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
string s;
cin >> s;
if (s.length() == 6 and s[2] == s[3] and s[4] == s[5])
cout << "Yes\n";
else
cout << "No\n";
return 0;
}
| replace | 11 | 17 | 11 | 17 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(3) == S.at(4) && S.at(5) == S.at(6)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(2) == S.at(3) && S.at(4) == S.at(5)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | replace | 8 | 9 | 8 | 9 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
if (s.at(2) == s.at(3) && s.at(4) == s.at(5)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(2) == s.at(3) && s.at(4) == s.at(5)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| insert | 5 | 5 | 5 | 6 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 2) >= this->size() (which is 0)
|
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
int YesFlag = 0;
if (S.at(2) == S.at(3)) {
YesFlag++;
}
if (S.at(4) == S.at(5)) {
YesFlag++;
}
if (YesFlag == 2) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int YesFlag = 0;
if (S.at(2) == S.at(3)) {
YesFlag++;
}
if (S.at(4) == S.at(5)) {
YesFlag++;
}
if (YesFlag == 2) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| insert | 5 | 5 | 5 | 6 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 2) >= this->size() (which is 0)
|
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
string s;
cin >> s;
assert((int)s.size() == 6);
if (s[2] == s[3] and s[4] == s[5]) {
cout << "Yes";
} else
cout << "No";
} | #include <bits/stdc++.h>
using namespace std;
int main() {
// #ifndef ONLINE_JUDGE
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// #endif
string s;
cin >> s;
assert((int)s.size() == 6);
if (s[2] == s[3] and s[4] == s[5]) {
cout << "Yes";
} else
cout << "No";
} | replace | 5 | 9 | 5 | 9 | -6 | c835c8d0-a374-4592-ad34-ae42138ae6a4.out: /home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02723/C++/s087558683.cpp:14: int main(): Assertion `(int)s.size()==6' failed.
|
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
string a;
if (a.at(2) == a.at(3) && a.at(4) == a.at(5)) {
cout << "Yes" << endl;
return 0;
}
cout << "No" << endl;
}
| #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
string a;
cin >> a;
if (a.at(2) == a.at(3) && a.at(4) == a.at(5)) {
cout << "Yes" << endl;
return 0;
}
cout << "No" << endl;
}
| insert | 5 | 5 | 5 | 6 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 2) >= this->size() (which is 0)
|
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string ch;
cin >> ch;
bool ans = false;
if (ch.at(3) == ch.at(4) && ch.at(5) == ch.at(6)) {
ans == true;
}
if (ans) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string ch;
cin >> ch;
if (ch.at(2) == ch.at(3) && ch.at(4) == ch.at(5)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| replace | 6 | 11 | 6 | 7 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
// 文字列
string str;
cin >> str;
if (str.at(3) == str.at(4) && str.at(5) == str.at(6)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
// 文字列
string str;
cin >> str;
if (str.at(2) == str.at(3) && str.at(4) == str.at(5)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| replace | 9 | 10 | 9 | 10 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
getline(cin, s);
if ((s.at(3) == s.at(4)) && (s.at(5) == s.at(6)))
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
getline(cin, s);
if ((s.at(2) == s.at(3)) && (s.at(4) == s.at(5)))
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| replace | 5 | 6 | 5 | 6 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string mozi;
for (int i = 0; i < 6; i++) {
cin >> mozi.at(i);
}
if (mozi.at(2) == mozi.at(3) && mozi.at(4) == mozi.at(5)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string mozi;
cin >> mozi;
if (mozi.at(2) == mozi.at(3) && mozi.at(4) == mozi.at(5)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | replace | 5 | 8 | 5 | 6 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 0) >= this->size() (which is 0)
|
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<string> S(6);
if (S.at(3) == S.at(4) && S.at(5) == S.at(6)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(2) == S.at(3) && S.at(4) == S.at(5)) {
cout << "Yes";
}
else {
cout << "No";
}
} | replace | 5 | 10 | 5 | 14 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check: __n (which is 6) >= this->size() (which is 6)
|
p02723 | C++ | Runtime Error | /******************************************
/@Author: LeafBelief
/@Date: 2020-04-04
/@Remark:
/@FileName: coffeestring
******************************************/
#include <bits/stdc++.h>
#define CSE(x, y) memset(x, y, sizeof(x))
#define lowbit(x) (x & (-x))
#define INF 0x3f3f3f3f
#define FAST \
ios::sync_with_stdio(false); \
cin.tie(0);
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int maxn = 111;
char str[maxn];
int main() {
#ifndef ONLINE_JUDGE
freopen("in.in", "r", stdin);
#endif
FAST;
while (cin >> str) {
if (str[2] == str[3] && str[4] == str[5]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
return 0;
} | /******************************************
/@Author: LeafBelief
/@Date: 2020-04-04
/@Remark:
/@FileName: coffeestring
******************************************/
#include <bits/stdc++.h>
#define CSE(x, y) memset(x, y, sizeof(x))
#define lowbit(x) (x & (-x))
#define INF 0x3f3f3f3f
#define FAST \
ios::sync_with_stdio(false); \
cin.tie(0);
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int maxn = 111;
char str[maxn];
int main() {
FAST;
while (cin >> str) {
if (str[2] == str[3] && str[4] == str[5]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
return 0;
} | delete | 23 | 26 | 23 | 23 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
S.size() == 6;
cin >> S;
if (S.at(3) == S.at(4) && S.at(5) == S.at(6)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
S.size() == 6;
cin >> S;
if (S.at(2) == S.at(3) && S.at(4) == S.at(5)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| replace | 6 | 7 | 6 | 7 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(NULL)
typedef long long ll;
typedef double dd;
#define pb push_back
#define mp make_pair
#define endl "\n"
#define M 1000000007
#define pi acos(-1)
/*ll power(ll a,ll b)
{
ll res = 1;
while(b > 0)
{
if(b & 1)
res = (res*a)%M;
a = (a*a)%M;
b = b >> 1;
}
return res;
}*/
/*ll modinv(ll a)
{
return power(a,M - 2);
}*/
/*vector<ll> primes(ll n)
{
bool *sieve = new bool[n + 1];
ll i,j;
vector<ll> v;
for(i = 3; i <= n; i+=2)
sieve[i] = true;
sieve[2] = true;
for(i = 3; i*i <= n; i+=2)
{
if(sieve[i])
for(j = i*i; j <= n; j+=i)
sieve[j] = false;
}
if(n >= 2)
{
v.pb(2);
for(i = 3; i <= n; i+=2)
{
if(sieve[i])
v.pb(i);
}
}
return v;
}*/
/*class graph{
public:
vector<ll> *g;
ll n;
graph(ll v)
{
n = v + 1;
g = new vector<ll> [n];
}
void addegde(ll f,ll s)
{
g[f].pb(s);
g[s].pb(f);
}
void dfs(bool *visited,ll sv)
{
visited[sv] = true;
for(auto x: g[sv])
{
if(!visited[x])
{
dfs(visited,x);
}
}
}
void bfs(ll sv){
queue<ll> q;
bool visited[n] = {};
q.push(sv);
visited[sv] = true;
while(!q.empty())
{
ll node = q.front();
q.pop();
for(auto x : g[node])
{
if(!visited[x])
{
visited[x] = true;
q.push(x);
}
}
}
}
};*/
int main() {
fast;
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
ll i, j, t;
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(NULL)
typedef long long ll;
typedef double dd;
#define pb push_back
#define mp make_pair
#define endl "\n"
#define M 1000000007
#define pi acos(-1)
/*ll power(ll a,ll b)
{
ll res = 1;
while(b > 0)
{
if(b & 1)
res = (res*a)%M;
a = (a*a)%M;
b = b >> 1;
}
return res;
}*/
/*ll modinv(ll a)
{
return power(a,M - 2);
}*/
/*vector<ll> primes(ll n)
{
bool *sieve = new bool[n + 1];
ll i,j;
vector<ll> v;
for(i = 3; i <= n; i+=2)
sieve[i] = true;
sieve[2] = true;
for(i = 3; i*i <= n; i+=2)
{
if(sieve[i])
for(j = i*i; j <= n; j+=i)
sieve[j] = false;
}
if(n >= 2)
{
v.pb(2);
for(i = 3; i <= n; i+=2)
{
if(sieve[i])
v.pb(i);
}
}
return v;
}*/
/*class graph{
public:
vector<ll> *g;
ll n;
graph(ll v)
{
n = v + 1;
g = new vector<ll> [n];
}
void addegde(ll f,ll s)
{
g[f].pb(s);
g[s].pb(f);
}
void dfs(bool *visited,ll sv)
{
visited[sv] = true;
for(auto x: g[sv])
{
if(!visited[x])
{
dfs(visited,x);
}
}
}
void bfs(ll sv){
queue<ll> q;
bool visited[n] = {};
q.push(sv);
visited[sv] = true;
while(!q.empty())
{
ll node = q.front();
q.pop();
for(auto x : g[node])
{
if(!visited[x])
{
visited[x] = true;
q.push(x);
}
}
}
}
};*/
int main() {
ll i, j, t;
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
}
| delete | 100 | 105 | 100 | 100 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define REP(i, a, b) for (int i = (int)(a); (i) < (int)(b); i++)
typedef unsigned long long ull;
typedef long long ll;
const int INF = 1001001001;
int main() {
string s;
cin >> s;
string ans = (s[2] == s[3] && s[4] == s[5]) ? "Yes" : "No";
cout << ans << endl;
return 1;
} | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define REP(i, a, b) for (int i = (int)(a); (i) < (int)(b); i++)
typedef unsigned long long ull;
typedef long long ll;
const int INF = 1001001001;
int main() {
string s;
cin >> s;
string ans = (s[2] == s[3] && s[4] == s[5]) ? "Yes" : "No";
cout << ans << endl;
} | delete | 17 | 18 | 17 | 17 | 1 | |
p02723 | C++ | Runtime Error | // Deep Godhani
// DAIICT
#include <bits/stdc++.h>
using namespace std;
#define N 100000000000
#define PI acos(-1)
#define INF LONG_LONG_MAX
#define NINF LONG_LONG_MIN
#define ll long long int
#define ld long double
#define precision(x, d) cout << fixed << setprecision(d) << x
#define FAST \
ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); \
srand(time(NULL))
#include <bits/stdc++.h>
using namespace std;
const ll M = 1e9 + 7;
void solve() {
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
FAST;
ll t = 1;
// cin >> t;
while (t--) {
solve();
}
return 0;
}
| // Deep Godhani
// DAIICT
#include <bits/stdc++.h>
using namespace std;
#define N 100000000000
#define PI acos(-1)
#define INF LONG_LONG_MAX
#define NINF LONG_LONG_MIN
#define ll long long int
#define ld long double
#define precision(x, d) cout << fixed << setprecision(d) << x
#define FAST \
ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); \
srand(time(NULL))
#include <bits/stdc++.h>
using namespace std;
const ll M = 1e9 + 7;
void solve() {
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
int main() {
/*
#ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
#endif
*/
FAST;
ll t = 1;
// cin >> t;
while (t--) {
solve();
}
return 0;
}
| replace | 33 | 37 | 33 | 39 | 0 | |
p02723 | C++ | Runtime Error | #include <cstdio>
#include <iostream>
using namespace std;
int main() {
char c[6];
scanf("%c%c%c%c%c%c", &c[0], &c[1], &c[2], &c[3], &c[4], c[5]);
if (c[4] == c[5] && c[2] == c[3])
printf("Yes");
else
printf("No");
return 0;
} | #include <cstdio>
#include <iostream>
using namespace std;
int main() {
char c[6];
scanf("%c%c%c%c%c%c", &c[0], &c[1], &c[2], &c[3], &c[4], &c[5]);
if (c[4] == c[5] && c[2] == c[3])
printf("Yes");
else
printf("No");
return 0;
} | replace | 5 | 6 | 5 | 6 | 0 | |
p02723 | C++ | Runtime Error | /*
Author - Bohot harami
Motive - Candidate Master banunga ek din
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Policy_based_Data_Structure
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
/*#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;*/
#define ll long long int
#define ld long double
#define bigint int64_t
#define vll vector<ll>
#define vpll vector<pair<ll, ll>>
#define mp make_pair
#define pb push_back
#define MOD 1000000007
#define flash \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define test \
ll t; \
read(t); \
while (t--)
#define all(v) v.begin(), v.end()
#define pll pair<ll, ll>
#define INF (ll)(1e15)
#define vvll vector<vector<ll>>
#define R_0 return 0
#define db1(x) cout << #x << "=" << x << '\n'
#define db2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << '\n'
#define db3(x, y, z) \
cout << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z \
<< '\n'
#define forn(i, n) for (ll(i) = 0; (i) < (n); ++(i))
#define for1(i, n) for (ll(i) = 1; (i) <= (n); ++(i))
#define forr(i, n) for (ll(i) = (n)-1; (i) >= 0; --(i))
#define forab(i, a, b, c) for (ll(i) = a; (i) <= (b); (i) += (c))
using namespace std;
template <typename T> void read(T &x) { cin >> x; }
template <typename T, typename T0> void read(T &x, T0 &y) { cin >> x >> y; }
template <typename T, typename T0, typename T1> void read(T &x, T0 &y, T1 &z) {
cin >> x >> y >> z;
}
template <typename T, typename T0, typename T1, typename T2>
void read(T &x, T0 &y, T1 &z, T2 &w) {
cin >> x >> y >> z >> w;
}
template <typename T, typename T0> void read(pair<T, T0> &p) {
cin >> p.fst >> p.scd;
}
template <typename T> void read(vector<T> &oneD, ll n) {
forn(i, n) {
ll x;
read(x);
oneD.push_back(x);
}
}
template <typename T> void read(T oneD[], ll n) {
for (ll i = 0; i < n; i++) {
read(oneD[i]);
}
}
template <typename T> void write(T &x) { cout << x << " "; }
template <typename T, typename T0> void write(T &x, T0 &y) {
cout << x << " " << y << "\n";
}
template <typename T, typename T0, typename T1> void write(T &x, T0 &y, T1 &z) {
cout << x << " " << y << " " << z << "\n";
}
template <typename T, typename T0, typename T1, typename T2>
void write(T &x, T0 &y, T1 &z, T2 &w) {
cout << x << " " << y << " " << z << " " << w << "\n";
}
template <typename T, typename T0> void write(pair<T, T0> &p) {
write(p.fst);
write(p.scd);
cout << endl;
}
template <typename T> void write(vector<T> &oneD, ll n) {
for (ll i = 0; i < n; i++) {
cout << oneD[i] << " ";
}
cout << endl;
}
template <typename T> void write(T oneD[], int n) {
for (ll i = 0; i < n; i++) {
write(oneD[i]);
}
cout << endl;
}
template <typename T, typename T0> void write(map<T, T0> &mpp) {
for (auto it : mpp) {
write(it.fst);
cout << ": ";
write(it.scd);
cout << "\n";
}
cout << endl;
}
vll seive;
void Seive() {
const ll maxn = 1e6 + 5;
seive.resize(maxn);
forn(i, maxn) seive[i] = i;
forab(i, 2, maxn, 2) seive[i] = 2;
seive[1] = -1;
seive[0] = -1;
for (ll i = 3; i <= maxn; i += 2)
if (i == seive[i])
for (ll j = i * i; j < maxn; j += i)
if (seive[j] == j)
seive[j] = i;
}
ll extended_GCD(ll a, ll b, ll &x, ll &y) {
if (a == 0) {
x = 0;
y = 1;
return b;
}
ll x1, y1;
ll gcd = extended_GCD(b % a, a, x1, y1);
x = y1 - (b / a) * x1;
y = x1;
return gcd;
}
ll modinv(ll a, ll mod = MOD) {
ll x, y;
extended_GCD(a, mod, x, y);
if (x < 0)
x += mod;
return x;
}
// Chinese Remainder Theoram
ll find_x_CRT(ll num[], ll rem[], ll n) {
ll pro = 1;
forn(i, n) pro *= num[i];
ll res = 0;
forn(i, n) {
ll pp = pro / num[i];
res += (rem[i] * modinv(pp, num[i]) * pp);
}
res %= pro;
return res;
}
ll power(ll a, ll b, ll m = MOD) {
a %= m;
ll res = 1;
while (b > 0) {
if (b & 1)
res = res * a % m;
a = a * a % m;
b >>= 1;
}
return res;
}
ll powe(ll a, ll b, ll m = MOD) {
ll res = 1;
while (b > 0) {
if (b & 1)
res = res * a;
a = a * a;
b >>= 1;
}
return res;
}
ll gcd(ll a, ll b) {
if (a == 0)
return b;
return gcd(b % a, a);
}
string getString(char x) {
string s(1, x);
return s;
}
void update(vll &BIT, ll index, ll inc) {
while (index <= (ll)(BIT.size())) {
BIT[index] += inc;
index += (index & (-index));
}
}
ll query(vll &BIT, ll index) {
ll sum = 0;
while (index > 0) {
sum += BIT[index];
index -= (index & (-index));
}
return sum;
}
typedef tree<ll, null_type, less<ll>, rb_tree_tag,
tree_order_statistics_node_update>
index_set;
// typedef tree<ll, null_type, less_equal<ll>, rb_tree_tag,
// tree_order_statistics_node_update> indexed_multiset;
void make_set(ll v, vll &parent, vll &siz) {
parent[v] = v;
siz[v] = 1;
}
ll find_set(ll x, vll &parent) {
if (x == parent[x])
return x;
else {
return parent[x] = find_set(parent[x], parent);
}
}
void union_set(ll a, ll b, vll &siz, vll &parent) {
a = find_set(a, parent);
b = find_set(b, parent);
if (a != b) {
if (siz[a] < siz[b])
swap(a, b);
parent[b] = a;
siz[a] += siz[b];
siz[b] = 0;
}
}
void precompute_NCR(vll &fact) {
const ll N = 1e6 + 5;
fact[0] = 1;
forab(i, 1, (N - 1), 1) {
ll y = (i % MOD * fact[i - 1] % MOD) % MOD;
fact[i] = y;
}
}
ll NCR(vll &fact, ll N, ll R, ll mod = MOD) {
ll n = fact[N];
ll r = fact[R];
ll n_r = fact[N - R];
ll y = (r % mod * n_r % mod) % mod;
ll z = modinv(y, mod);
ll ans = (n % mod * z % mod) % mod;
return ans;
}
void shuru_karte_hai_bina_kise_bakchodi_ke() {
flash;
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
int main() {
shuru_karte_hai_bina_kise_bakchodi_ke();
string s;
read(s);
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes";
else
cout << "No";
return 0;
} | /*
Author - Bohot harami
Motive - Candidate Master banunga ek din
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Policy_based_Data_Structure
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
/*#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;*/
#define ll long long int
#define ld long double
#define bigint int64_t
#define vll vector<ll>
#define vpll vector<pair<ll, ll>>
#define mp make_pair
#define pb push_back
#define MOD 1000000007
#define flash \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define test \
ll t; \
read(t); \
while (t--)
#define all(v) v.begin(), v.end()
#define pll pair<ll, ll>
#define INF (ll)(1e15)
#define vvll vector<vector<ll>>
#define R_0 return 0
#define db1(x) cout << #x << "=" << x << '\n'
#define db2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << '\n'
#define db3(x, y, z) \
cout << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z \
<< '\n'
#define forn(i, n) for (ll(i) = 0; (i) < (n); ++(i))
#define for1(i, n) for (ll(i) = 1; (i) <= (n); ++(i))
#define forr(i, n) for (ll(i) = (n)-1; (i) >= 0; --(i))
#define forab(i, a, b, c) for (ll(i) = a; (i) <= (b); (i) += (c))
using namespace std;
template <typename T> void read(T &x) { cin >> x; }
template <typename T, typename T0> void read(T &x, T0 &y) { cin >> x >> y; }
template <typename T, typename T0, typename T1> void read(T &x, T0 &y, T1 &z) {
cin >> x >> y >> z;
}
template <typename T, typename T0, typename T1, typename T2>
void read(T &x, T0 &y, T1 &z, T2 &w) {
cin >> x >> y >> z >> w;
}
template <typename T, typename T0> void read(pair<T, T0> &p) {
cin >> p.fst >> p.scd;
}
template <typename T> void read(vector<T> &oneD, ll n) {
forn(i, n) {
ll x;
read(x);
oneD.push_back(x);
}
}
template <typename T> void read(T oneD[], ll n) {
for (ll i = 0; i < n; i++) {
read(oneD[i]);
}
}
template <typename T> void write(T &x) { cout << x << " "; }
template <typename T, typename T0> void write(T &x, T0 &y) {
cout << x << " " << y << "\n";
}
template <typename T, typename T0, typename T1> void write(T &x, T0 &y, T1 &z) {
cout << x << " " << y << " " << z << "\n";
}
template <typename T, typename T0, typename T1, typename T2>
void write(T &x, T0 &y, T1 &z, T2 &w) {
cout << x << " " << y << " " << z << " " << w << "\n";
}
template <typename T, typename T0> void write(pair<T, T0> &p) {
write(p.fst);
write(p.scd);
cout << endl;
}
template <typename T> void write(vector<T> &oneD, ll n) {
for (ll i = 0; i < n; i++) {
cout << oneD[i] << " ";
}
cout << endl;
}
template <typename T> void write(T oneD[], int n) {
for (ll i = 0; i < n; i++) {
write(oneD[i]);
}
cout << endl;
}
template <typename T, typename T0> void write(map<T, T0> &mpp) {
for (auto it : mpp) {
write(it.fst);
cout << ": ";
write(it.scd);
cout << "\n";
}
cout << endl;
}
vll seive;
void Seive() {
const ll maxn = 1e6 + 5;
seive.resize(maxn);
forn(i, maxn) seive[i] = i;
forab(i, 2, maxn, 2) seive[i] = 2;
seive[1] = -1;
seive[0] = -1;
for (ll i = 3; i <= maxn; i += 2)
if (i == seive[i])
for (ll j = i * i; j < maxn; j += i)
if (seive[j] == j)
seive[j] = i;
}
ll extended_GCD(ll a, ll b, ll &x, ll &y) {
if (a == 0) {
x = 0;
y = 1;
return b;
}
ll x1, y1;
ll gcd = extended_GCD(b % a, a, x1, y1);
x = y1 - (b / a) * x1;
y = x1;
return gcd;
}
ll modinv(ll a, ll mod = MOD) {
ll x, y;
extended_GCD(a, mod, x, y);
if (x < 0)
x += mod;
return x;
}
// Chinese Remainder Theoram
ll find_x_CRT(ll num[], ll rem[], ll n) {
ll pro = 1;
forn(i, n) pro *= num[i];
ll res = 0;
forn(i, n) {
ll pp = pro / num[i];
res += (rem[i] * modinv(pp, num[i]) * pp);
}
res %= pro;
return res;
}
ll power(ll a, ll b, ll m = MOD) {
a %= m;
ll res = 1;
while (b > 0) {
if (b & 1)
res = res * a % m;
a = a * a % m;
b >>= 1;
}
return res;
}
ll powe(ll a, ll b, ll m = MOD) {
ll res = 1;
while (b > 0) {
if (b & 1)
res = res * a;
a = a * a;
b >>= 1;
}
return res;
}
ll gcd(ll a, ll b) {
if (a == 0)
return b;
return gcd(b % a, a);
}
string getString(char x) {
string s(1, x);
return s;
}
void update(vll &BIT, ll index, ll inc) {
while (index <= (ll)(BIT.size())) {
BIT[index] += inc;
index += (index & (-index));
}
}
ll query(vll &BIT, ll index) {
ll sum = 0;
while (index > 0) {
sum += BIT[index];
index -= (index & (-index));
}
return sum;
}
typedef tree<ll, null_type, less<ll>, rb_tree_tag,
tree_order_statistics_node_update>
index_set;
// typedef tree<ll, null_type, less_equal<ll>, rb_tree_tag,
// tree_order_statistics_node_update> indexed_multiset;
void make_set(ll v, vll &parent, vll &siz) {
parent[v] = v;
siz[v] = 1;
}
ll find_set(ll x, vll &parent) {
if (x == parent[x])
return x;
else {
return parent[x] = find_set(parent[x], parent);
}
}
void union_set(ll a, ll b, vll &siz, vll &parent) {
a = find_set(a, parent);
b = find_set(b, parent);
if (a != b) {
if (siz[a] < siz[b])
swap(a, b);
parent[b] = a;
siz[a] += siz[b];
siz[b] = 0;
}
}
void precompute_NCR(vll &fact) {
const ll N = 1e6 + 5;
fact[0] = 1;
forab(i, 1, (N - 1), 1) {
ll y = (i % MOD * fact[i - 1] % MOD) % MOD;
fact[i] = y;
}
}
ll NCR(vll &fact, ll N, ll R, ll mod = MOD) {
ll n = fact[N];
ll r = fact[R];
ll n_r = fact[N - R];
ll y = (r % mod * n_r % mod) % mod;
ll z = modinv(y, mod);
ll ans = (n % mod * z % mod) % mod;
return ans;
}
void shuru_karte_hai_bina_kise_bakchodi_ke() {
flash;
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
int main() {
// shuru_karte_hai_bina_kise_bakchodi_ke();
string s;
read(s);
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes";
else
cout << "No";
return 0;
} | replace | 277 | 278 | 277 | 278 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
bool answer = false;
if (s.at(3) == s.at(4))
answer = true;
if (s.at(5) == s.at(6))
answer = true;
if (answer)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
bool answer = false;
if ((s.at(2) == s.at(3)) && (s.at(4) == s.at(5)))
answer = true;
if (answer)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
| replace | 9 | 12 | 9 | 10 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 6) >= this->size() (which is 6)
|
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
cout << (S.at(3) == S.at(4) && S.at(5) == S.at(6) ? "Yes" : "No") << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
cout << ((S.at(2) == S.at(3) && S.at(4) == S.at(5)) ? "Yes" : "No") << endl;
}
| replace | 6 | 7 | 6 | 7 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string N;
cin >> N;
if (N.at(3) == N.at(4) && N.at(5) == N.at(6)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
char a = S.at(2);
char b = S.at(3);
char c = S.at(4);
char d = S.at(5);
if (a == b && c == d) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | replace | 4 | 7 | 4 | 11 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if ((S.at(3) == S.at(4)) && (S.at(5) == S.at(6)))
cout << "Yes" << endl;
else
cout << "No" << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if ((S.at(2) == S.at(3)) && (S.at(4) == S.at(5)))
cout << "Yes" << endl;
else
cout << "No" << endl;
} | replace | 6 | 7 | 6 | 7 | 0 | |
p02723 | C++ | Runtime Error | /*
h3110_fr13nd,
AUTHOR : @sam_jn
*/
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
using namespace std;
// using namespace __gnu_pbds;
// typedef tree<pair<int, int>, null_type, less_equal<pair<int, int>>,
// rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define boost \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define ll long long
#define MOD 1000000007
#define pb push_back
#define ff first
#define ss second
#define in(a, n) \
for (int i = 0; i < n; i++) \
cin >> a[i];
#define ot1(a, n) \
for (int i = 0; i < n; i++) \
cout << a[i] << " "; \
cout << endl;
#define ot2(a, n) \
for (int i = 0; i < n; i++) \
cout << a[i] << "\n";
ll pwr(ll a, ll b);
ll pwr(ll a, ll b, ll m);
int baap[200002];
int find(int i);
bool Union(int x, int y);
ll inv(ll x) { return pwr(x, MOD - 2, MOD); }
//----------------------------------SOLUTION-BELOW-------------------------------------------//
void solve() {
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes";
else
cout << "No";
}
int main() {
#ifndef ONLINE_JUDGE
freopen("../input", "r", stdin);
freopen("../output", "w", stdout);
#else
// online submission
#endif
boost int _ = 1;
// cout << 0 << endl;
// cin >> _;
while (_--) {
solve();
cout << endl;
}
}
//--------------------------------------DEFININTIONS---------------------------------------
ll pwr(ll a, ll b) {
if (b == 0)
return 1;
ll c = pwr(a, b / 2);
c = c * c;
if (b % 2)
return c * a;
return c;
}
ll pwr(ll a, ll b, ll m) {
if (b == 0)
return 1;
ll c = pwr(a, b / 2, m) % m;
c = (c * c) % m;
if (b % 2)
return (c * a % m) % m;
return c;
}
int find(int i) {
if (baap[i] != i)
baap[i] = find(baap[i]);
return baap[i];
}
bool Union(int x, int y) {
x = find(x);
y = find(y);
if (x == y)
return false;
baap[x] = y;
return true;
} | /*
h3110_fr13nd,
AUTHOR : @sam_jn
*/
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
using namespace std;
// using namespace __gnu_pbds;
// typedef tree<pair<int, int>, null_type, less_equal<pair<int, int>>,
// rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define boost \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define ll long long
#define MOD 1000000007
#define pb push_back
#define ff first
#define ss second
#define in(a, n) \
for (int i = 0; i < n; i++) \
cin >> a[i];
#define ot1(a, n) \
for (int i = 0; i < n; i++) \
cout << a[i] << " "; \
cout << endl;
#define ot2(a, n) \
for (int i = 0; i < n; i++) \
cout << a[i] << "\n";
ll pwr(ll a, ll b);
ll pwr(ll a, ll b, ll m);
int baap[200002];
int find(int i);
bool Union(int x, int y);
ll inv(ll x) { return pwr(x, MOD - 2, MOD); }
//----------------------------------SOLUTION-BELOW-------------------------------------------//
void solve() {
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes";
else
cout << "No";
}
int main() {
// #ifndef ONLINE_JUDGE
// freopen("../input", "r", stdin);
// freopen("../output", "w", stdout);
// #else
// // online submission
// #endif
boost int _ = 1;
// cout << 0 << endl;
// cin >> _;
while (_--) {
solve();
cout << endl;
}
}
//--------------------------------------DEFININTIONS---------------------------------------
ll pwr(ll a, ll b) {
if (b == 0)
return 1;
ll c = pwr(a, b / 2);
c = c * c;
if (b % 2)
return c * a;
return c;
}
ll pwr(ll a, ll b, ll m) {
if (b == 0)
return 1;
ll c = pwr(a, b / 2, m) % m;
c = (c * c) % m;
if (b % 2)
return (c * a % m) % m;
return c;
}
int find(int i) {
if (baap[i] != i)
baap[i] = find(baap[i]);
return baap[i];
}
bool Union(int x, int y) {
x = find(x);
y = find(y);
if (x == y)
return false;
baap[x] = y;
return true;
} | replace | 48 | 54 | 48 | 54 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if ((S.at(3) == S.at(4)) && (S.at(5) == S.at(6)))
cout << "Yes" << endl;
else
cout << "No" << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if ((S.at(2) == S.at(3)) && (S.at(4) == S.at(5)))
cout << "Yes" << endl;
else
cout << "No" << endl;
} | replace | 6 | 7 | 6 | 7 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define int long long
#define rep(i, a, b) for (int i = a; i < b; i++)
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define mod 1000000007
// int max(int a, int b, int c){ if(a>b){if(a>c) return a; else return
// c;}else{if(b>c)return b;else return c;}}
int power(int a, int b) {
int res = 1;
a %= mod;
assert(b >= 0);
for (; b; b >>= 1) {
if (b & 1)
res = res * a % mod;
a = a * a % mod;
}
return res;
}
int32_t main() {
IOS;
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes";
else
cout << "No";
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes";
else
cout << "No";
return 0;
} | replace | 2 | 32 | 2 | 3 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(3) == S.at(4) && S.at(5) == S.at(6)) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(2) == S.at(3) && S.at(4) == S.at(5)) {
cout << "Yes" << endl;
}
else {
cout << "No" << endl;
}
} | replace | 7 | 8 | 7 | 8 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(6) == 'e' && s.at(3) == 'f' && s.at(4) == 'f' && s.at(5) == 'e')
cout << "Yes" << endl;
else
cout << "No" << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(5) == s.at(4) && s.at(2) == s.at(3))
cout << "Yes" << endl;
else
cout << "No" << endl;
}
| replace | 6 | 7 | 6 | 7 | -6 | terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 6) >= this->size() (which is 6)
|
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(3) == s.at(4) && s.at(5) == s.at(6)) {
cout << "Yes";
} else {
cout << "No";
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(2) == s.at(3) && s.at(4) == s.at(5)) {
cout << "Yes";
} else {
cout << "No";
}
} | replace | 6 | 7 | 6 | 7 | 0 | |
p02723 | C++ | Runtime Error | #include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <iomanip>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
// setbase - cout << setbase (16); cout << 100 << endl; Prints 64
// setfill - cout << setfill ('x') << setw (5); cout << 77 << endl; prints
// xxx77 setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
// cout.precision(x) cout<<fixed<<val; // prints x digits after decimal in val
using namespace std;
using namespace __gnu_pbds;
#define sp << " " <<
#define mod 1000000007
#define PI 3.14159265358979323
#define y second
#define x first
#define pb push_back
#define mp make_pair
#define sz(a) a.size()
#define pqueue priority_queue<ll>
// #define pdqueue priority_queue< ll,vector<ll> ,greater< ll > >
#define codejamDebug(x) cout << "Case #" << x << ": ";
#define debug(x) cout << #x << " :" << x << endl;
#define rep(i, n) for (long long i = 0; i < n; i++)
#define f(i, a, b) for (long long i = a; i < b; i++)
#define fd(i, a, b) for (long long i = a; i >= b; i--)
#define sync \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
typedef long long int ll;
typedef long double ld;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<string> vs;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// Handle:cyber_rajat
int main(int argc, char const *argv[]) {
sync;
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| #include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <iomanip>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
// setbase - cout << setbase (16); cout << 100 << endl; Prints 64
// setfill - cout << setfill ('x') << setw (5); cout << 77 << endl; prints
// xxx77 setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx
// cout.precision(x) cout<<fixed<<val; // prints x digits after decimal in val
using namespace std;
using namespace __gnu_pbds;
#define sp << " " <<
#define mod 1000000007
#define PI 3.14159265358979323
#define y second
#define x first
#define pb push_back
#define mp make_pair
#define sz(a) a.size()
#define pqueue priority_queue<ll>
// #define pdqueue priority_queue< ll,vector<ll> ,greater< ll > >
#define codejamDebug(x) cout << "Case #" << x << ": ";
#define debug(x) cout << #x << " :" << x << endl;
#define rep(i, n) for (long long i = 0; i < n; i++)
#define f(i, a, b) for (long long i = a; i < b; i++)
#define fd(i, a, b) for (long long i = a; i >= b; i--)
#define sync \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
typedef long long int ll;
typedef long double ld;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<string> vs;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
// Handle:cyber_rajat
int main(int argc, char const *argv[]) {
sync;
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| delete | 58 | 62 | 58 | 58 | 0 | |
p02723 | C++ | Runtime Error | /* CREATED BY
STREAM_CIPHER
28-03-2020
*/
#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
typedef long long int ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
string a;
cin >> a;
if (a[2] == a[3] && a[4] == a[5])
cout << "Yes\n";
else
cout << "No\n";
} | /* CREATED BY
STREAM_CIPHER
28-03-2020
*/
#include <bits/stdc++.h>
#include <cstdio>
using namespace std;
typedef long long int ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string a;
cin >> a;
if (a[2] == a[3] && a[4] == a[5])
cout << "Yes\n";
else
cout << "No\n";
} | replace | 11 | 15 | 11 | 12 | 0 | |
p02723 | C++ | Runtime Error | /* ###########################
# Author : Pranay Garg #
# College : SGSITS #
###########################
*/
#include <bits/stdc++.h>
#define ll long long int
#define ironman \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define MOD 1000000007
#define endl '\n'
#define INF 0x7fffffff
#define PI 3.14159265358979323846
#define mp make_pair
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define allr(a) a.rbegin(), a.rend()
#define alla(a, n) a, a + n
#define debug1(x) cout << #x << " " << x << endl;
#define debug2(x, y) cout << #x << " " << x << " " << #y << " " << y << endl;
#define debug3(x, y, z) \
cout << #x << " " << x << " " << #y << " " << y << " " << #z << " " << z \
<< endl;
#define debug4(x, y, z, w) \
cout << #x << " " << x << " " << #y << " " << y << " " << #z << " " << z \
<< " " << #w << " " << w << endl;
#define debug5(x, y, z, w, v) \
cout << #x << " " << x << " " << #y << " " << y << " " << #z << " " << z \
<< " " << #w << " " << w << " " << #v << " " << v << endl;
#define debug6(x, y, z, w, a, b) \
cout << #x << " " << x << " " << #y << " " << y << " " << #z << " " << z \
<< " " << #w << " " << w << " " << #a << " " << a << " " << #b << b \
<< endl;
#define pb push_back
using namespace std;
template <class T> T max(T a, T b, T c) { return max(a, max(b, c)); }
template <class T> T min(T a, T b, T c) { return min(a, min(b, c)); }
void fastio() {
ironman
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
freopen("error.txt", "w", stderr);
#endif
}
bool prime[10000005];
void SieveOfEratosthenes(ll n) // O(nloglogn)
{
memset(prime, true, sizeof(prime));
for (ll p = 2; p * p <= n; p++) {
if (prime[p] == true) {
for (ll i = p * p; i <= n; i += p)
prime[i] = false;
}
}
}
bool isPrime(ll n) // O(sqrt(n))
{
if (n < 2)
return false;
for (ll i = 2; i * i <= n; i++)
if (n % i == 0)
return false;
return true;
}
std::vector<ll> generatePrimeFactors(ll n) {
std::vector<ll> prime;
for (ll i = 2; i * i <= n; i++) {
if (n % i == 0) {
prime.pb(i);
while (n % i == 0)
n = n / i;
}
}
if (n != 1)
prime.pb(n);
return prime;
}
std::vector<ll> generateFactors(ll n) {
std::vector<ll> fact;
for (ll i = 2; i * i <= n; i++) {
if (n % i == 0) {
fact.pb(i);
if (n / i != i)
fact.pb(n / i);
// 24 - 1,2,3,4,6,8,12
}
}
fact.pb(1);
if (n != 1)
fact.pb(n);
sort(fact.begin(), fact.end());
return fact;
}
ll extendedGCD(ll a, ll b, ll &x, ll &y) {
// produces correct results for negative integers as well
if (a == 0) {
x = 0;
y = 1;
return b;
}
ll x1, y1, d;
d = extendedGCD(b % a, a, x1, y1);
x = y1 - (b / a) * x1;
y = x1;
return d;
}
ll gcd(ll a, ll b) // O(log min(a,b))
{
/*
recursive implementation below
if(!b) return a;
return gcd(b,a%b);
*/
// non-recursive implementation below
while (b) {
a %= b;
swap(a, b);
}
return a;
}
ll multiply(ll a, ll b, ll m);
ll singlemod(ll a, ll m);
ll modpow(ll x, ll n, ll m) // O(logn)// used for calculating (x^n)%m
{
if (n == 0)
return 1;
ll res = 1;
while (n) {
if (n % 2)
res = multiply(res, x, m);
x = multiply(x, x, m);
n = n >> 1;
}
return singlemod(res, m);
}
ll modinverse(ll x, ll m) // O(logn)
{
return modpow(x, m - 2, m);
}
ll add(ll a, ll b, ll m) { return (((a % m) + (b % m)) % m); }
ll substract(ll a, ll b, ll m) {
if (a < b)
swap(a, b);
return (((a % m) - (b % m) + m) % m);
}
ll multiply(ll a, ll b, ll m) { return (((a % m) * (b % m)) % m); }
ll divide(ll a, ll b, ll m) {
ll temp = modinverse(b, m);
return multiply(a, temp, m);
}
ll singlemod(ll a, ll m) { return (a % m); }
ll eulerstotientfunction(ll n) // O(sqrt(n))
{
ll ans = n;
for (ll i = 2; i * i <= n; i++) {
if (n % i == 0) {
while (n % i == 0)
n = n / i;
ans -= ans / i;
}
}
if (n > 1)
ans -= ans / n;
return ans;
}
ll ncr(ll n, ll k, ll m) {
if (k > n)
return 0;
ll res = 1;
k = min(k, n - k);
for (ll i = 1; i <= k; i++) {
res = multiply(res, n - i + 1, m);
res = divide(res, i, m);
// res *= (n-i+1);
// res/=i;
}
return singlemod(res, m);
}
ll kadaneAlgo(const std::vector<ll> &arr) {
ll size = arr.size();
ll currmax = arr[0], maxsofar = arr[0];
for (ll i = 1; i < size; i++) {
// debug2(currmax,maxsofar);
currmax = max(arr[i], currmax + arr[i]);
maxsofar = max(maxsofar, currmax);
}
return maxsofar;
}
ll getDigitSum(ll n) {
ll co = 0;
while (n > 0) {
co += n % 10;
n = n / 10;
}
return co;
}
template <class T> void printVector(const std::vector<T> arr) {
for (auto i : arr)
cout << i << " ";
cout << endl;
}
template <class T> void printArray(T arr[], ll n) {
for (ll i = 0; i < n; i++)
cout << arr[i] << " ";
cout << endl;
}
//---------------TEMPLATE ABOVE--------------//
int main() {
fastio();
ll t = 1;
// cin >> t;
// ll cases = t;
while (t--) {
string str;
cin >> str;
if (str[2] == str[3] && str[4] == str[5])
cout << "Yes" << endl;
else
cout << "No" << endl;
// cout << "Case " << cases-t << ": " << endl;
}
} | /* ###########################
# Author : Pranay Garg #
# College : SGSITS #
###########################
*/
#include <bits/stdc++.h>
#define ll long long int
#define ironman \
ios_base::sync_with_stdio(false); \
cin.tie(NULL);
#define MOD 1000000007
#define endl '\n'
#define INF 0x7fffffff
#define PI 3.14159265358979323846
#define mp make_pair
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define allr(a) a.rbegin(), a.rend()
#define alla(a, n) a, a + n
#define debug1(x) cout << #x << " " << x << endl;
#define debug2(x, y) cout << #x << " " << x << " " << #y << " " << y << endl;
#define debug3(x, y, z) \
cout << #x << " " << x << " " << #y << " " << y << " " << #z << " " << z \
<< endl;
#define debug4(x, y, z, w) \
cout << #x << " " << x << " " << #y << " " << y << " " << #z << " " << z \
<< " " << #w << " " << w << endl;
#define debug5(x, y, z, w, v) \
cout << #x << " " << x << " " << #y << " " << y << " " << #z << " " << z \
<< " " << #w << " " << w << " " << #v << " " << v << endl;
#define debug6(x, y, z, w, a, b) \
cout << #x << " " << x << " " << #y << " " << y << " " << #z << " " << z \
<< " " << #w << " " << w << " " << #a << " " << a << " " << #b << b \
<< endl;
#define pb push_back
using namespace std;
template <class T> T max(T a, T b, T c) { return max(a, max(b, c)); }
template <class T> T min(T a, T b, T c) { return min(a, min(b, c)); }
void fastio() {
ironman
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
freopen("error.txt", "w", stderr);
#endif
}
bool prime[10000005];
void SieveOfEratosthenes(ll n) // O(nloglogn)
{
memset(prime, true, sizeof(prime));
for (ll p = 2; p * p <= n; p++) {
if (prime[p] == true) {
for (ll i = p * p; i <= n; i += p)
prime[i] = false;
}
}
}
bool isPrime(ll n) // O(sqrt(n))
{
if (n < 2)
return false;
for (ll i = 2; i * i <= n; i++)
if (n % i == 0)
return false;
return true;
}
std::vector<ll> generatePrimeFactors(ll n) {
std::vector<ll> prime;
for (ll i = 2; i * i <= n; i++) {
if (n % i == 0) {
prime.pb(i);
while (n % i == 0)
n = n / i;
}
}
if (n != 1)
prime.pb(n);
return prime;
}
std::vector<ll> generateFactors(ll n) {
std::vector<ll> fact;
for (ll i = 2; i * i <= n; i++) {
if (n % i == 0) {
fact.pb(i);
if (n / i != i)
fact.pb(n / i);
// 24 - 1,2,3,4,6,8,12
}
}
fact.pb(1);
if (n != 1)
fact.pb(n);
sort(fact.begin(), fact.end());
return fact;
}
ll extendedGCD(ll a, ll b, ll &x, ll &y) {
// produces correct results for negative integers as well
if (a == 0) {
x = 0;
y = 1;
return b;
}
ll x1, y1, d;
d = extendedGCD(b % a, a, x1, y1);
x = y1 - (b / a) * x1;
y = x1;
return d;
}
ll gcd(ll a, ll b) // O(log min(a,b))
{
/*
recursive implementation below
if(!b) return a;
return gcd(b,a%b);
*/
// non-recursive implementation below
while (b) {
a %= b;
swap(a, b);
}
return a;
}
ll multiply(ll a, ll b, ll m);
ll singlemod(ll a, ll m);
ll modpow(ll x, ll n, ll m) // O(logn)// used for calculating (x^n)%m
{
if (n == 0)
return 1;
ll res = 1;
while (n) {
if (n % 2)
res = multiply(res, x, m);
x = multiply(x, x, m);
n = n >> 1;
}
return singlemod(res, m);
}
ll modinverse(ll x, ll m) // O(logn)
{
return modpow(x, m - 2, m);
}
ll add(ll a, ll b, ll m) { return (((a % m) + (b % m)) % m); }
ll substract(ll a, ll b, ll m) {
if (a < b)
swap(a, b);
return (((a % m) - (b % m) + m) % m);
}
ll multiply(ll a, ll b, ll m) { return (((a % m) * (b % m)) % m); }
ll divide(ll a, ll b, ll m) {
ll temp = modinverse(b, m);
return multiply(a, temp, m);
}
ll singlemod(ll a, ll m) { return (a % m); }
ll eulerstotientfunction(ll n) // O(sqrt(n))
{
ll ans = n;
for (ll i = 2; i * i <= n; i++) {
if (n % i == 0) {
while (n % i == 0)
n = n / i;
ans -= ans / i;
}
}
if (n > 1)
ans -= ans / n;
return ans;
}
ll ncr(ll n, ll k, ll m) {
if (k > n)
return 0;
ll res = 1;
k = min(k, n - k);
for (ll i = 1; i <= k; i++) {
res = multiply(res, n - i + 1, m);
res = divide(res, i, m);
// res *= (n-i+1);
// res/=i;
}
return singlemod(res, m);
}
ll kadaneAlgo(const std::vector<ll> &arr) {
ll size = arr.size();
ll currmax = arr[0], maxsofar = arr[0];
for (ll i = 1; i < size; i++) {
// debug2(currmax,maxsofar);
currmax = max(arr[i], currmax + arr[i]);
maxsofar = max(maxsofar, currmax);
}
return maxsofar;
}
ll getDigitSum(ll n) {
ll co = 0;
while (n > 0) {
co += n % 10;
n = n / 10;
}
return co;
}
template <class T> void printVector(const std::vector<T> arr) {
for (auto i : arr)
cout << i << " ";
cout << endl;
}
template <class T> void printArray(T arr[], ll n) {
for (ll i = 0; i < n; i++)
cout << arr[i] << " ";
cout << endl;
}
//---------------TEMPLATE ABOVE--------------//
int main() {
// fastio();
ll t = 1;
// cin >> t;
// ll cases = t;
while (t--) {
string str;
cin >> str;
if (str[2] == str[3] && str[4] == str[5])
cout << "Yes" << endl;
else
cout << "No" << endl;
// cout << "Case " << cases-t << ": " << endl;
}
} | replace | 222 | 223 | 222 | 223 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(3) == S.at(4) && S.at(5) == S.at(6)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
int count = 0;
if (S.at(2) == S.at(3) && S.at(4) == S.at(5)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| replace | 6 | 7 | 6 | 8 | 0 | |
p02723 | C++ | Runtime Error | /*
NO
TIME
TO
DIE
--007
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
// #include <boost/functional/hash.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int lli;
lli mod = 998244353;
#define OS // single input use oeis
lli INF = 1e17;
lli eps = 1e-8;
#define IO \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define sqr(x) (x) * (x)
#define bip(n) __builtin_popcountll(n) // no of ones bit in binary!!
#define bictz(n) __builtin_ctzll(n) // no of trailing zeroes in binary!!
#define biclz(n) __builtin_clzll(n) // no of leading zeroes in binary!!
#define bffs(n) __builtin_ffsll(n) // index of first one bit!!
typedef pair<lli, lli> ll;
#define mem1(a, x) fill(&a[0], &a[0] + sizeof(a) / sizeof(a[0]), x)
#define mem2(a, x) fill(&a[0][0], &a[0][0] + sizeof(a) / sizeof(a[0][0]), x)
#define mem3(a, x) \
fill(&a[0][0][0], &a[0][0][0] + sizeof(a) / sizeof(a[0][0][0]), x)
#define fi1 ifstream fin("input.txt")
#define of1 ofstream fout("output.txt")
int fmx(int x, int y) { return (((y - x) >> (31)) & (x ^ y)) ^ y; }
int fmi(int x, int y) { return (((y - x) >> (31)) & (x ^ y)) ^ x; }
typedef tree<lli, null_type, less<lli>, rb_tree_tag,
tree_order_statistics_node_update>
ost;
lli n, z, k, x, m, d, y, q, b, c;
const double pi = 3.14159265358979323846;
// double dp[100005];
// bool cmp
lli dp[200005];
lli back[200005];
lli ans[200005];
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
IO;
OS;
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes";
else
cout << "No";
} | /*
NO
TIME
TO
DIE
--007
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
// #include <boost/functional/hash.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int lli;
lli mod = 998244353;
#define OS // single input use oeis
lli INF = 1e17;
lli eps = 1e-8;
#define IO \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define sqr(x) (x) * (x)
#define bip(n) __builtin_popcountll(n) // no of ones bit in binary!!
#define bictz(n) __builtin_ctzll(n) // no of trailing zeroes in binary!!
#define biclz(n) __builtin_clzll(n) // no of leading zeroes in binary!!
#define bffs(n) __builtin_ffsll(n) // index of first one bit!!
typedef pair<lli, lli> ll;
#define mem1(a, x) fill(&a[0], &a[0] + sizeof(a) / sizeof(a[0]), x)
#define mem2(a, x) fill(&a[0][0], &a[0][0] + sizeof(a) / sizeof(a[0][0]), x)
#define mem3(a, x) \
fill(&a[0][0][0], &a[0][0][0] + sizeof(a) / sizeof(a[0][0][0]), x)
#define fi1 ifstream fin("input.txt")
#define of1 ofstream fout("output.txt")
int fmx(int x, int y) { return (((y - x) >> (31)) & (x ^ y)) ^ y; }
int fmi(int x, int y) { return (((y - x) >> (31)) & (x ^ y)) ^ x; }
typedef tree<lli, null_type, less<lli>, rb_tree_tag,
tree_order_statistics_node_update>
ost;
lli n, z, k, x, m, d, y, q, b, c;
const double pi = 3.14159265358979323846;
// double dp[100005];
// bool cmp
lli dp[200005];
lli back[200005];
lli ans[200005];
int main() {
// #ifndef ONLINE_JUDGE
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// #endif
IO;
OS;
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes";
else
cout << "No";
} | replace | 48 | 52 | 48 | 52 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s;
cin >> s;
return s[2] == s[3] && s[4] == s[5];
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes"
<< "\n";
else
cout << "No"
<< "\n";
}
| replace | 12 | 13 | 12 | 18 | 1 | |
p02723 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
using namespace std;
#define F first
#define S second
#define int long long int
#define PB push_back
#define MP make_pair
#define PI pair<int, int>
#define VI vector<int>
#define MI map<int, int>
#define PQB priority_queue<int>
#define PQS priority_queue<int, vi, greater<int>>
#define setbits(x) __builtin_popcountll(x)
#define zrobits(x) __builtin_ctzll(x)
#define MOD 1000000007
#define INF 1e18
#define ps(x, y) fixed << setprecision(y) << x
#define mk(arr, n, type) type *arr = new type[n];
#define w(x) \
int x; \
cin >> x; \
while (x--)
#define pw(b, p) pow(b, p) + 0.1
#define loop(i, a, b) for (int i = a; i < b; i++)
void c_p_c() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
int32_t main() {
c_p_c();
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes";
else
cout << "No";
}
| #include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
using namespace std;
#define F first
#define S second
#define int long long int
#define PB push_back
#define MP make_pair
#define PI pair<int, int>
#define VI vector<int>
#define MI map<int, int>
#define PQB priority_queue<int>
#define PQS priority_queue<int, vi, greater<int>>
#define setbits(x) __builtin_popcountll(x)
#define zrobits(x) __builtin_ctzll(x)
#define MOD 1000000007
#define INF 1e18
#define ps(x, y) fixed << setprecision(y) << x
#define mk(arr, n, type) type *arr = new type[n];
#define w(x) \
int x; \
cin >> x; \
while (x--)
#define pw(b, p) pow(b, p) + 0.1
#define loop(i, a, b) for (int i = a; i < b; i++)
void c_p_c() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
int32_t main() {
c_p_c();
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes";
else
cout << "No";
}
| delete | 61 | 65 | 61 | 61 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(3) == S.at(4) && S.at(5) == S.at(6)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string S;
cin >> S;
if (S.at(2) == S.at(3) && S.at(4) == S.at(5)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| replace | 6 | 7 | 6 | 7 | 0 | |
p02723 | C++ | Runtime Error | /*
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
| |
| author : yash1399 Language : C ++ |
| college : MSIT |
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
*/
#include <algorithm>
#include <bits/stdc++.h>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long int
#define TEST \
int t; \
cin >> t; \
while (t--)
#define line cout << endl;
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define loop(i, a, b) for (long long int i = a; i < b; i++)
#define loopIn(i, a, b) for (long long int i = a; i <= b; i++)
#define Vi vector<int>
#define MAX_SIZE 1000000000
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
fast string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| /*
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
| |
| author : yash1399 Language : C ++ |
| college : MSIT |
| _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ |
*/
#include <algorithm>
#include <bits/stdc++.h>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long int
#define TEST \
int t; \
cin >> t; \
while (t--)
#define line cout << endl;
#define fast \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define loop(i, a, b) for (long long int i = a; i < b; i++)
#define loopIn(i, a, b) for (long long int i = a; i <= b; i++)
#define Vi vector<int>
#define MAX_SIZE 1000000000
using namespace std;
int main() {
fast string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
return 0;
}
| delete | 40 | 44 | 40 | 40 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main(void) {
string s;
cin >> s;
if (s.length() == 6) {
char x[6];
strcpy(x, s.c_str());
bool b = 0;
for (int i = 0; i < 2; i++) {
if (int(x[i]) < 97 || int(x[i]) > 122) {
b = 1;
break;
}
}
if (b == 0 && x[2] == x[3] && x[4] == x[5])
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main(void) {
string s;
cin >> s;
if (s.length() == 6) {
char x[7];
strcpy(x, s.c_str());
bool b = 0;
for (int i = 0; i < 2; i++) {
if (int(x[i]) < 97 || int(x[i]) > 122) {
b = 1;
break;
}
}
if (b == 0 && x[2] == x[3] && x[4] == x[5])
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 0;
}
| replace | 6 | 7 | 6 | 7 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <math.h>
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define endl "\n"
#define ll long long
#define pii pair<int, int>
#define all(x) begin(x), end(x)
#define loop(i, n) for (int i = 0; i < n; i++)
#define rep(i, a, b, c) for (int i = a; i < b; i += c)
#define brep(i, a, b, c) for (int i = a; i > b; i -= c)
#define tc(t) \
int t; \
cin >> t; \
while (t--)
#define sz(v) int((v).size())
#define pb push_back
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
IOS;
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5]) {
cout << "Yes";
} else {
cout << "No";
}
return 0;
} | #include <bits/stdc++.h>
#include <math.h>
#define IOS \
ios::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define endl "\n"
#define ll long long
#define pii pair<int, int>
#define all(x) begin(x), end(x)
#define loop(i, n) for (int i = 0; i < n; i++)
#define rep(i, a, b, c) for (int i = a; i < b; i += c)
#define brep(i, a, b, c) for (int i = a; i > b; i -= c)
#define tc(t) \
int t; \
cin >> t; \
while (t--)
#define sz(v) int((v).size())
#define pb push_back
using namespace std;
int main() {
IOS;
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5]) {
cout << "Yes";
} else {
cout << "No";
}
return 0;
} | delete | 25 | 30 | 25 | 25 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(3) == s.at(4) && s.at(5) == s.at(6)) {
cout << "Yes";
} else {
cout << "No";
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(2) == s.at(3) && s.at(5) == s.at(4)) {
cout << "Yes";
} else {
cout << "No";
}
}
| replace | 6 | 7 | 6 | 7 | 0 | |
p02723 | C++ | Runtime Error | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);
#define FO cout.tie(NULL);
#define FI cin.tie(NULL);
#define IN cin >>
#define OUT cout <<
#define loop(i, a, n) for (int i = a; i < n; i++)
#define rloop(i, a, n) for (int i = a; i >= n; i--)
#define endl "\n";
#define pb push_back
#define mp make_pair
#define set_bits(a) __builtin_popcountll(a)
#define ll long long int
#define ld long double
#define vll vector<long long int>
#define pll pair<long long int, long long int>
#define mod 1000000007
#define M 998244353
ll gcd(ll a, ll b) { return (b ? gcd(b, a % b) : a); }
ll P(ll B, ll power, ll modulo) {
ll ans = 1LL;
while (power > 0LL) {
if (power % 2LL == 1LL) {
ans = (ans * B) % modulo;
}
B = (B * B) % modulo;
power /= 2LL;
}
return ans;
}
bool isPrime(ll n) {
if (n <= 1LL) {
return false;
}
if (n <= 3LL) {
return true;
}
if (n % 2 == 0LL || n % 3 == 0LL) {
return false;
}
for (ll i = 5LL; (i * i) <= n; i += 6LL) {
if (n % i == 0LL || n % (i + 2LL) == 0LL) {
return false;
}
}
return true;
}
using namespace std;
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
return (a.second < b.second);
}
bool sortbysecll(const pll &a, const pll &b) { return (a.second < b.second); }
ll modinv(ll x, ll y, ll modulo) {
return ((x % modulo) * (P(y, modulo - 2LL, modulo) % modulo)) % modulo;
}
void vok() {
FAST FO FI
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
const int mxN = 200010;
int t[mxN], ans[mxN];
int main() {
vok();
string s;
IN s;
if (s[2] == s[3] && s[4] == s[5]) {
OUT "Yes" << endl
} else {
OUT "No" << endl
}
return 0;
} | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);
#define FO cout.tie(NULL);
#define FI cin.tie(NULL);
#define IN cin >>
#define OUT cout <<
#define loop(i, a, n) for (int i = a; i < n; i++)
#define rloop(i, a, n) for (int i = a; i >= n; i--)
#define endl "\n";
#define pb push_back
#define mp make_pair
#define set_bits(a) __builtin_popcountll(a)
#define ll long long int
#define ld long double
#define vll vector<long long int>
#define pll pair<long long int, long long int>
#define mod 1000000007
#define M 998244353
ll gcd(ll a, ll b) { return (b ? gcd(b, a % b) : a); }
ll P(ll B, ll power, ll modulo) {
ll ans = 1LL;
while (power > 0LL) {
if (power % 2LL == 1LL) {
ans = (ans * B) % modulo;
}
B = (B * B) % modulo;
power /= 2LL;
}
return ans;
}
bool isPrime(ll n) {
if (n <= 1LL) {
return false;
}
if (n <= 3LL) {
return true;
}
if (n % 2 == 0LL || n % 3 == 0LL) {
return false;
}
for (ll i = 5LL; (i * i) <= n; i += 6LL) {
if (n % i == 0LL || n % (i + 2LL) == 0LL) {
return false;
}
}
return true;
}
using namespace std;
bool sortbysec(const pair<int, int> &a, const pair<int, int> &b) {
return (a.second < b.second);
}
bool sortbysecll(const pll &a, const pll &b) { return (a.second < b.second); }
ll modinv(ll x, ll y, ll modulo) {
return ((x % modulo) * (P(y, modulo - 2LL, modulo) % modulo)) % modulo;
}
void vok() {
FAST FO FI
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
const int mxN = 200010;
int t[mxN], ans[mxN];
int main() {
// vok();
string s;
IN s;
if (s[2] == s[3] && s[4] == s[5]) {
OUT "Yes" << endl
} else {
OUT "No" << endl
}
return 0;
}
| replace | 66 | 67 | 66 | 67 | 0 | |
p02723 | C++ | Runtime Error | /*
KUNAL RAUT (ZUKONIT14) :- "DO WHAT YOU LIKE!"
-PICT,PUNE! :)
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define ld long double
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define mod 1000000007
#define mod9 1000000009
#define pi 3.1415926535
#define MAXN 100005
#define N 1000001
#define MAX2N 1 * 1000 + 10
#define all(v) v.begin(), v.end()
#define ms(s, n) memset(s, n, sizeof(s))
#define prec(n) fixed << setprecision(n)
#define forci(p, n) for (ll i = p; i < (ll)n; i++)
#define forcj(p, n) for (ll j = p; j < (ll)n; j++)
#define bolt \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define bits(a) __builtin_popcount(a)
#define test \
ll t; \
cin >> t; \
for (ll testi = 1; testi <= t; testi++)
ll zero = 0;
ll one = 1;
ll gcd(ll a, ll b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
ll lcm(ll a, ll b) { return (a / gcd(a, b) * b); }
ll expo(ll x, ll y) {
ll res = 1;
x = x % mod;
while (y > 0) {
if (y & 1)
res = (1ll * res * x) % mod;
y = y >> 1;
x = (1ll * x * x) % mod;
}
return res;
}
ll ncr(ll n, ll r) {
ll res = 1;
if (r > n - r)
r = n - r;
for (ll i = 0; i < r; i++) {
res *= n - i;
res /= i + 1;
}
return res;
}
ll max(ll a, ll b) { return (a > b) ? a : b; }
bool prime(ll n) {
ll i;
for (i = 2; i <= sqrt(n); i++) {
if (n % i == 0)
return false;
}
return true;
}
bool sortbysec(const pair<ll, ll> &a, const pair<ll, ll> &b) {
if (a.second == b.second)
return a.first < b.first;
return (a.second < b.second);
}
// https://www.youtube.com/watch?v=WTJSt4wP2ME
ll rr[] = {
0, 1, 1, 1, 0, -1, -1, -1,
};
ll cc[] = {1, 1, 0, -1, -1, -1, 0, 1};
ll a[MAXN], ans[MAXN];
signed main() {
bolt;
#ifndef ONLINE_JUDGE
freopen("input00.txt", "r", stdin);
freopen("output00.txt", "w", stdout);
#endif
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes";
else
cout << "No";
}
| /*
KUNAL RAUT (ZUKONIT14) :- "DO WHAT YOU LIKE!"
-PICT,PUNE! :)
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int long long
#define ld long double
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define mod 1000000007
#define mod9 1000000009
#define pi 3.1415926535
#define MAXN 100005
#define N 1000001
#define MAX2N 1 * 1000 + 10
#define all(v) v.begin(), v.end()
#define ms(s, n) memset(s, n, sizeof(s))
#define prec(n) fixed << setprecision(n)
#define forci(p, n) for (ll i = p; i < (ll)n; i++)
#define forcj(p, n) for (ll j = p; j < (ll)n; j++)
#define bolt \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
#define bits(a) __builtin_popcount(a)
#define test \
ll t; \
cin >> t; \
for (ll testi = 1; testi <= t; testi++)
ll zero = 0;
ll one = 1;
ll gcd(ll a, ll b) {
if (b == 0)
return a;
return gcd(b, a % b);
}
ll lcm(ll a, ll b) { return (a / gcd(a, b) * b); }
ll expo(ll x, ll y) {
ll res = 1;
x = x % mod;
while (y > 0) {
if (y & 1)
res = (1ll * res * x) % mod;
y = y >> 1;
x = (1ll * x * x) % mod;
}
return res;
}
ll ncr(ll n, ll r) {
ll res = 1;
if (r > n - r)
r = n - r;
for (ll i = 0; i < r; i++) {
res *= n - i;
res /= i + 1;
}
return res;
}
ll max(ll a, ll b) { return (a > b) ? a : b; }
bool prime(ll n) {
ll i;
for (i = 2; i <= sqrt(n); i++) {
if (n % i == 0)
return false;
}
return true;
}
bool sortbysec(const pair<ll, ll> &a, const pair<ll, ll> &b) {
if (a.second == b.second)
return a.first < b.first;
return (a.second < b.second);
}
// https://www.youtube.com/watch?v=WTJSt4wP2ME
ll rr[] = {
0, 1, 1, 1, 0, -1, -1, -1,
};
ll cc[] = {1, 1, 0, -1, -1, -1, 0, 1};
ll a[MAXN], ans[MAXN];
signed main() {
bolt;
// #ifndef ONLINE_JUDGE
// freopen("input00.txt", "r", stdin);
// freopen("output00.txt", "w", stdout);
// #endif
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes";
else
cout << "No";
}
| replace | 87 | 91 | 87 | 91 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
#define maxn 6
#define INF 0x3f3f3f3f
#define mod 1000000007
typedef long long ll;
using namespace std;
char buf[maxn];
void slove() {
cin >> buf;
if (buf[2] == buf[3] && buf[4] == buf[5])
cout << "Yes\n";
else
cout << "No\n";
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
#ifdef ONLINE_JUDGE
#else
freopen("C:\\Users\\Fish_Brother\\Desktop\\in", "r", stdin);
freopen("C:\\Users\\Fish_Brother\\Desktop\\out", "w", stdout);
#endif
slove();
return 0;
} | #include <bits/stdc++.h>
#define maxn 6
#define INF 0x3f3f3f3f
#define mod 1000000007
typedef long long ll;
using namespace std;
char buf[maxn];
void slove() {
cin >> buf;
if (buf[2] == buf[3] && buf[4] == buf[5])
cout << "Yes\n";
else
cout << "No\n";
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
slove();
return 0;
} | replace | 21 | 26 | 21 | 22 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define deb(x) cout << #x << " " << x << endl;
#define fo(i, n) for (int i = 0; i < n; i++)
#define Fo(i, k, n) for (int i = k; i < n; i++)
#define vi vector<int>
#define ii pair<int, int>
#define vii vector<ii>
#define ll long long
#define pb push_back
#define endl "\n"
#define mp map<int, int>
#define F first
#define S second
#define sz(v) (int)v.size()
#define mod 1000000007
void c_p_c() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
int main() {
c_p_c();
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes\n";
else
cout << "No\n";
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define deb(x) cout << #x << " " << x << endl;
#define fo(i, n) for (int i = 0; i < n; i++)
#define Fo(i, k, n) for (int i = k; i < n; i++)
#define vi vector<int>
#define ii pair<int, int>
#define vii vector<ii>
#define ll long long
#define pb push_back
#define endl "\n"
#define mp map<int, int>
#define F first
#define S second
#define sz(v) (int)v.size()
#define mod 1000000007
void c_p_c() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
// #ifndef ONLINE_JUDGE
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
// #endif
}
int main() {
c_p_c();
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes\n";
else
cout << "No\n";
return 0;
} | replace | 22 | 26 | 22 | 26 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(3) == s.at(4) && s.at(5) == s.at(6))
cout << "Yes" << endl;
else
cout << "No" << endl;
} | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(2) == s.at(3) && s.at(4) == s.at(5))
cout << "Yes" << endl;
else
cout << "No" << endl;
} | replace | 7 | 8 | 7 | 8 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
vector<char> S(6);
for (int i = 0; i < 6; i++) {
cin >> S.at(i);
}
if (S.at(3) == S.at(4) && S.at(5) == S.at(6)) {
cout << "Yes";
} else {
cout << "No";
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
vector<char> S(6);
for (int i = 0; i < 6; i++) {
cin >> S.at(i);
}
if (S.at(2) == S.at(3) && S.at(4) == S.at(5)) {
cout << "Yes";
} else {
cout << "No";
}
}
| replace | 8 | 9 | 8 | 9 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string a;
cin >> a;
if ((a.at(3) == a.at(4)) && (a.at(5) == a.at(6))) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string a;
cin >> a;
if ((a.at(3) == a.at(2)) && (a.at(5) == a.at(4))) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | replace | 6 | 7 | 6 | 7 | 0 | |
p02723 | C++ | Runtime Error | // coffee と似ているかを判定
#include <iostream>
int main(int argc, char const *argv[]) {
std::string input;
std::cin >> input;
if (input.at(3) == input.at(4) && input.at(5) == input.at(6)) {
std::cout << "Yes\n";
} else {
std::cout << "No\n";
}
return 0;
}
| // coffee と似ているかを判定
#include <iostream>
int main(int argc, char const *argv[]) {
std::string input;
std::cin >> input;
if (input.at(2) == input.at(3) && input.at(4) == input.at(5)) {
std::cout << "Yes\n";
} else {
std::cout << "No\n";
}
return 0;
}
| replace | 7 | 8 | 7 | 8 | 0 | |
p02723 | C++ | Runtime Error |
#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstring>
#include <chrono>
#include <complex>
#define endl "\n"
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define vvi vector<vi>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define mod 1000000007
#define inf 1000000000000000001;
#define all(c) c.begin(), c.end()
#define mp(x, y) make_pair(x, y)
#define mem(a, val) memset(a, val, sizeof(a))
#define eb emplace_back
#define f first
#define s second
using namespace std;
int main() {
std::ios::sync_with_stdio(false);
#ifndef ONLINE_JUDGE
// for getting input from input.txt
freopen("input.txt", "r", stdin);
// for writing output to output.txt
freopen("output.txt", "w", stdout);
#endif
// cin>>T;
// // cin.ignore(); must be there when using getline(cin, s)
// while(T--)
// {
// }
// return 0;
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
|
#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstring>
#include <chrono>
#include <complex>
#define endl "\n"
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define vvi vector<vi>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define mod 1000000007
#define inf 1000000000000000001;
#define all(c) c.begin(), c.end()
#define mp(x, y) make_pair(x, y)
#define mem(a, val) memset(a, val, sizeof(a))
#define eb emplace_back
#define f first
#define s second
using namespace std;
int main() {
// std::ios::sync_with_stdio(false);
// #ifndef ONLINE_JUDGE
// // for getting input from input.txt
// freopen("input.txt", "r", stdin);
// // for writing output to output.txt
// freopen("output.txt", "w", stdout);
// #endif
// cin>>T;
// // cin.ignore(); must be there when using getline(cin, s)
// while(T--)
// {
// }
// return 0;
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5]) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| replace | 26 | 33 | 26 | 33 | 0 | |
p02723 | C++ | Runtime Error | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define ll long long
#define test(t) \
ll int t; \
cin >> t; \
while (t--)
#define F(i, L, R) for (ll int i = L; i < R; i++)
#define F2(i, L, R) for (ll int i = L; i >= R; i--)
#define get1(a) \
ll int a; \
cin >> a;
#define get2(a, b) \
ll int a, b; \
cin >> a >> b;
#define get3(a, b, c) \
ll int a, b, c; \
cin >> a >> b >> c;
#define pb push_back
#define mp make_pair
#define MAX 1000000001
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5]) {
cout << "Yes\n";
} else {
cout << "No\n";
}
return 0;
} | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define ll long long
#define test(t) \
ll int t; \
cin >> t; \
while (t--)
#define F(i, L, R) for (ll int i = L; i < R; i++)
#define F2(i, L, R) for (ll int i = L; i >= R; i--)
#define get1(a) \
ll int a; \
cin >> a;
#define get2(a, b) \
ll int a, b; \
cin >> a >> b;
#define get3(a, b, c) \
ll int a, b, c; \
cin >> a >> b >> c;
#define pb push_back
#define mp make_pair
#define MAX 1000000001
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5]) {
cout << "Yes\n";
} else {
cout << "No\n";
}
return 0;
}
| delete | 29 | 34 | 29 | 29 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
#endif
string s;
cin >> s;
bool flag = 0;
if (s[2] == s[3] && s[4] == s[5])
flag = 1;
if (flag)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLINE_JUDGE
// freopen("input.txt","r",stdin);
#endif
string s;
cin >> s;
bool flag = 0;
if (s[2] == s[3] && s[4] == s[5])
flag = 1;
if (flag)
cout << "Yes" << endl;
else
cout << "No" << endl;
return 0;
} | replace | 7 | 8 | 7 | 8 | 0 | |
p02723 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int i = 0;
for (int i = 0; i < s.length(); i++) {
/* code */
if (s[2] == s[3] and s[4] == s[5]) {
cout << "Yes" << endl;
i = 1;
}
}
if (i != 1) {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
int i = 0;
if (s[2] == s[3] and s[4] == s[5]) {
cout << "Yes" << endl;
i = 1;
}
if (i != 1) {
cout << "No" << endl;
}
} | replace | 7 | 13 | 7 | 10 | TLE | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
int main() {
string s;
cin >> s;
if (s.at(3) == s.at(4) && s.at(5) == s.at(6))
cout << "Yes" << endl;
else
cout << "No" << endl;
}
| #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
int main() {
string s;
cin >> s;
if (s.at(2) == s.at(3) && s.at(4) == s.at(5))
cout << "Yes" << endl;
else
cout << "No" << endl;
}
| replace | 7 | 8 | 7 | 8 | 0 | |
p02723 | C++ | Runtime Error | // HE WHO TRAVELS THE FASTEST, TRAVELS ALONE
#include <bits/stdc++.h>
#include <stack>
using namespace std;
#define ORIGAMI ios_base::sync_with_stdio(false), cin.tie(NULL);
#define pb push_back
#define INF 1e18LL
#define ll long long int
vector<ll> adj[100000];
vector<bool> vis(100000, false);
ll mod = 998244353;
ll gcd(ll a, ll b) {
if (b == 0)
return a;
else
return gcd(b, a % b);
}
ll po(ll a, ll b) {
ll mod = 100;
a %= mod;
b %= mod;
ll res = 1;
while (b > 0) {
if (b & 1)
res = (res * a) % mod;
a = a * a % mod;
b /= 2;
}
return res;
}
void dfs(ll x) {
vis[x] = true;
cout << x << " ";
for (auto u : adj[x]) {
if (!vis[u])
dfs(u);
}
}
bool isprime(ll x) {
for (int i = 2; i * i <= x; i++) {
if (x % i == 0)
return false;
}
return true;
}
bool solve(ll x) {
ll s = 1;
for (int i = x / 2; i > 1; i--) {
if (x % i == 0) {
s += i;
}
}
if (s == x)
return true;
return false;
}
int main() {
ORIGAMI
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes\n";
else
cout << "No\n";
return 0;
} | // HE WHO TRAVELS THE FASTEST, TRAVELS ALONE
#include <bits/stdc++.h>
#include <stack>
using namespace std;
#define ORIGAMI ios_base::sync_with_stdio(false), cin.tie(NULL);
#define pb push_back
#define INF 1e18LL
#define ll long long int
vector<ll> adj[100000];
vector<bool> vis(100000, false);
ll mod = 998244353;
ll gcd(ll a, ll b) {
if (b == 0)
return a;
else
return gcd(b, a % b);
}
ll po(ll a, ll b) {
ll mod = 100;
a %= mod;
b %= mod;
ll res = 1;
while (b > 0) {
if (b & 1)
res = (res * a) % mod;
a = a * a % mod;
b /= 2;
}
return res;
}
void dfs(ll x) {
vis[x] = true;
cout << x << " ";
for (auto u : adj[x]) {
if (!vis[u])
dfs(u);
}
}
bool isprime(ll x) {
for (int i = 2; i * i <= x; i++) {
if (x % i == 0)
return false;
}
return true;
}
bool solve(ll x) {
ll s = 1;
for (int i = x / 2; i > 1; i--) {
if (x % i == 0) {
s += i;
}
}
if (s == x)
return true;
return false;
}
int main() {
ORIGAMI
// #ifndef ONLINE_JUDGE
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
// #endif
string s;
cin >> s;
if (s[2] == s[3] && s[4] == s[5])
cout << "Yes\n";
else
cout << "No\n";
return 0;
} | replace | 65 | 69 | 65 | 69 | 0 | |
p02723 | C++ | Runtime Error | #include <stdio.h>
int main() {
char s[6];
int i;
for (i = 0; i < 6; i++) {
scanf("%s", s[i]);
}
if (s[2] == s[3] && s[4] == s[5]) {
printf("Yes");
} else {
printf("No");
}
return 0;
} | #include <stdio.h>
int main() {
char s[6];
int i;
for (i = 0; i < 6; i++) {
scanf("%s", &s[i]);
}
if (s[2] == s[3] && s[4] == s[5]) {
printf("Yes");
} else {
printf("No");
}
return 0;
} | replace | 7 | 8 | 7 | 8 | 0 | |
p02723 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(3) == s.at(4) && s.at(5) == s.at(6)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
if (s.at(2) == s.at(3) && s.at(4) == s.at(5)) {
cout << "Yes" << endl;
} else {
cout << "No" << endl;
}
}
| replace | 5 | 6 | 5 | 6 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.