problem_id stringlengths 6 6 | buggy_code stringlengths 8 526k ⌀ | fixed_code stringlengths 12 526k ⌀ | labels listlengths 0 15 ⌀ | buggy_submission_id int64 1 1.54M ⌀ | fixed_submission_id int64 2 1.54M ⌀ | user_id stringlengths 10 10 ⌀ | language stringclasses 9
values |
|---|---|---|---|---|---|---|---|
p03101 | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
using llint = long long;
using vint = vector<int>;
int main() {
int h, w, x, y;
cin >> h >> w >> x >> y;
cout << h * w - (x * w + y * h - h * w) << endl;
} | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
using llint = long long;
using vint = vector<int>;
int main() {
int h, w, x, y;
cin >> h >> w >> x >> y;
cout << h * w - (x * w + y * h - x * y) << endl;
} | [
"identifier.change",
"io.output.change"
] | 907,841 | 907,842 | u932319885 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
#define ll long long // long long省略
#define pb push_back // push_back省略
#define mp make_pair // make_pair省略
#define fi first // first省略
#define se second // second省略
#define itn int // int誤字保険
#define count cout // cout誤字保険
#define vecotr vector // vector誤字保険
#define ednl endl // endl誤字保険
#define opt() \
cin.tie(0); \
ios::sync_with_stdio(false) // 入出力速度改善
#define rep(i, l, r) \
for (ll i = (l); i < (r); i++) // 範囲[l, r)で刻み1のfor文(順方向)
#define repp(i, l, r, k) \
for (ll i = (l); i < (r); i += (k)) // 範囲[l, r)で刻みkのfor文(順方向)
#define rrep(i, l, r) \
for (ll i = (r - 1); i >= (l); i--) // 範囲[l, r)で刻み1のfor文(逆方向)
#define rrepp(i, l, r, k) \
for (ll i = (r - 1); i >= (l); i -= (k)) // 範囲[l, r)で刻みkのfor文(逆方向)
#define all(x) (x).begin(), (x).end() // vectorのポインタ位置指定用
#define max(p, q) ((p) > (q) ? (p) : (q)) // max拡張
#define min(p, q) ((p) < (q) ? (p) : (q)) // min拡張
#define bit(n, m) (((n) >> (m)) & 1) // 変数nのm番目のbitを取り出す
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;
}
int dy[] = {0, 1, 0, -1}; // 4方向近傍
int dx[] = {1, 0, -1, 0}; // 4方向近傍
int main() {
ll a, b, c, d;
cin >> a >> b >> c >> d;
cout << a * b - (a * c + b * d - c * d) << ednl;
}
| #include <bits/stdc++.h>
using namespace std;
#define ll long long // long long省略
#define pb push_back // push_back省略
#define mp make_pair // make_pair省略
#define fi first // first省略
#define se second // second省略
#define itn int // int誤字保険
#define count cout // cout誤字保険
#define vecotr vector // vector誤字保険
#define ednl endl // endl誤字保険
#define opt() \
cin.tie(0); \
ios::sync_with_stdio(false) // 入出力速度改善
#define rep(i, l, r) \
for (ll i = (l); i < (r); i++) // 範囲[l, r)で刻み1のfor文(順方向)
#define repp(i, l, r, k) \
for (ll i = (l); i < (r); i += (k)) // 範囲[l, r)で刻みkのfor文(順方向)
#define rrep(i, l, r) \
for (ll i = (r - 1); i >= (l); i--) // 範囲[l, r)で刻み1のfor文(逆方向)
#define rrepp(i, l, r, k) \
for (ll i = (r - 1); i >= (l); i -= (k)) // 範囲[l, r)で刻みkのfor文(逆方向)
#define all(x) (x).begin(), (x).end() // vectorのポインタ位置指定用
#define max(p, q) ((p) > (q) ? (p) : (q)) // max拡張
#define min(p, q) ((p) < (q) ? (p) : (q)) // min拡張
#define bit(n, m) (((n) >> (m)) & 1) // 変数nのm番目のbitを取り出す
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;
}
int dy[] = {0, 1, 0, -1}; // 4方向近傍
int dx[] = {1, 0, -1, 0}; // 4方向近傍
int main() {
ll a, b, c, d;
cin >> a >> b >> c >> d;
cout << a * b - (a * d + b * c - c * d) << ednl;
}
| [
"identifier.change",
"io.output.change"
] | 907,843 | 907,844 | u547754910 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << H * w + h * W - h * w << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << H * W - H * w - h * W + h * w << endl;
}
| [
"misc.opposites",
"expression.operator.arithmetic.change",
"io.output.change"
] | 907,845 | 907,846 | u882039496 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
int main() {
int H, W;
cin >> H >> W;
int h, w;
cin >> h >> w;
cout << H * W - h * H - w * W + h * w << endl;
} | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
int main() {
int H, W;
cin >> H >> W;
int h, w;
cin >> h >> w;
cout << H * W - h * W - w * H + h * w << endl;
}
| [
"identifier.change",
"io.output.change"
] | 907,847 | 907,848 | u854161810 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w, H, W;
cin >> H >> W >> h >> w;
cout << h * w - h * W - H * w + h * w;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w, H, W;
cin >> H >> W >> h >> w;
cout << H * W - h * W - H * w + h * w;
return 0;
}
| [
"identifier.change",
"io.output.change"
] | 907,851 | 907,852 | u533749093 | cpp |
p03101 | using namespace std;
#include <bits/stdc++.h>
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
int S = H * W;
int A = h * W + w * H;
int B = h * W;
int ans = S - A + B;
cout << ans << endl;
}
| using namespace std;
#include <bits/stdc++.h>
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
int S = H * W;
int A = h * W + w * H;
int B = h * w;
int ans = S - A + B;
cout << ans << endl;
}
| [
"identifier.change",
"expression.operation.binary.change"
] | 907,853 | 907,854 | u615258936 | cpp |
p03096 | #include <algorithm>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <vector>
#define _USE_MATH_DEFINES
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
using namespace std;
#define EPS 1e-12
#define ull unsigned long long
#define ll long long
#define VI vector<ll>
#define PII pair<ll, ll>
#define VVI vector<vector<ll>>
#define REP(i, n) for (int i = 0, _n = (n); (i) < (int)_n; ++i)
#define RANGE(i, a, b) for (int i = (int)a, _b = (int)(b); (i) < _b; ++i)
#define FOR(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define ALLR(c) (c).rbegin(), (c).rend()
#define PB push_back
#define MP(a, b) make_pair(a, b)
#define POPCOUNT __builtin_popcount
#define POPCOUNTLL __builtin_popcountll
#define CLEAR(table, v) memset(table, v, sizeof(table));
#define PRINT1(table, D0) \
REP(d0, D0) cout << table[d0] << " "; \
cout << "\n";
#define PRINT2(table, D0, D1) \
REP(d0, D0) { \
REP(d1, D1) cout << table[d0][d1] << " "; \
cout << "\n"; \
}
#define PRINT3(table, D0, D1, D2) \
REP(d0, D0) { \
REP(d1, D1) { \
REP(d2, D2) cout << table[d0][d1][d2] << " "; \
cout << "\n"; \
} \
cout << "\n"; \
}
#define UNIFORM_DOUBLE(a, b) \
(((b - a) * (double)rand() / RAND_MAX) + a) // [a, b)
#define UNIFORM_LL(a, b) (ll) UNIFORM_DOUBLE(a, b) // [a, b)
#define IN(v, lo, hi) ((lo) <= (v) && (v) < (hi))
#define DD(v) cout << #v << ": " << v << endl
template <typename T0, typename T1>
std::ostream &operator<<(std::ostream &os, const map<T0, T1> &v) {
for (typename map<T0, T1>::const_iterator p = v.begin(); p != v.end(); p++) {
os << p->first << ": " << p->second << " ";
}
return os;
}
template <typename T0, typename T1>
std::ostream &operator<<(std::ostream &os, const pair<T0, T1> &v) {
os << v.first << ": " << v.second << " ";
return os;
}
template <typename T>
std::ostream &operator<<(std::ostream &os, const vector<T> &v) {
for (int i = 0; i < (int)v.size(); i++) {
os << v[i] << " ";
}
return os;
}
template <typename T>
std::ostream &operator<<(std::ostream &os, const vector<vector<T>> &v) {
for (int i = 0; i < (int)v.size(); i++) {
os << v[i] << endl;
}
return os;
}
template <typename T>
std::ostream &operator<<(std::ostream &os, const set<T> &v) {
vector<T> tmp(v.begin(), v.end());
os << tmp;
return os;
}
template <typename T>
std::ostream &operator<<(std::ostream &os, const deque<T> &v) {
vector<T> tmp(v.begin(), v.end());
os << tmp;
return os;
}
#define MOD 1000000007LL
#define INF (1LL << 60)
struct modll {
static const ll MODVAL;
ll val;
modll() : val(0) {}
modll(ll v) : val(v) { normalize(); }
void normalize() { val = (val + MODVAL) % MODVAL; }
modll operator+(ll v) { return modll(val + v); }
modll &operator+=(ll v) {
val += v;
normalize();
return *this;
}
modll operator-(ll v) { return modll(val - v); }
modll &operator-=(ll v) {
val -= v;
normalize();
return *this;
}
modll operator*(ll v) { return modll(val * v); }
modll &operator*=(ll v) {
val *= v;
normalize();
return *this;
}
modll operator^(ll e) {
modll x(val);
modll v(1);
for (; e; x = x * x, e >>= 1)
if (e & 1)
v = v * x;
return v;
} // pow
modll inv() {
modll x(val);
return x ^ (MODVAL - 2);
} // MODVAL must be prime number when use this!
static modll inv(ll v) { return modll(v).inv(); }
operator ll() { return val; }
};
const ll modll::MODVAL = 1000000007;
std::ostream &operator<<(std::ostream &os, const modll &v) {
os << v.val;
return os;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll N, v;
while (cin >> N) {
VI w(N);
REP(i, N) cin >> w[i];
vector<modll> dp(N);
map<ll, modll> sum;
dp[0] = 1LL;
sum[w[0]] = modll(1LL);
RANGE(i, 1, N) {
dp[i] = dp[i - 1];
// if(w[i]!=w[i-1]) REP(j, i) if(w[j]==w[i]) dp[i]
//+= 0<=j-1 ? dp[j-1] : modll(1LL);
if (w[i] != w[i - 1])
dp[i] += sum[w[i]];
sum[w[i]] += 0 <= i - 1 ? dp[i - 1] : modll(1LL);
}
// DD(dp);
cout << dp[N - 1] << endl;
}
return 0;
}
| #include <algorithm>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <vector>
#define _USE_MATH_DEFINES
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
using namespace std;
#define EPS 1e-12
#define ull unsigned long long
#define ll long long
#define VI vector<ll>
#define PII pair<ll, ll>
#define VVI vector<vector<ll>>
#define REP(i, n) for (int i = 0, _n = (n); (i) < (int)_n; ++i)
#define RANGE(i, a, b) for (int i = (int)a, _b = (int)(b); (i) < _b; ++i)
#define FOR(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define ALLR(c) (c).rbegin(), (c).rend()
#define PB push_back
#define MP(a, b) make_pair(a, b)
#define POPCOUNT __builtin_popcount
#define POPCOUNTLL __builtin_popcountll
#define CLEAR(table, v) memset(table, v, sizeof(table));
#define PRINT1(table, D0) \
REP(d0, D0) cout << table[d0] << " "; \
cout << "\n";
#define PRINT2(table, D0, D1) \
REP(d0, D0) { \
REP(d1, D1) cout << table[d0][d1] << " "; \
cout << "\n"; \
}
#define PRINT3(table, D0, D1, D2) \
REP(d0, D0) { \
REP(d1, D1) { \
REP(d2, D2) cout << table[d0][d1][d2] << " "; \
cout << "\n"; \
} \
cout << "\n"; \
}
#define UNIFORM_DOUBLE(a, b) \
(((b - a) * (double)rand() / RAND_MAX) + a) // [a, b)
#define UNIFORM_LL(a, b) (ll) UNIFORM_DOUBLE(a, b) // [a, b)
#define IN(v, lo, hi) ((lo) <= (v) && (v) < (hi))
#define DD(v) cout << #v << ": " << v << endl
template <typename T0, typename T1>
std::ostream &operator<<(std::ostream &os, const map<T0, T1> &v) {
for (typename map<T0, T1>::const_iterator p = v.begin(); p != v.end(); p++) {
os << p->first << ": " << p->second << " ";
}
return os;
}
template <typename T0, typename T1>
std::ostream &operator<<(std::ostream &os, const pair<T0, T1> &v) {
os << v.first << ": " << v.second << " ";
return os;
}
template <typename T>
std::ostream &operator<<(std::ostream &os, const vector<T> &v) {
for (int i = 0; i < (int)v.size(); i++) {
os << v[i] << " ";
}
return os;
}
template <typename T>
std::ostream &operator<<(std::ostream &os, const vector<vector<T>> &v) {
for (int i = 0; i < (int)v.size(); i++) {
os << v[i] << endl;
}
return os;
}
template <typename T>
std::ostream &operator<<(std::ostream &os, const set<T> &v) {
vector<T> tmp(v.begin(), v.end());
os << tmp;
return os;
}
template <typename T>
std::ostream &operator<<(std::ostream &os, const deque<T> &v) {
vector<T> tmp(v.begin(), v.end());
os << tmp;
return os;
}
#define MOD 1000000007LL
#define INF (1LL << 60)
struct modll {
static const ll MODVAL;
ll val;
modll() : val(0) {}
modll(ll v) : val(v) { normalize(); }
void normalize() { val = (val + MODVAL) % MODVAL; }
modll operator+(ll v) { return modll(val + v); }
modll &operator+=(ll v) {
val += v;
normalize();
return *this;
}
modll operator-(ll v) { return modll(val - v); }
modll &operator-=(ll v) {
val -= v;
normalize();
return *this;
}
modll operator*(ll v) { return modll(val * v); }
modll &operator*=(ll v) {
val *= v;
normalize();
return *this;
}
modll operator^(ll e) {
modll x(val);
modll v(1);
for (; e; x = x * x, e >>= 1)
if (e & 1)
v = v * x;
return v;
} // pow
modll inv() {
modll x(val);
return x ^ (MODVAL - 2);
} // MODVAL must be prime number when use this!
static modll inv(ll v) { return modll(v).inv(); }
operator ll() { return val; }
};
const ll modll::MODVAL = 1000000007;
std::ostream &operator<<(std::ostream &os, const modll &v) {
os << v.val;
return os;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll N, v;
while (cin >> N) {
VI w(N);
REP(i, N) cin >> w[i];
vector<modll> dp(N);
map<ll, modll> sum;
dp[0] = 1LL;
sum[w[0]] = modll(1LL);
RANGE(i, 1, N) {
dp[i] = dp[i - 1];
// if(w[i]!=w[i-1]) REP(j, i) if(w[j]==w[i]) dp[i]
//+= 0<=j-1 ? dp[j-1] : modll(1LL);
if (w[i] != w[i - 1]) {
dp[i] += sum[w[i]];
sum[w[i]] += 0 <= i - 1 ? dp[i - 1] : modll(1LL);
}
}
// DD(dp);
cout << dp[N - 1] << endl;
}
return 0;
}
| [] | 907,860 | 907,861 | u655723240 | cpp |
p03096 | #include <algorithm>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <vector>
#define _USE_MATH_DEFINES
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
using namespace std;
#define EPS 1e-12
#define ull unsigned long long
#define ll long long
#define VI vector<ll>
#define PII pair<ll, ll>
#define VVI vector<vector<ll>>
#define REP(i, n) for (int i = 0, _n = (n); (i) < (int)_n; ++i)
#define RANGE(i, a, b) for (int i = (int)a, _b = (int)(b); (i) < _b; ++i)
#define FOR(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define ALLR(c) (c).rbegin(), (c).rend()
#define PB push_back
#define MP(a, b) make_pair(a, b)
#define POPCOUNT __builtin_popcount
#define POPCOUNTLL __builtin_popcountll
#define CLEAR(table, v) memset(table, v, sizeof(table));
#define PRINT1(table, D0) \
REP(d0, D0) cout << table[d0] << " "; \
cout << "\n";
#define PRINT2(table, D0, D1) \
REP(d0, D0) { \
REP(d1, D1) cout << table[d0][d1] << " "; \
cout << "\n"; \
}
#define PRINT3(table, D0, D1, D2) \
REP(d0, D0) { \
REP(d1, D1) { \
REP(d2, D2) cout << table[d0][d1][d2] << " "; \
cout << "\n"; \
} \
cout << "\n"; \
}
#define UNIFORM_DOUBLE(a, b) \
(((b - a) * (double)rand() / RAND_MAX) + a) // [a, b)
#define UNIFORM_LL(a, b) (ll) UNIFORM_DOUBLE(a, b) // [a, b)
#define IN(v, lo, hi) ((lo) <= (v) && (v) < (hi))
#define DD(v) cout << #v << ": " << v << endl
template <typename T0, typename T1>
std::ostream &operator<<(std::ostream &os, const map<T0, T1> &v) {
for (typename map<T0, T1>::const_iterator p = v.begin(); p != v.end(); p++) {
os << p->first << ": " << p->second << " ";
}
return os;
}
template <typename T0, typename T1>
std::ostream &operator<<(std::ostream &os, const pair<T0, T1> &v) {
os << v.first << ": " << v.second << " ";
return os;
}
template <typename T>
std::ostream &operator<<(std::ostream &os, const vector<T> &v) {
for (int i = 0; i < (int)v.size(); i++) {
os << v[i] << " ";
}
return os;
}
template <typename T>
std::ostream &operator<<(std::ostream &os, const vector<vector<T>> &v) {
for (int i = 0; i < (int)v.size(); i++) {
os << v[i] << endl;
}
return os;
}
template <typename T>
std::ostream &operator<<(std::ostream &os, const set<T> &v) {
vector<T> tmp(v.begin(), v.end());
os << tmp;
return os;
}
template <typename T>
std::ostream &operator<<(std::ostream &os, const deque<T> &v) {
vector<T> tmp(v.begin(), v.end());
os << tmp;
return os;
}
#define MOD 1000000007LL
#define INF (1LL << 60)
struct modll {
static const ll MODVAL;
ll val;
modll() : val(0) {}
modll(ll v) : val(v) { normalize(); }
void normalize() { val = (val + MODVAL) % MODVAL; }
modll operator+(ll v) { return modll(val + v); }
modll &operator+=(ll v) {
val += v;
normalize();
return *this;
}
modll operator-(ll v) { return modll(val - v); }
modll &operator-=(ll v) {
val -= v;
normalize();
return *this;
}
modll operator*(ll v) { return modll(val * v); }
modll &operator*=(ll v) {
val *= v;
normalize();
return *this;
}
modll operator^(ll e) {
modll x(val);
modll v(1);
for (; e; x = x * x, e >>= 1)
if (e & 1)
v = v * x;
return v;
} // pow
modll inv() {
modll x(val);
return x ^ (MODVAL - 2);
} // MODVAL must be prime number when use this!
static modll inv(ll v) { return modll(v).inv(); }
operator ll() { return val; }
};
const ll modll::MODVAL = 1000000007;
std::ostream &operator<<(std::ostream &os, const modll &v) {
os << v.val;
return os;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll N, v;
while (cin >> N) {
VI w(N);
REP(i, N) cin >> w[i];
vector<modll> dp(N);
map<ll, modll> sum;
dp[0] = 1LL;
sum[w[0]] = modll(1LL);
RANGE(i, 1, N) {
dp[i] = dp[i - 1];
// if(w[i]!=w[i-1]) REP(j, i) if(w[j]==w[i]) dp[i]
//+= 0<=j-1 ? dp[j-1] : modll(1LL);
if (w[i] != w[i - 1])
dp[i] += sum[w[i]];
sum[w[i]] += 0 <= i - 1 ? dp[i - 1] : modll(1LL);
}
DD(dp);
cout << dp[N - 1] << endl;
}
return 0;
}
| #include <algorithm>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <vector>
#define _USE_MATH_DEFINES
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
using namespace std;
#define EPS 1e-12
#define ull unsigned long long
#define ll long long
#define VI vector<ll>
#define PII pair<ll, ll>
#define VVI vector<vector<ll>>
#define REP(i, n) for (int i = 0, _n = (n); (i) < (int)_n; ++i)
#define RANGE(i, a, b) for (int i = (int)a, _b = (int)(b); (i) < _b; ++i)
#define FOR(i, c) \
for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define ALLR(c) (c).rbegin(), (c).rend()
#define PB push_back
#define MP(a, b) make_pair(a, b)
#define POPCOUNT __builtin_popcount
#define POPCOUNTLL __builtin_popcountll
#define CLEAR(table, v) memset(table, v, sizeof(table));
#define PRINT1(table, D0) \
REP(d0, D0) cout << table[d0] << " "; \
cout << "\n";
#define PRINT2(table, D0, D1) \
REP(d0, D0) { \
REP(d1, D1) cout << table[d0][d1] << " "; \
cout << "\n"; \
}
#define PRINT3(table, D0, D1, D2) \
REP(d0, D0) { \
REP(d1, D1) { \
REP(d2, D2) cout << table[d0][d1][d2] << " "; \
cout << "\n"; \
} \
cout << "\n"; \
}
#define UNIFORM_DOUBLE(a, b) \
(((b - a) * (double)rand() / RAND_MAX) + a) // [a, b)
#define UNIFORM_LL(a, b) (ll) UNIFORM_DOUBLE(a, b) // [a, b)
#define IN(v, lo, hi) ((lo) <= (v) && (v) < (hi))
#define DD(v) cout << #v << ": " << v << endl
template <typename T0, typename T1>
std::ostream &operator<<(std::ostream &os, const map<T0, T1> &v) {
for (typename map<T0, T1>::const_iterator p = v.begin(); p != v.end(); p++) {
os << p->first << ": " << p->second << " ";
}
return os;
}
template <typename T0, typename T1>
std::ostream &operator<<(std::ostream &os, const pair<T0, T1> &v) {
os << v.first << ": " << v.second << " ";
return os;
}
template <typename T>
std::ostream &operator<<(std::ostream &os, const vector<T> &v) {
for (int i = 0; i < (int)v.size(); i++) {
os << v[i] << " ";
}
return os;
}
template <typename T>
std::ostream &operator<<(std::ostream &os, const vector<vector<T>> &v) {
for (int i = 0; i < (int)v.size(); i++) {
os << v[i] << endl;
}
return os;
}
template <typename T>
std::ostream &operator<<(std::ostream &os, const set<T> &v) {
vector<T> tmp(v.begin(), v.end());
os << tmp;
return os;
}
template <typename T>
std::ostream &operator<<(std::ostream &os, const deque<T> &v) {
vector<T> tmp(v.begin(), v.end());
os << tmp;
return os;
}
#define MOD 1000000007LL
#define INF (1LL << 60)
struct modll {
static const ll MODVAL;
ll val;
modll() : val(0) {}
modll(ll v) : val(v) { normalize(); }
void normalize() { val = (val + MODVAL) % MODVAL; }
modll operator+(ll v) { return modll(val + v); }
modll &operator+=(ll v) {
val += v;
normalize();
return *this;
}
modll operator-(ll v) { return modll(val - v); }
modll &operator-=(ll v) {
val -= v;
normalize();
return *this;
}
modll operator*(ll v) { return modll(val * v); }
modll &operator*=(ll v) {
val *= v;
normalize();
return *this;
}
modll operator^(ll e) {
modll x(val);
modll v(1);
for (; e; x = x * x, e >>= 1)
if (e & 1)
v = v * x;
return v;
} // pow
modll inv() {
modll x(val);
return x ^ (MODVAL - 2);
} // MODVAL must be prime number when use this!
static modll inv(ll v) { return modll(v).inv(); }
operator ll() { return val; }
};
const ll modll::MODVAL = 1000000007;
std::ostream &operator<<(std::ostream &os, const modll &v) {
os << v.val;
return os;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll N, v;
while (cin >> N) {
VI w(N);
REP(i, N) cin >> w[i];
vector<modll> dp(N);
map<ll, modll> sum;
dp[0] = 1LL;
sum[w[0]] = modll(1LL);
RANGE(i, 1, N) {
dp[i] = dp[i - 1];
// if(w[i]!=w[i-1]) REP(j, i) if(w[j]==w[i]) dp[i]
//+= 0<=j-1 ? dp[j-1] : modll(1LL);
if (w[i] != w[i - 1]) {
dp[i] += sum[w[i]];
sum[w[i]] += 0 <= i - 1 ? dp[i - 1] : modll(1LL);
}
}
// DD(dp);
cout << dp[N - 1] << endl;
}
return 0;
}
| [
"call.remove"
] | 907,862 | 907,861 | u655723240 | cpp |
p03096 | #include <algorithm>
#include <bits/stdc++.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
ll ans, n;
cin >> n;
int table[n + 1] = {};
table[0] = -1;
rep(i, n) { cin >> table[i + 1]; }
ll dp[n + 1] = {};
dp[0] = 1;
ll re[200001] = {};
ll temp;
for (int i = 1; i < n + 1; i++) {
if (table[i] != table[i - 1]) {
dp[i] = (re[table[i]] + dp[i - 1]) % 1000000007;
re[table[i]] += dp[i];
} else
dp[i] = dp[i - 1];
}
//配列の中身を見る
/* for (int i = 0; i < n+1; ++i) {
cout << dp[i] << " ";
}cout << endl;
for (int i = 0; i < n+1; ++i) {
cout << re[i] << " ";
}cout << endl; */
cout << dp[n] << endl;
return 0;
}
| #include <algorithm>
#include <bits/stdc++.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
ll ans, n;
cin >> n;
int table[n + 1] = {};
table[0] = -1;
rep(i, n) { cin >> table[i + 1]; }
ll dp[n + 1] = {};
dp[0] = 1;
ll re[200001] = {};
ll temp;
for (int i = 1; i < n + 1; i++) {
if (table[i] != table[i - 1]) {
dp[i] = (re[table[i]] + dp[i - 1]) % 1000000007;
re[table[i]] += dp[i - 1];
} else
dp[i] = dp[i - 1];
}
//配列の中身を見る
/* for (int i = 0; i < n+1; ++i) {
cout << dp[i] << " ";
}cout << endl;
for (int i = 0; i < n+1; ++i) {
cout << re[i] << " ";
}cout << endl; */
cout << dp[n] << endl;
return 0;
}
| [
"assignment.change"
] | 907,871 | 907,872 | u419307948 | cpp |
p03096 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> c(N + 1);
for (int i = 1; i <= N; i++) {
cin >> c.at(i);
}
vector<int> dp(N + 1);
dp.at(0) = 1;
vector<int> colour(N + 1);
colour.at(c.at(1)) = dp.at(0);
for (int i = 1; i <= N; i++) {
if (i == 1) {
dp.at(i) = dp.at(0);
} else {
dp.at(i) = colour.at(c.at(i)) % 1000000007;
}
if (i < N && c.at(i) != c.at(i + 1)) {
colour.at(c.at(i + 1)) = (colour.at(c.at(i + 1)) + dp.at(i)) % 1000000007;
}
}
cout << dp.at(N) << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> c(N + 1);
for (int i = 1; i <= N; i++) {
cin >> c.at(i);
}
vector<unsigned int> dp(N + 1);
dp.at(0) = 1;
vector<unsigned int> colour(200010);
colour.at(c.at(1)) = dp.at(0);
for (int i = 1; i <= N; i++) {
if (i == 1) {
dp.at(i) = dp.at(0);
} else {
dp.at(i) = colour.at(c.at(i)) % 1000000007;
}
if (i < N && c.at(i) != c.at(i + 1)) {
colour.at(c.at(i + 1)) = (colour.at(c.at(i + 1)) + dp.at(i)) % 1000000007;
}
}
cout << dp.at(N) << endl;
} | [
"variable_declaration.type.widen.change",
"identifier.replace.remove",
"literal.replace.add",
"call.arguments.change",
"expression.operation.binary.change",
"expression.operation.binary.remove"
] | 907,892 | 907,890 | u686805923 | cpp |
p03096 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
const int N = 2e5 + 5;
ll dp[N][2], pre[N];
int n, c[N];
int main() {
ios::sync_with_stdio(false);
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> c[i];
}
dp[0][0] = 1;
for (int i = 1; i <= n; i++) {
if (c[i] == c[i - 1]) {
dp[i][0] = dp[i - 1][0];
dp[i][1] = dp[i - 1][1];
} else {
dp[i][0] = (dp[i - 1][0] + dp[i - 1][1]) % mod;
dp[i][1] = pre[c[i]];
}
pre[c[i]] = (pre[c[i]] + dp[i][0]) % mod;
}
cout << (dp[n][1] + dp[n][0]) % mod << endl;
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
const int N = 2e5 + 5;
ll dp[N][2], pre[N];
int n, c[N];
int main() {
ios::sync_with_stdio(false);
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> c[i];
}
dp[0][0] = 1;
for (int i = 1; i <= n; i++) {
if (c[i] == c[i - 1]) {
dp[i][0] = dp[i - 1][0];
dp[i][1] = dp[i - 1][1];
} else {
dp[i][0] = (dp[i - 1][0] + dp[i - 1][1]) % mod;
dp[i][1] = pre[c[i]];
pre[c[i]] = (pre[c[i]] + dp[i][0]) % mod;
}
}
cout << (dp[n][1] + dp[n][0]) % mod << endl;
}
| [] | 907,921 | 907,922 | u777892860 | cpp |
p03096 | // by yjz
#include <bits/stdc++.h>
using namespace std;
#define FF first
#define SS second
#define PB push_back
#define MP make_pair
#define foreach(it, s) \
for (__typeof((s).begin()) it = (s).begin(); it != (s).end(); it++)
#ifndef LOCAL
#define cerr \
if (0) \
cout
#endif
typedef long long ll;
const int mod = 1e9 + 7;
// My i/o stream
struct fastio {
char s[100000];
int it, len;
fastio() { it = len = 0; }
inline char get() {
if (it < len)
return s[it++];
it = 0;
len = fread(s, 1, 100000, stdin);
if (len == 0)
return EOF;
else
return s[it++];
}
bool notend() {
char c = get();
while (c == ' ' || c == '\n')
c = get();
if (it > 0)
it--;
return c != EOF;
}
} _buff;
#define geti(x) x = getnum()
#define getii(x, y) geti(x), geti(y)
#define getiii(x, y, z) getii(x, y), geti(z)
#define puti(x) putnum(x), putchar(' ')
#define putii(x, y) puti(x), puti(y)
#define putiii(x, y, z) putii(x, y), puti(z)
#define putsi(x) putnum(x), putchar('\n')
#define putsii(x, y) puti(x), putsi(y)
#define putsiii(x, y, z) putii(x, y), putsi(z)
inline ll getnum() {
ll r = 0;
bool ng = 0;
char c;
c = _buff.get();
while (c != '-' && (c < '0' || c > '9'))
c = _buff.get();
if (c == '-')
ng = 1, c = _buff.get();
while (c >= '0' && c <= '9')
r = r * 10 + c - '0', c = _buff.get();
return ng ? -r : r;
}
template <class T> inline void putnum(T x) {
if (x < 0)
putchar('-'), x = -x;
register short a[20] = {}, sz = 0;
while (x)
a[sz++] = x % 10, x /= 10;
if (sz == 0)
putchar('0');
for (int i = sz - 1; i >= 0; i--)
putchar('0' + a[i]);
}
inline char getreal() {
char c = _buff.get();
while (c <= 32)
c = _buff.get();
return c;
}
ll qpow(ll x, ll k) {
return k == 0 ? 1
: 1ll * qpow(1ll * x * x % mod, k >> 1) * (k & 1 ? x : 1) % mod;
}
const int maxn = 200111;
int n;
int dp[maxn][2];
int cnt[maxn];
int a[maxn];
int main() {
geti(n);
for (int i = 1; i <= n; i++)
geti(a[i]);
dp[0][0] = 1;
int it = 1;
for (int i = 1; i <= n; i++) {
dp[i][0] = dp[i - 1][0];
while (a[it] != a[i]) {
dp[i][0] = (dp[i][0] + dp[it][1]) % mod;
it++;
}
if (i > 1 && a[i - 1] != a[i])
dp[i][1] = cnt[a[i]];
if (i < n && a[i + 1] != a[i])
cnt[a[i]] = (cnt[a[i]] + dp[i][0]) % mod;
}
int ans = dp[n][0];
while (it < n)
ans = (ans + dp[it++][1]) % mod;
cout << ans << endl;
return 0;
}
| // by yjz
#include <bits/stdc++.h>
using namespace std;
#define FF first
#define SS second
#define PB push_back
#define MP make_pair
#define foreach(it, s) \
for (__typeof((s).begin()) it = (s).begin(); it != (s).end(); it++)
#ifndef LOCAL
#define cerr \
if (0) \
cout
#endif
typedef long long ll;
const int mod = 1e9 + 7;
// My i/o stream
struct fastio {
char s[100000];
int it, len;
fastio() { it = len = 0; }
inline char get() {
if (it < len)
return s[it++];
it = 0;
len = fread(s, 1, 100000, stdin);
if (len == 0)
return EOF;
else
return s[it++];
}
bool notend() {
char c = get();
while (c == ' ' || c == '\n')
c = get();
if (it > 0)
it--;
return c != EOF;
}
} _buff;
#define geti(x) x = getnum()
#define getii(x, y) geti(x), geti(y)
#define getiii(x, y, z) getii(x, y), geti(z)
#define puti(x) putnum(x), putchar(' ')
#define putii(x, y) puti(x), puti(y)
#define putiii(x, y, z) putii(x, y), puti(z)
#define putsi(x) putnum(x), putchar('\n')
#define putsii(x, y) puti(x), putsi(y)
#define putsiii(x, y, z) putii(x, y), putsi(z)
inline ll getnum() {
ll r = 0;
bool ng = 0;
char c;
c = _buff.get();
while (c != '-' && (c < '0' || c > '9'))
c = _buff.get();
if (c == '-')
ng = 1, c = _buff.get();
while (c >= '0' && c <= '9')
r = r * 10 + c - '0', c = _buff.get();
return ng ? -r : r;
}
template <class T> inline void putnum(T x) {
if (x < 0)
putchar('-'), x = -x;
register short a[20] = {}, sz = 0;
while (x)
a[sz++] = x % 10, x /= 10;
if (sz == 0)
putchar('0');
for (int i = sz - 1; i >= 0; i--)
putchar('0' + a[i]);
}
inline char getreal() {
char c = _buff.get();
while (c <= 32)
c = _buff.get();
return c;
}
ll qpow(ll x, ll k) {
return k == 0 ? 1
: 1ll * qpow(1ll * x * x % mod, k >> 1) * (k & 1 ? x : 1) % mod;
}
const int maxn = 200111;
int n;
int dp[maxn][2];
int cnt[maxn];
int a[maxn];
int main() {
geti(n);
for (int i = 1; i <= n; i++)
geti(a[i]);
dp[0][0] = 1;
int it = 1;
for (int i = 1; i <= n; i++) {
dp[i][0] = dp[i - 1][0];
while (a[it] != a[i]) {
dp[i][0] = (dp[i][0] + dp[it][1]) % mod;
it++;
}
if (i > 1 && a[i - 1] != a[i])
dp[i][1] = cnt[a[i]];
if (i < n && a[i + 1] != a[i])
cnt[a[i]] = (cnt[a[i]] + dp[i][0]) % mod;
}
int ans = dp[n][0];
while (it <= n)
ans = (ans + dp[it++][1]) % mod;
cout << ans << endl;
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.loop.condition.change"
] | 907,923 | 907,924 | u563764376 | cpp |
p03096 | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define all(a) begin(a), end(a)
#define FOR(x, val, to) for (int x = (val); x < int((to)); ++x)
#define FORE(x, val, to) for (auto x = (val); x <= (to); ++x)
#define FORR(x, arr) for (auto &x : arr)
#define FORS(x, plus, arr) \
for (auto x = begin(arr) + (plus); x != end(arr); ++x)
#define FORREV(x, plus, arr) \
for (auto x = (arr).rbegin() + (plus); x != (arr).rend(); ++x)
#define REE(s_) \
{ \
cout << s_ << '\n'; \
exit(0); \
}
#define GET(arr) \
for (auto &i : (arr)) \
sc(i)
#define whatis(x) cerr << #x << " is " << (x) << endl;
#define e1 first
#define e2 second
#define INF 0x7f7f7f7f
typedef std::pair<int, int> pi;
typedef std::vector<int> vi;
typedef std::vector<std::string> vs;
typedef int64_t ll;
typedef uint64_t ull;
#define umap unordered_map
#define uset unordered_set
using namespace std;
using namespace __gnu_pbds;
#ifdef _WIN32
#define getchar_unlocked() _getchar_nolock()
#define _CRT_DISABLE_PERFCRIT_LOCKS
#endif
template <class L, class R> ostream &operator<<(ostream &os, map<L, R> P) {
for (auto const &vv : P)
os << "(" << vv.first << "," << vv.second << ")";
return os;
}
template <class T> ostream &operator<<(ostream &os, set<T> V) {
os << "[";
for (auto const &vv : V)
os << vv << ",";
os << "]";
return os;
}
template <class T> ostream &operator<<(ostream &os, vector<T> V) {
os << "[";
for (auto const &vv : V)
os << vv << ",";
os << "]";
return os;
}
template <class L, class R> ostream &operator<<(ostream &os, pair<L, R> P) {
os << "(" << P.first << "," << P.second << ")";
return os;
}
inline int fstoi(const string &str) {
auto it = str.begin();
bool neg = 0;
int num = 0;
if (*it == '-')
neg = 1;
else
num = *it - '0';
++it;
while (it < str.end())
num = num * 10 + (*it++ - '0');
if (neg)
num *= -1;
return num;
}
inline void getch(char &x) {
while (x = getchar_unlocked(), x < 33) {
;
}
}
inline void getstr(string &str) {
str.clear();
char cur;
while (cur = getchar_unlocked(), cur < 33) {
;
}
while (cur > 32) {
str += cur;
cur = getchar_unlocked();
}
}
template <typename T> inline bool sc(T &num) {
bool neg = 0;
int c;
num = 0;
while (c = getchar_unlocked(), c < 33) {
if (c == EOF)
return false;
}
if (c == '-') {
neg = 1;
c = getchar_unlocked();
}
for (; c > 47; c = getchar_unlocked())
num = num * 10 + c - 48;
if (neg)
num *= -1;
return true;
}
template <typename T, typename... Args> inline void sc(T &num, Args &...args) {
bool neg = 0;
int c;
num = 0;
while (c = getchar_unlocked(), c < 33) {
;
}
if (c == '-') {
neg = 1;
c = getchar_unlocked();
}
for (; c > 47; c = getchar_unlocked())
num = num * 10 + c - 48;
if (neg)
num *= -1;
sc(args...);
}
template <typename T>
using ordered_set =
tree<T, null_type, less<T>, rb_tree_tag,
tree_order_statistics_node_update>; // s.find_by_order(),
// s.order_of_key() <- works like
// lower_bound
template <typename T>
using ordered_map =
tree<T, int, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define N 1000001
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
sc(n);
ll scol[n];
memset(scol, 0, n << 3);
vi a(n);
GET(a);
a.erase(unique(all(a)), a.end());
FORR(i, a)-- i;
n = a.size();
ll mod = 1000000007;
ll dp[n];
scol[a[0]] = 1;
FOR(i, 0, n) {
dp[i] = scol[a[i]];
/* whatis(i) */
/* whatis(a[i]) */
/* whatis(dp[i]) */
/* if(i+1 < n){ */
/* if(i){ */
/* scol[a[i]] += dp[i-1]; */
/* scol[a[i]] %= mod; */
/* } */
/* else{ */
/* scol[a[i]]++; */
/* } */
if (i + 1 < n) {
scol[a[i + 1]] += dp[i];
scol[a[i + 1]] %= mod;
}
/* } */
}
ll ans = dp[n - 1];
/* FORR(i,scol){ */
/* /1* ans += max((ll)0,i-1); *1/ */
/* ans %= mod; */
/* } */
cout << ans << '\n';
}
| #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define all(a) begin(a), end(a)
#define FOR(x, val, to) for (int x = (val); x < int((to)); ++x)
#define FORE(x, val, to) for (auto x = (val); x <= (to); ++x)
#define FORR(x, arr) for (auto &x : arr)
#define FORS(x, plus, arr) \
for (auto x = begin(arr) + (plus); x != end(arr); ++x)
#define FORREV(x, plus, arr) \
for (auto x = (arr).rbegin() + (plus); x != (arr).rend(); ++x)
#define REE(s_) \
{ \
cout << s_ << '\n'; \
exit(0); \
}
#define GET(arr) \
for (auto &i : (arr)) \
sc(i)
#define whatis(x) cerr << #x << " is " << (x) << endl;
#define e1 first
#define e2 second
#define INF 0x7f7f7f7f
typedef std::pair<int, int> pi;
typedef std::vector<int> vi;
typedef std::vector<std::string> vs;
typedef int64_t ll;
typedef uint64_t ull;
#define umap unordered_map
#define uset unordered_set
using namespace std;
using namespace __gnu_pbds;
#ifdef _WIN32
#define getchar_unlocked() _getchar_nolock()
#define _CRT_DISABLE_PERFCRIT_LOCKS
#endif
template <class L, class R> ostream &operator<<(ostream &os, map<L, R> P) {
for (auto const &vv : P)
os << "(" << vv.first << "," << vv.second << ")";
return os;
}
template <class T> ostream &operator<<(ostream &os, set<T> V) {
os << "[";
for (auto const &vv : V)
os << vv << ",";
os << "]";
return os;
}
template <class T> ostream &operator<<(ostream &os, vector<T> V) {
os << "[";
for (auto const &vv : V)
os << vv << ",";
os << "]";
return os;
}
template <class L, class R> ostream &operator<<(ostream &os, pair<L, R> P) {
os << "(" << P.first << "," << P.second << ")";
return os;
}
inline int fstoi(const string &str) {
auto it = str.begin();
bool neg = 0;
int num = 0;
if (*it == '-')
neg = 1;
else
num = *it - '0';
++it;
while (it < str.end())
num = num * 10 + (*it++ - '0');
if (neg)
num *= -1;
return num;
}
inline void getch(char &x) {
while (x = getchar_unlocked(), x < 33) {
;
}
}
inline void getstr(string &str) {
str.clear();
char cur;
while (cur = getchar_unlocked(), cur < 33) {
;
}
while (cur > 32) {
str += cur;
cur = getchar_unlocked();
}
}
template <typename T> inline bool sc(T &num) {
bool neg = 0;
int c;
num = 0;
while (c = getchar_unlocked(), c < 33) {
if (c == EOF)
return false;
}
if (c == '-') {
neg = 1;
c = getchar_unlocked();
}
for (; c > 47; c = getchar_unlocked())
num = num * 10 + c - 48;
if (neg)
num *= -1;
return true;
}
template <typename T, typename... Args> inline void sc(T &num, Args &...args) {
bool neg = 0;
int c;
num = 0;
while (c = getchar_unlocked(), c < 33) {
;
}
if (c == '-') {
neg = 1;
c = getchar_unlocked();
}
for (; c > 47; c = getchar_unlocked())
num = num * 10 + c - 48;
if (neg)
num *= -1;
sc(args...);
}
template <typename T>
using ordered_set =
tree<T, null_type, less<T>, rb_tree_tag,
tree_order_statistics_node_update>; // s.find_by_order(),
// s.order_of_key() <- works like
// lower_bound
template <typename T>
using ordered_map =
tree<T, int, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define N 1000001
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
sc(n);
ll scol[300000];
memset(scol, 0, 300000 << 3);
vi a(n);
GET(a);
a.erase(unique(all(a)), a.end());
FORR(i, a)-- i;
n = a.size();
ll mod = 1000000007;
ll dp[n];
scol[a[0]] = 1;
FOR(i, 0, n) {
dp[i] = scol[a[i]];
/* whatis(i) */
/* whatis(a[i]) */
/* whatis(dp[i]) */
/* if(i+1 < n){ */
/* if(i){ */
/* scol[a[i]] += dp[i-1]; */
/* scol[a[i]] %= mod; */
/* } */
/* else{ */
/* scol[a[i]]++; */
/* } */
if (i + 1 < n) {
scol[a[i + 1]] += dp[i];
scol[a[i + 1]] %= mod;
}
/* } */
}
ll ans = dp[n - 1];
/* FORR(i,scol){ */
/* /1* ans += max((ll)0,i-1); *1/ */
/* ans %= mod; */
/* } */
cout << ans << '\n';
}
| [
"identifier.replace.remove",
"literal.replace.add",
"variable_declaration.array_dimensions.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 907,928 | 907,929 | u761407600 | cpp |
p03096 | #include <bits/stdc++.h>
using namespace std;
int main() {
long long md = 1e9 + 7;
int N;
cin >> N;
int bef = -1;
vector<int> C;
for (int i = 0; i < N; i++) {
int c;
cin >> c;
if (c != bef)
C.push_back(c);
bef = c;
}
int Clen = C.size();
vector<long long> dp(Clen, 0);
dp[0]++;
vector<int> check(N + 1, -1);
for (int i = 0; i < Clen; i++) {
if (i > 0)
dp[i] += dp[i - 1];
if (check[C[i]] >= 0) {
dp[i] += dp[check[C[i]]];
}
dp[i] %= md;
check[C[i]] = i;
}
cout << dp[Clen - 1] << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long long md = 1e9 + 7;
int N;
cin >> N;
int bef = -1;
vector<int> C;
for (int i = 0; i < N; i++) {
int c;
cin >> c;
if (c != bef)
C.push_back(c);
bef = c;
}
int Clen = C.size();
vector<long long> dp(Clen, 0);
dp[0]++;
vector<int> check(2 * 100000 + 1, -1);
for (int i = 0; i < Clen; i++) {
if (i > 0)
dp[i] += dp[i - 1];
if (check[C[i]] >= 0) {
dp[i] += dp[check[C[i]]];
}
dp[i] %= md;
check[C[i]] = i;
}
cout << dp[Clen - 1] << endl;
}
| [
"identifier.replace.remove",
"literal.replace.add",
"call.arguments.change",
"expression.operation.binary.change"
] | 907,942 | 907,943 | u636387751 | cpp |
p03096 | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define chmin(a, b) ((a) = min((a), (b)))
#define chmax(a, b) ((a) = max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
const double pi = acos(-1);
const double eps = 1e-10;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, -1, 0, 1};
int dx2[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy2[] = {0, -1, -1, -1, 0, 1, 1, 1};
int main() {
int n;
cin >> n;
vector<int> c(n);
for (int i = 0; i < n; i++)
cin >> c[i];
// dp[i] := i 番目まで操作したときの数列の場合の数
vector<ll> dp(n + 10, 0);
vector<ll> dpsum(200010, 0);
dp[0] = 1;
for (int i = 0; i < n; i++) {
if (0 <= i - 1 && c[i] == c[i - 1])
dp[i + 1] = dpsum[c[i]];
else
dp[i + 1] = dp[i] + dpsum[c[i]];
dpsum[c[i]] += dp[i];
dp[i + 1] %= MOD;
dpsum[c[i]] %= MOD;
}
cout << dp[n] << endl;
} | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define chmin(a, b) ((a) = min((a), (b)))
#define chmax(a, b) ((a) = max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
const double pi = acos(-1);
const double eps = 1e-10;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, -1, 0, 1};
int dx2[] = {1, 1, 0, -1, -1, -1, 0, 1};
int dy2[] = {0, -1, -1, -1, 0, 1, 1, 1};
int main() {
int n;
cin >> n;
vector<int> c(n);
for (int i = 0; i < n; i++)
cin >> c[i];
// dp[i] := i 番目まで操作したときの数列の場合の数
vector<ll> dp(n + 10, 0);
vector<ll> dpsum(200010, 0);
dp[0] = 1;
for (int i = 0; i < n; i++) {
if (0 <= i - 1 && c[i] == c[i - 1]) {
dp[i + 1] = dpsum[c[i]];
} else {
dp[i + 1] = dp[i] + dpsum[c[i]];
dpsum[c[i]] += dp[i];
}
dp[i + 1] %= MOD;
dpsum[c[i]] %= MOD;
}
cout << dp[n] << endl;
}
| [] | 907,946 | 907,947 | u049420296 | cpp |
p03096 | #include <algorithm>
#include <cctype>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, a, b) for (ll i = ll(a); i < ll(b); i++)
#define all(x) (x).begin(), (x).end()
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;
}
typedef long long ll;
using namespace std;
template <class Abel> class BIT {
public:
using F = function<Abel(Abel, Abel)>;
F f;
ll l;
vector<Abel> bit;
Abel m0;
BIT(ll maxidx, F fu, Abel m0) : f(fu), l(maxidx), m0(m0) {
bit.assign(l, m0);
}
void update(ll idx, ll val) {
while (idx <= l) {
bit[idx] = f(bit[idx], val);
idx += idx & -idx;
}
}
ll query(ll idx) {
idx--;
ll res = m0;
while (idx > 0) {
res = f(bit[idx], res);
idx -= idx & -idx;
}
return res;
}
};
ll mod = 1e9 + 7;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll n;
cin >> n;
vector<ll> s(n);
rep(i, n) cin >> s[i];
s.erase(unique(all(s)), s.end());
ll l = s.size();
map<ll, vector<ll>> cidx;
vector<ll> tv;
rep(i, l) {
if (cidx.count(s[i]) == 0) {
cidx[s[i]] = tv;
}
cidx[s[i]].push_back(i);
}
BIT<ll> bt(
l, [](ll a, ll b) { return (a + b) % mod; }, 0);
rep(i, l) {
auto nitr = upper_bound(all(cidx[s[i]]), i);
if (nitr == cidx[s[i]].end())
continue;
bt.update(*nitr, bt.query(i) + 1);
}
cout << (bt.query(l) + 1) % mod << endl;
return 0;
}
| #include <algorithm>
#include <cctype>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, a, b) for (ll i = ll(a); i < ll(b); i++)
#define all(x) (x).begin(), (x).end()
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;
}
typedef long long ll;
using namespace std;
template <class Abel> class BIT {
public:
using F = function<Abel(Abel, Abel)>;
F f;
ll l;
vector<Abel> bit;
Abel m0;
BIT(ll maxidx, F fu, Abel m0) : f(fu), l(maxidx), m0(m0) {
bit.assign(l, m0);
}
void update(ll idx, ll val) {
while (idx <= l) {
bit[idx] = f(bit[idx], val);
idx += idx & -idx;
}
}
ll query(ll idx) {
idx--;
ll res = m0;
while (idx > 0) {
res = f(bit[idx], res);
idx -= idx & -idx;
}
return res;
}
};
ll mod = 1e9 + 7;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll n;
cin >> n;
vector<ll> s(n);
rep(i, n) cin >> s[i];
s.erase(unique(all(s)), s.end());
ll l = s.size();
map<ll, vector<ll>> cidx;
vector<ll> tv;
rep(i, l) {
if (cidx.count(s[i]) == 0) {
cidx[s[i]] = tv;
}
cidx[s[i]].push_back(i);
}
BIT<ll> bt(
l, [](ll a, ll b) { return (a + b) % mod; }, 0);
rep(i, l) {
auto nitr = upper_bound(all(cidx[s[i]]), i);
if (nitr == cidx[s[i]].end())
continue;
bt.update(*nitr, bt.query(i + 1) + 1);
}
cout << (bt.query(l) + 1) % mod << endl;
return 0;
}
| [
"expression.operation.binary.add"
] | 907,951 | 907,952 | u834415466 | cpp |
p03096 | #include <algorithm>
#include <cctype>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, a, b) for (ll i = ll(a); i < ll(b); i++)
#define all(x) (x).begin(), (x).end()
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;
}
typedef long long ll;
using namespace std;
template <class Abel> class BIT {
public:
using F = function<Abel(Abel, Abel)>;
F f;
ll l;
vector<Abel> bit;
Abel m0;
BIT(ll maxidx, F fu, Abel m0) : f(fu), l(maxidx), m0(m0) {
bit.assign(l, m0);
}
void update(ll idx, ll val) {
while (idx <= l) {
bit[idx] = f(bit[idx], val);
idx += idx & -idx;
}
}
ll query(ll idx) {
ll res = m0;
while (idx > 0) {
res = f(bit[idx], res);
idx -= idx & -idx;
}
return res;
}
};
ll mod = 1e9 + 7;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll n;
cin >> n;
vector<ll> s(n);
rep(i, n) cin >> s[i];
s.erase(unique(all(s)), s.end());
ll l = s.size();
map<ll, vector<ll>> cidx;
vector<ll> tv;
rep(i, l) {
if (cidx.count(s[i]) == 0) {
cidx[s[i]] = tv;
}
cidx[s[i]].push_back(i);
}
BIT<ll> bt(
l, [](ll a, ll b) { return (a + b) % mod; }, 0);
rep(i, l) {
auto nitr = upper_bound(all(cidx[s[i]]), i);
if (nitr == cidx[s[i]].end())
continue;
bt.update(*nitr, bt.query(i) + 1);
}
cout << (bt.query(l) + 1) % mod << endl;
return 0;
}
| #include <algorithm>
#include <cctype>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, a, b) for (ll i = ll(a); i < ll(b); i++)
#define all(x) (x).begin(), (x).end()
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;
}
typedef long long ll;
using namespace std;
template <class Abel> class BIT {
public:
using F = function<Abel(Abel, Abel)>;
F f;
ll l;
vector<Abel> bit;
Abel m0;
BIT(ll maxidx, F fu, Abel m0) : f(fu), l(maxidx), m0(m0) {
bit.assign(l, m0);
}
void update(ll idx, ll val) {
while (idx <= l) {
bit[idx] = f(bit[idx], val);
idx += idx & -idx;
}
}
ll query(ll idx) {
idx--;
ll res = m0;
while (idx > 0) {
res = f(bit[idx], res);
idx -= idx & -idx;
}
return res;
}
};
ll mod = 1e9 + 7;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll n;
cin >> n;
vector<ll> s(n);
rep(i, n) cin >> s[i];
s.erase(unique(all(s)), s.end());
ll l = s.size();
map<ll, vector<ll>> cidx;
vector<ll> tv;
rep(i, l) {
if (cidx.count(s[i]) == 0) {
cidx[s[i]] = tv;
}
cidx[s[i]].push_back(i);
}
BIT<ll> bt(
l, [](ll a, ll b) { return (a + b) % mod; }, 0);
rep(i, l) {
auto nitr = upper_bound(all(cidx[s[i]]), i);
if (nitr == cidx[s[i]].end())
continue;
bt.update(*nitr, bt.query(i + 1) + 1);
}
cout << (bt.query(l) + 1) % mod << endl;
return 0;
}
| [
"expression.unary.arithmetic.add"
] | 907,953 | 907,952 | u834415466 | cpp |
p03096 | #include <algorithm>
#include <cctype>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, a, b) for (ll i = ll(a); i < ll(b); i++)
#define all(x) (x).begin(), (x).end()
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;
}
typedef long long ll;
using namespace std;
template <class Abel> class BIT {
public:
using F = function<Abel(Abel, Abel)>;
F f;
ll l;
vector<Abel> bit;
Abel m0;
BIT(ll maxidx, F fu, Abel m0) : f(fu), l(maxidx), m0(m0) {
bit.assign(l, m0);
}
void update(ll idx, ll val) {
while (idx <= l) {
bit[idx] = f(bit[idx], val);
idx += idx & -idx;
}
}
ll query(ll idx) {
ll res = m0;
while (idx > 0) {
res = f(bit[idx], res);
idx -= idx & -idx;
}
return res;
}
};
ll mod = 1e9 + 7;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll n;
cin >> n;
vector<ll> s(n);
rep(i, n) cin >> s[i];
s.erase(unique(all(s)), s.end());
ll l = s.size();
map<ll, vector<ll>> cidx;
vector<ll> tv;
rep(i, l) {
if (cidx.count(s[i]) == 0) {
cidx[s[i]] = tv;
}
cidx[s[i]].push_back(i);
}
BIT<ll> bt(
l, [](ll a, ll b) { return (a + b) % mod; }, 0);
rep(i, l) {
auto nitr = upper_bound(all(cidx[s[i]]), i);
if (nitr == cidx[s[i]].end())
continue;
bt.update(*nitr, bt.query(i) + 1);
}
cout << (bt.query(l) + 1) % mod << endl;
return 0;
}
| #include <algorithm>
#include <cctype>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, a, b) for (ll i = ll(a); i < ll(b); i++)
#define all(x) (x).begin(), (x).end()
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;
}
typedef long long ll;
using namespace std;
template <class Abel> class BIT {
public:
using F = function<Abel(Abel, Abel)>;
F f;
ll l;
vector<Abel> bit;
Abel m0;
BIT(ll maxidx, F fu, Abel m0) : f(fu), l(maxidx), m0(m0) {
bit.assign(l, m0);
}
void update(ll idx, ll val) {
while (idx <= l) {
bit[idx] = f(bit[idx], val);
idx += idx & -idx;
}
}
ll query(ll idx) {
ll res = m0;
while (idx > 0) {
res = f(bit[idx], res);
idx -= idx & -idx;
}
return res;
}
};
ll mod = 1e9 + 7;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll n;
cin >> n;
vector<ll> s(n);
rep(i, n) cin >> s[i];
s.erase(unique(all(s)), s.end());
ll l = s.size();
map<ll, vector<ll>> cidx;
vector<ll> tv;
rep(i, l) {
if (cidx.count(s[i]) == 0) {
cidx[s[i]] = tv;
}
cidx[s[i]].push_back(i);
}
BIT<ll> bt(
l + 1, [](ll a, ll b) { return (a + b) % mod; }, 0);
rep(i, l) {
auto nitr = upper_bound(all(cidx[s[i]]), i);
if (nitr == cidx[s[i]].end())
continue;
bt.update(*nitr, bt.query(i) + 1);
}
cout << (bt.query(l) + 1) % mod << endl;
return 0;
}
| [
"assignment.change"
] | 907,953 | 907,954 | u834415466 | cpp |
p03096 | #include <algorithm>
#include <cctype>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, a, b) for (ll i = ll(a); i < ll(b); i++)
#define all(x) (x).begin(), (x).end()
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;
}
typedef long long ll;
using namespace std;
template <class Abel> class BIT {
public:
using F = function<Abel(Abel, Abel)>;
F f;
ll l;
vector<Abel> bit;
Abel m0;
BIT(ll maxidx, F fu, Abel m0) : f(fu), l(maxidx), m0(m0) {
bit.assign(l, m0);
}
void update(ll idx, ll val) {
while (idx <= l) {
bit[idx] = f(bit[idx], val);
idx += idx & -idx;
}
}
ll query(ll idx) {
ll res = m0;
while (idx > 0) {
res = f(bit[idx], res);
idx -= idx & -idx;
}
return res;
}
};
ll mod = 1e9 + 7;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll n;
cin >> n;
vector<ll> s(n);
rep(i, n) cin >> s[i];
s.erase(unique(all(s)), s.end());
ll l = s.size();
map<ll, vector<ll>> cidx;
vector<ll> tv;
rep(i, l) {
if (cidx.count(s[i]) == 0) {
cidx[s[i]] = tv;
}
cidx[s[i]].push_back(i);
}
BIT<ll> bt(
l, [](ll a, ll b) { return (a + b) % mod; }, 0);
rep(i, l) {
auto nitr = upper_bound(all(cidx[s[i]]), i);
if (nitr == cidx[s[i]].end())
continue;
bt.update(*nitr, bt.query(i) + 1);
}
cout << bt.query(l) + 1 << endl;
return 0;
}
| #include <algorithm>
#include <cctype>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, a, b) for (ll i = ll(a); i < ll(b); i++)
#define all(x) (x).begin(), (x).end()
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;
}
typedef long long ll;
using namespace std;
template <class Abel> class BIT {
public:
using F = function<Abel(Abel, Abel)>;
F f;
ll l;
vector<Abel> bit;
Abel m0;
BIT(ll maxidx, F fu, Abel m0) : f(fu), l(maxidx), m0(m0) {
bit.assign(l, m0);
}
void update(ll idx, ll val) {
while (idx <= l) {
bit[idx] = f(bit[idx], val);
idx += idx & -idx;
}
}
ll query(ll idx) {
ll res = m0;
while (idx > 0) {
res = f(bit[idx], res);
idx -= idx & -idx;
}
return res;
}
};
ll mod = 1e9 + 7;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll n;
cin >> n;
vector<ll> s(n);
rep(i, n) cin >> s[i];
s.erase(unique(all(s)), s.end());
ll l = s.size();
map<ll, vector<ll>> cidx;
vector<ll> tv;
rep(i, l) {
if (cidx.count(s[i]) == 0) {
cidx[s[i]] = tv;
}
cidx[s[i]].push_back(i);
}
BIT<ll> bt(
l + 1, [](ll a, ll b) { return (a + b) % mod; }, 0);
rep(i, l) {
auto nitr = upper_bound(all(cidx[s[i]]), i);
if (nitr == cidx[s[i]].end())
continue;
bt.update(*nitr, bt.query(i) + 1);
}
cout << (bt.query(l) + 1) % mod << endl;
return 0;
}
| [
"assignment.change",
"expression.operation.binary.add"
] | 907,955 | 907,954 | u834415466 | cpp |
p03096 | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
using namespace std;
const long long MOD = (long long)1e9 + 7;
int n, ans, c[200009], pre[200009], nxt[200009], dp[200009];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n;
for (int i = 0; i < n; i++)
cin >> c[i];
for (int i = 1; i <= n; i++)
pre[i] = -1;
for (int i = 0; i < n; i++) {
if (pre[c[i]] != -1)
nxt[pre[c[i]]] = i;
pre[c[i]] = i;
}
dp[0] = 1;
for (int i = 0; i < n; i++) {
dp[i + 1] += dp[i];
dp[i + 1] = dp[i + 1] % MOD;
if (nxt[i] > i + 1) {
dp[nxt[i]] += dp[i];
dp[nxt[i]] = dp[nxt[i]] % MOD;
}
}
cout << dp[n - 1] << "\n";
// system("pause");
return 0;
} | #define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
using namespace std;
const long long MOD = (long long)1e9 + 7;
int n, c[200009], pre[200009], nxt[200009], dp[200009];
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> n;
for (int i = 0; i < n; i++)
cin >> c[i];
for (int i = 1; i <= 200000; i++)
pre[i] = -1;
for (int i = 0; i < n; i++) {
if (pre[c[i]] != -1)
nxt[pre[c[i]]] = i;
pre[c[i]] = i;
}
dp[0] = 1;
for (int i = 0; i < n; i++) {
dp[i + 1] += dp[i];
dp[i + 1] = dp[i + 1] % MOD;
if (nxt[i] > i + 1) {
dp[nxt[i]] += dp[i];
dp[nxt[i]] = dp[nxt[i]] % MOD;
}
}
cout << dp[n - 1] << "\n";
// system("pause");
return 0;
} | [
"variable_declaration.remove",
"identifier.replace.remove",
"literal.replace.add",
"control_flow.loop.for.condition.change",
"expression.operation.binary.change"
] | 907,958 | 907,959 | u398025421 | cpp |
p03096 |
#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <set>
#include <string.h>
#include <vector>
using namespace std;
int main() {
int MOD = 1000000007;
int N;
cin >> N;
vector<int> C(N + 1), right(210000);
vector<long long> dp(N + 1);
for (int i = 0; i <= N; i++) {
right[i] = -1;
}
dp[0] = 1;
cin >> C[0];
right[C[0]] = 0;
for (int i = 1; i < N; i++) {
cin >> C[i];
if (right[C[i]] != -1 && right[C[i]] != i - 1) {
dp[i] = dp[right[C[i]]] + dp[i - 1];
} else {
dp[i] = dp[i - 1];
}
right[C[i]] = i;
dp[i] %= MOD;
}
cout << dp[N - 1] << endl;
}
|
#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <set>
#include <string.h>
#include <vector>
using namespace std;
int main() {
int MOD = 1000000007;
int N;
cin >> N;
vector<int> C(N + 1), right(210000);
vector<long long> dp(N + 1);
for (int i = 0; i <= 210000; i++) {
right[i] = -1;
}
dp[0] = 1;
cin >> C[0];
right[C[0]] = 0;
for (int i = 1; i < N; i++) {
cin >> C[i];
if (right[C[i]] != -1 && right[C[i]] != i - 1) {
dp[i] = dp[right[C[i]]] + dp[i - 1];
} else {
dp[i] = dp[i - 1];
}
right[C[i]] = i;
dp[i] %= MOD;
}
cout << dp[N - 1] << endl;
}
| [
"identifier.replace.remove",
"literal.replace.add",
"control_flow.loop.for.condition.change",
"expression.operation.binary.change"
] | 907,964 | 907,965 | u394033362 | cpp |
p03096 |
#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <set>
#include <string.h>
#include <vector>
using namespace std;
int main() {
int MOD = 1000000007;
int N;
cin >> N;
vector<int> C(N + 1), right(200001);
vector<long long> dp(N + 1);
for (int i = 0; i <= N; i++) {
right[i] = -1;
}
dp[0] = 1;
cin >> C[0];
right[C[0]] = 0;
for (int i = 1; i < N; i++) {
cin >> C[i];
if (right[C[i]] != -1 && right[C[i]] != i - 1) {
dp[i] = dp[right[C[i]]] + dp[i - 1];
} else {
dp[i] = dp[i - 1];
}
right[C[i]] = i;
dp[i] %= MOD;
}
cout << dp[N - 1] << endl;
}
|
#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <set>
#include <string.h>
#include <vector>
using namespace std;
int main() {
int MOD = 1000000007;
int N;
cin >> N;
vector<int> C(N + 1), right(210000);
vector<long long> dp(N + 1);
for (int i = 0; i <= 210000; i++) {
right[i] = -1;
}
dp[0] = 1;
cin >> C[0];
right[C[0]] = 0;
for (int i = 1; i < N; i++) {
cin >> C[i];
if (right[C[i]] != -1 && right[C[i]] != i - 1) {
dp[i] = dp[right[C[i]]] + dp[i - 1];
} else {
dp[i] = dp[i - 1];
}
right[C[i]] = i;
dp[i] %= MOD;
}
cout << dp[N - 1] << endl;
}
| [
"literal.number.change",
"call.arguments.change",
"identifier.replace.remove",
"literal.replace.add",
"control_flow.loop.for.condition.change",
"expression.operation.binary.change"
] | 907,966 | 907,965 | u394033362 | cpp |
p03096 |
#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <set>
#include <string.h>
#include <vector>
using namespace std;
int main() {
int MOD = 1000000007;
int N;
cin >> N;
vector<int> C(N + 1), right(210000);
vector<long long> dp(210000);
for (int i = 0; i <= N; i++) {
right[i] = -1;
}
dp[0] = 1;
cin >> C[0];
right[C[0]] = 0;
for (int i = 1; i < N; i++) {
cin >> C[i];
if (right[C[i]] != -1 && right[C[i]] != i - 1) {
dp[i] = dp[right[C[i]]] + dp[i - 1];
} else {
dp[i] = dp[i - 1];
}
right[C[i]] = i;
dp[i] %= MOD;
}
cout << dp[N - 1] << endl;
}
|
#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <set>
#include <string.h>
#include <vector>
using namespace std;
int main() {
int MOD = 1000000007;
int N;
cin >> N;
vector<int> C(N + 1), right(210000);
vector<long long> dp(N + 1);
for (int i = 0; i <= 210000; i++) {
right[i] = -1;
}
dp[0] = 1;
cin >> C[0];
right[C[0]] = 0;
for (int i = 1; i < N; i++) {
cin >> C[i];
if (right[C[i]] != -1 && right[C[i]] != i - 1) {
dp[i] = dp[right[C[i]]] + dp[i - 1];
} else {
dp[i] = dp[i - 1];
}
right[C[i]] = i;
dp[i] %= MOD;
}
cout << dp[N - 1] << endl;
}
| [
"identifier.replace.add",
"literal.replace.remove",
"call.arguments.change",
"identifier.replace.remove",
"literal.replace.add",
"control_flow.loop.for.condition.change",
"expression.operation.binary.change"
] | 907,967 | 907,965 | u394033362 | cpp |
p03096 |
#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <set>
#include <string.h>
#include <vector>
using namespace std;
int main() {
int MOD = 1000000007;
int N;
cin >> N;
vector<int> C(N + 1), right(N + 1);
vector<long long> dp(N + 1);
for (int i = 0; i <= N; i++) {
right[i] = -1;
}
dp[0] = 1;
cin >> C[0];
right[C[0]] = 0;
for (int i = 1; i < N; i++) {
cin >> C[i];
if (right[C[i]] != -1 && right[C[i]] != i - 1) {
dp[i] = dp[right[C[i]]] + dp[i - 1];
} else {
dp[i] = dp[i - 1];
}
right[C[i]] = i;
dp[i] %= MOD;
}
cout << dp[N - 1] << endl;
}
|
#include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <set>
#include <string.h>
#include <vector>
using namespace std;
int main() {
int MOD = 1000000007;
int N;
cin >> N;
vector<int> C(N + 1), right(210000);
vector<long long> dp(N + 1);
for (int i = 0; i <= 210000; i++) {
right[i] = -1;
}
dp[0] = 1;
cin >> C[0];
right[C[0]] = 0;
for (int i = 1; i < N; i++) {
cin >> C[i];
if (right[C[i]] != -1 && right[C[i]] != i - 1) {
dp[i] = dp[right[C[i]]] + dp[i - 1];
} else {
dp[i] = dp[i - 1];
}
right[C[i]] = i;
dp[i] %= MOD;
}
cout << dp[N - 1] << endl;
}
| [
"identifier.replace.remove",
"literal.replace.add",
"call.arguments.change",
"expression.operation.binary.change",
"expression.operation.binary.remove",
"control_flow.loop.for.condition.change"
] | 907,968 | 907,965 | u394033362 | cpp |
p03096 | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <set>
#include <vector>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define ll long long
#define pii pair<int, int>
#define f first
#define s second
#define y1 Emilia
#define forit(s) for (__typeof(s.begin()) it = s.begin(); it != s.end(); it++)
#define N 400400
#define dracarys \
ios_base ::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
const ll mod = (ll)1e9 + 7;
int n;
ll c[N];
ll dp[N], x[N];
void add(ll &x, ll y) { x = (x + y) % mod; }
int main() {
dracarys cin >> n;
for (int i = 1; i <= n; ++i)
cin >> c[i];
dp[0] = 1;
for (int i = 1; i <= n; ++i) {
add(dp[i], dp[i - 1]);
if (c[i] != c[i - 1])
add(dp[i], x[c[i]]);
add(x[c[i]], dp[i - 1]);
}
cout << dp[n] << "\n";
return 0;
}
| #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <set>
#include <vector>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define ll long long
#define pii pair<int, int>
#define f first
#define s second
#define y1 Emilia
#define forit(s) for (__typeof(s.begin()) it = s.begin(); it != s.end(); it++)
#define N 400400
#define dracarys \
ios_base ::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0);
const ll mod = (ll)1e9 + 7;
int n;
ll c[N];
ll dp[N], x[N];
void add(ll &x, ll y) { x = (x + y) % mod; }
int main() {
dracarys cin >> n;
for (int i = 1; i <= n; ++i)
cin >> c[i];
dp[0] = 1;
for (int i = 1; i <= n; ++i) {
add(dp[i], dp[i - 1]);
if (c[i] != c[i - 1]) {
add(dp[i], x[c[i]]);
add(x[c[i]], dp[i - 1]);
}
}
cout << dp[n] << "\n";
return 0;
}
| [] | 907,993 | 907,994 | u463508647 | cpp |
p03096 | #include <algorithm>
#include <cassert>
#include <cstring>
#include <iostream>
#include <vector>
#define TRACE(x) std::cout << #x << " = " << x << "\n"
#define _ << " _ " <<
template <int32_t P> struct IntModT {
int32_t value;
IntModT() : value(0){};
explicit IntModT(int32_t value) : value(value){};
IntModT &operator+=(const IntModT &other) {
value += other.value;
if (value >= P)
value -= P;
return *this;
}
IntModT &operator-=(const IntModT &other) {
value -= other.value;
if (value < 0)
value += P;
return *this;
}
IntModT &operator*=(const IntModT &other) {
int64_t result =
static_cast<int64_t>(value) * static_cast<int64_t>(other.value);
value = static_cast<int32_t>(result % P);
return *this;
}
};
template <int32_t P>
IntModT<P> operator+(const IntModT<P> &a, const IntModT<P> &b) {
auto res = a;
return res += b;
};
template <int32_t P>
IntModT<P> operator-(const IntModT<P> &a, const IntModT<P> &b) {
auto res = a;
return res -= b;
};
template <int32_t P>
IntModT<P> operator*(const IntModT<P> &a, const IntModT<P> &b) {
auto res = a;
return res *= b;
};
template <int32_t P> bool operator==(const IntModT<P> &a, const IntModT<P> &b) {
return a.value == b.value;
};
template <int32_t P>
std::ostream &operator<<(std::ostream &os, const IntModT<P> &a) {
os << a.value;
return os;
}
using IntMod = IntModT<1000000007>;
int main() {
std::ios_base::sync_with_stdio(false);
int N;
std::cin >> N;
std::vector<int> C(N);
for (int i = 0; i < N; ++i) {
std::cin >> C[i];
}
int M = *max_element(C.begin(), C.end());
std::vector<IntMod> sf(M + 1);
std::vector<IntMod> f(N + 1);
f[0] = IntMod{1};
for (int i = 0; i < N; ++i) {
f[i + 1] = f[i];
if (i > 0 && C[i] != C[i - 1]) {
f[i + 1] += sf[C[i]];
sf[C[i]] += f[i];
}
}
std::cout << f[N] << "\n";
return 0;
}
| #include <algorithm>
#include <cassert>
#include <cstring>
#include <iostream>
#include <vector>
#define TRACE(x) std::cout << #x << " = " << x << "\n"
#define _ << " _ " <<
template <int32_t P> struct IntModT {
int32_t value;
IntModT() : value(0){};
explicit IntModT(int32_t value) : value(value){};
IntModT &operator+=(const IntModT &other) {
value += other.value;
if (value >= P)
value -= P;
return *this;
}
IntModT &operator-=(const IntModT &other) {
value -= other.value;
if (value < 0)
value += P;
return *this;
}
IntModT &operator*=(const IntModT &other) {
int64_t result =
static_cast<int64_t>(value) * static_cast<int64_t>(other.value);
value = static_cast<int32_t>(result % P);
return *this;
}
};
template <int32_t P>
IntModT<P> operator+(const IntModT<P> &a, const IntModT<P> &b) {
auto res = a;
return res += b;
};
template <int32_t P>
IntModT<P> operator-(const IntModT<P> &a, const IntModT<P> &b) {
auto res = a;
return res -= b;
};
template <int32_t P>
IntModT<P> operator*(const IntModT<P> &a, const IntModT<P> &b) {
auto res = a;
return res *= b;
};
template <int32_t P> bool operator==(const IntModT<P> &a, const IntModT<P> &b) {
return a.value == b.value;
};
template <int32_t P>
std::ostream &operator<<(std::ostream &os, const IntModT<P> &a) {
os << a.value;
return os;
}
using IntMod = IntModT<1000000007>;
int main() {
std::ios_base::sync_with_stdio(false);
int N;
std::cin >> N;
std::vector<int> C(N);
for (int i = 0; i < N; ++i) {
std::cin >> C[i];
}
int M = *max_element(C.begin(), C.end());
std::vector<IntMod> sf(M + 1);
std::vector<IntMod> f(N + 1);
f[0] = IntMod{1};
for (int i = 0; i < N; ++i) {
f[i + 1] = f[i];
if (i == 0 || C[i] != C[i - 1]) {
f[i + 1] += sf[C[i]];
sf[C[i]] += f[i];
}
}
std::cout << f[N] << "\n";
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"misc.opposites"
] | 907,995 | 907,996 | u678841350 | cpp |
p03096 | #include <algorithm>
#include <cassert>
#include <cstring>
#include <iostream>
#include <vector>
#define TRACE(x) std::cout << #x << " = " << x << "\n"
#define _ << " _ " <<
template <int32_t P> struct IntModT {
int32_t value;
IntModT() : value(0){};
explicit IntModT(int32_t value) : value(value){};
IntModT &operator+=(const IntModT &other) {
value += other.value;
if (value >= P)
value -= P;
return *this;
}
IntModT &operator-=(const IntModT &other) {
value -= other.value;
if (value < 0)
value += P;
return *this;
}
IntModT &operator*=(const IntModT &other) {
int64_t result =
static_cast<int64_t>(value) * static_cast<int64_t>(other.value);
value = static_cast<int32_t>(result % P);
return *this;
}
};
template <int32_t P>
IntModT<P> operator+(const IntModT<P> &a, const IntModT<P> &b) {
auto res = a;
return res += b;
};
template <int32_t P>
IntModT<P> operator-(const IntModT<P> &a, const IntModT<P> &b) {
auto res = a;
return res -= b;
};
template <int32_t P>
IntModT<P> operator*(const IntModT<P> &a, const IntModT<P> &b) {
auto res = a;
return res *= b;
};
template <int32_t P> bool operator==(const IntModT<P> &a, const IntModT<P> &b) {
return a.value == b.value;
};
template <int32_t P>
std::ostream &operator<<(std::ostream &os, const IntModT<P> &a) {
os << a.value;
return os;
}
using IntMod = IntModT<1000000007>;
int main() {
std::ios_base::sync_with_stdio(false);
int N;
std::cin >> N;
std::vector<int> C(N);
for (int i = 0; i < N; ++i) {
std::cin >> C[i];
}
int M = *max_element(C.begin(), C.end());
std::vector<IntMod> sf(M + 1);
std::vector<IntMod> f(N + 1);
f[0] = IntMod{1};
for (int i = 0; i < N; ++i) {
f[i + 1] = f[i];
if (i > 0 && C[i] != C[i - 1]) {
f[i + 1] += sf[C[i]];
}
sf[C[i]] += f[i];
}
std::cout << f[N] << "\n";
return 0;
}
| #include <algorithm>
#include <cassert>
#include <cstring>
#include <iostream>
#include <vector>
#define TRACE(x) std::cout << #x << " = " << x << "\n"
#define _ << " _ " <<
template <int32_t P> struct IntModT {
int32_t value;
IntModT() : value(0){};
explicit IntModT(int32_t value) : value(value){};
IntModT &operator+=(const IntModT &other) {
value += other.value;
if (value >= P)
value -= P;
return *this;
}
IntModT &operator-=(const IntModT &other) {
value -= other.value;
if (value < 0)
value += P;
return *this;
}
IntModT &operator*=(const IntModT &other) {
int64_t result =
static_cast<int64_t>(value) * static_cast<int64_t>(other.value);
value = static_cast<int32_t>(result % P);
return *this;
}
};
template <int32_t P>
IntModT<P> operator+(const IntModT<P> &a, const IntModT<P> &b) {
auto res = a;
return res += b;
};
template <int32_t P>
IntModT<P> operator-(const IntModT<P> &a, const IntModT<P> &b) {
auto res = a;
return res -= b;
};
template <int32_t P>
IntModT<P> operator*(const IntModT<P> &a, const IntModT<P> &b) {
auto res = a;
return res *= b;
};
template <int32_t P> bool operator==(const IntModT<P> &a, const IntModT<P> &b) {
return a.value == b.value;
};
template <int32_t P>
std::ostream &operator<<(std::ostream &os, const IntModT<P> &a) {
os << a.value;
return os;
}
using IntMod = IntModT<1000000007>;
int main() {
std::ios_base::sync_with_stdio(false);
int N;
std::cin >> N;
std::vector<int> C(N);
for (int i = 0; i < N; ++i) {
std::cin >> C[i];
}
int M = *max_element(C.begin(), C.end());
std::vector<IntMod> sf(M + 1);
std::vector<IntMod> f(N + 1);
f[0] = IntMod{1};
for (int i = 0; i < N; ++i) {
f[i + 1] = f[i];
if (i == 0 || C[i] != C[i - 1]) {
f[i + 1] += sf[C[i]];
sf[C[i]] += f[i];
}
}
std::cout << f[N] << "\n";
return 0;
}
| [
"expression.operator.compare.change",
"control_flow.branch.if.condition.change",
"misc.opposites"
] | 907,997 | 907,996 | u678841350 | cpp |
p03096 | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll n;
cin >> n;
ll b[n];
vector<ll> a;
for (int i = 0; i < n; i++) {
cin >> b[i];
if (i != 0) {
if (b[i] == b[i - 1])
continue;
}
a.push_back(b[i]);
}
vector<bool> bo(200010, false);
vector<ll> t(200010);
ll dp[a.size()];
dp[0] = 1;
bo[a[0]] = true;
t[a[0]] = 0;
for (int i = 1; i < a.size(); i++) {
if (!bo[a[i]]) {
dp[i] = dp[i - 1];
bo[a[i]] = true;
} else {
dp[i] = dp[t[a[i]]] + dp[i - 1];
dp[i] %= 1000000007;
}
t[a[i]] = i;
}
cout << dp[a.size()];
} | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll n;
cin >> n;
ll b[n];
vector<ll> a;
for (int i = 0; i < n; i++) {
cin >> b[i];
if (i != 0) {
if (b[i] == b[i - 1])
continue;
}
a.push_back(b[i]);
}
vector<bool> bo(200010, false);
vector<ll> t(200010);
ll dp[a.size()];
dp[0] = 1;
bo[a[0]] = true;
t[a[0]] = 0;
for (int i = 1; i < a.size(); i++) {
if (!bo[a[i]]) {
dp[i] = dp[i - 1];
bo[a[i]] = true;
} else {
dp[i] = dp[t[a[i]]] + dp[i - 1];
dp[i] %= 1000000007;
}
t[a[i]] = i;
}
cout << dp[a.size() - 1];
} | [
"expression.operation.binary.add"
] | 908,002 | 908,003 | u987476436 | cpp |
p03096 | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int dp[200002][2] = {};
int n;
int c[200002];
int par[200002];
int sosen[200002];
int sison[200002];
int mod(int a) { return a % 1000000007; }
int main() {
cin >> n;
int a;
for (int i = 1; i <= n; i++) {
cin >> a;
if (i - 1)
if (a == c[i - 1]) {
n--;
i--;
continue;
}
c[i] = a;
if (sosen[a] == 0) {
sosen[a] = i;
sison[a] = i;
par[i] = -1;
} else {
par[i] = sison[a];
sison[a] = i;
}
}
dp[1][0] = 1;
for (int i = 2; i <= n; i++) {
for (int k = 0; k < 2; k++) {
dp[i][0] = mod(dp[i][0] += dp[i - 1][k]);
}
if (sosen[a] != i)
dp[i][1] = (dp[par[i] + 1][0]);
}
int ans = 0;
for (int i = 0; i < 2; i++) {
ans = mod(ans += dp[n][i]);
}
cout << ans << endl << clock();
}
| #include <iostream>
#include <string>
#include <vector>
using namespace std;
int dp[200002][2] = {};
int n;
int c[200002];
int par[200002];
int sosen[200002];
int sison[200002];
int mod(int a) { return a % 1000000007; }
int main() {
cin >> n;
int a;
for (int i = 1; i <= n; i++) {
cin >> a;
if (i - 1)
if (a == c[i - 1]) {
n--;
i--;
continue;
}
c[i] = a;
if (sosen[a] == 0) {
sosen[a] = i;
sison[a] = i;
par[i] = -1;
} else {
par[i] = sison[a];
sison[a] = i;
}
}
dp[1][0] = 1;
for (int i = 2; i <= n; i++) {
for (int k = 0; k < 2; k++) {
dp[i][0] = mod(dp[i][0] += dp[i - 1][k]);
}
if (sosen[a] != i)
dp[i][1] = (dp[par[i] + 1][0]);
}
int ans = 0;
for (int i = 0; i < 2; i++) {
ans = mod(ans += dp[n][i]);
}
cout << ans << endl;
}
| [
"expression.operation.binary.remove"
] | 908,011 | 908,012 | u587724217 | cpp |
p03096 | #include <bits/stdc++.h>
using namespace std;
typedef long long unsigned int ll;
// definition {{{ 1
// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x, y) scanf("%d%d", &x, &y)
#define Scd3(x, y, z) scanf("%d%d%d", &x, &y, &z)
#define Scll(x) scanf("%llu", &x)
#define Scll2(x, y) scanf("%llu%llu", &x, &y)
#define Scll3(x, y, z) scanf("%llu%llu%llu", &x, &y, &z)
#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2
// constants {{{ 2
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
// }}} 2
// systems {{{ 2
#define Rep(x, y) for (int x = 0; x < y; x++)
#define Repe(x, y, z) for (int x = z; x < y; x++)
// }}} 2
// output {{{ 2
#define YesNo(a) (a) ? printf("Yes\n") : printf("No\n");
// }}} 2
// }}} 1
int main() {
int N;
Scd(N);
vector<int> c(N);
Rep(i, N) Scd(c[i]);
vector<int> mass(N, 0);
vector<int> trans(233333, 0);
int tmp = 0;
for (int i = N - 1; i >= 0; i--) {
if (tmp == c[i]) {
mass[tmp] = i;
continue;
}
tmp = c[i];
trans[i] = mass[c[i]];
mass[c[i]] = i;
}
ll mod = 1000000007;
vector<ll> dp(N + 1, 0);
dp[0] = 1;
Rep(i, N) {
dp[i + 1] += dp[i];
if (trans[i]) {
dp[trans[i]] += dp[i];
dp[trans[i]] %= mod;
}
dp[i + 1] %= mod;
}
printf("%llu\n", dp[N] % mod);
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long unsigned int ll;
// definition {{{ 1
// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x, y) scanf("%d%d", &x, &y)
#define Scd3(x, y, z) scanf("%d%d%d", &x, &y, &z)
#define Scll(x) scanf("%llu", &x)
#define Scll2(x, y) scanf("%llu%llu", &x, &y)
#define Scll3(x, y, z) scanf("%llu%llu%llu", &x, &y, &z)
#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2
// constants {{{ 2
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
// }}} 2
// systems {{{ 2
#define Rep(x, y) for (int x = 0; x < y; x++)
#define Repe(x, y, z) for (int x = z; x < y; x++)
// }}} 2
// output {{{ 2
#define YesNo(a) (a) ? printf("Yes\n") : printf("No\n");
// }}} 2
// }}} 1
int main() {
int N;
Scd(N);
vector<int> c(N);
Rep(i, N) Scd(c[i]);
vector<int> mass(200002, 0);
vector<int> trans(N, 0);
int tmp = 0;
for (int i = N - 1; i >= 0; i--) {
if (tmp == c[i]) {
mass[tmp] = i;
continue;
}
tmp = c[i];
trans[i] = mass[c[i]];
mass[c[i]] = i;
}
ll mod = 1000000007;
vector<ll> dp(N + 1, 0);
dp[0] = 1;
Rep(i, N) {
dp[i + 1] += dp[i];
if (trans[i]) {
dp[trans[i]] += dp[i];
dp[trans[i]] %= mod;
}
dp[i + 1] %= mod;
}
printf("%llu\n", dp[N] % mod);
return 0;
}
| [
"identifier.replace.remove",
"literal.replace.add",
"call.arguments.change",
"identifier.replace.add",
"literal.replace.remove"
] | 908,017 | 908,018 | u550398291 | cpp |
p03096 | #include <bits/stdc++.h>
using namespace std;
typedef long long unsigned int ll;
// definition {{{ 1
// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x, y) scanf("%d%d", &x, &y)
#define Scd3(x, y, z) scanf("%d%d%d", &x, &y, &z)
#define Scll(x) scanf("%llu", &x)
#define Scll2(x, y) scanf("%llu%llu", &x, &y)
#define Scll3(x, y, z) scanf("%llu%llu%llu", &x, &y, &z)
#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2
// constants {{{ 2
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
// }}} 2
// systems {{{ 2
#define Rep(x, y) for (int x = 0; x < y; x++)
#define Repe(x, y, z) for (int x = z; x < y; x++)
// }}} 2
// output {{{ 2
#define YesNo(a) (a) ? printf("Yes\n") : printf("No\n");
// }}} 2
// }}} 1
int main() {
int N;
Scd(N);
vector<int> c(N);
Rep(i, N) Scd(c[i]);
vector<int> mass(N, 0);
vector<int> trans(N, 0);
int tmp = 0;
for (int i = N - 1; i >= 0; i--) {
if (tmp == c[i]) {
mass[tmp] = i;
continue;
}
tmp = c[i];
trans[i] = mass[c[i]];
mass[c[i]] = i;
}
ll mod = 1000000007;
vector<ll> dp(N + 1, 0);
dp[0] = 1;
Rep(i, N) {
dp[i + 1] += dp[i];
if (trans[i]) {
dp[trans[i]] += dp[i];
dp[trans[i]] %= mod;
}
dp[i + 1] %= mod;
}
printf("%llu\n", dp[N] % mod);
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long unsigned int ll;
// definition {{{ 1
// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x, y) scanf("%d%d", &x, &y)
#define Scd3(x, y, z) scanf("%d%d%d", &x, &y, &z)
#define Scll(x) scanf("%llu", &x)
#define Scll2(x, y) scanf("%llu%llu", &x, &y)
#define Scll3(x, y, z) scanf("%llu%llu%llu", &x, &y, &z)
#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2
// constants {{{ 2
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
// }}} 2
// systems {{{ 2
#define Rep(x, y) for (int x = 0; x < y; x++)
#define Repe(x, y, z) for (int x = z; x < y; x++)
// }}} 2
// output {{{ 2
#define YesNo(a) (a) ? printf("Yes\n") : printf("No\n");
// }}} 2
// }}} 1
int main() {
int N;
Scd(N);
vector<int> c(N);
Rep(i, N) Scd(c[i]);
vector<int> mass(200002, 0);
vector<int> trans(N, 0);
int tmp = 0;
for (int i = N - 1; i >= 0; i--) {
if (tmp == c[i]) {
mass[tmp] = i;
continue;
}
tmp = c[i];
trans[i] = mass[c[i]];
mass[c[i]] = i;
}
ll mod = 1000000007;
vector<ll> dp(N + 1, 0);
dp[0] = 1;
Rep(i, N) {
dp[i + 1] += dp[i];
if (trans[i]) {
dp[trans[i]] += dp[i];
dp[trans[i]] %= mod;
}
dp[i + 1] %= mod;
}
printf("%llu\n", dp[N] % mod);
return 0;
}
| [
"identifier.replace.remove",
"literal.replace.add",
"call.arguments.change"
] | 908,020 | 908,018 | u550398291 | cpp |
p03096 | #include <iostream>
#include <vector>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
int main() {
int n;
cin >> n;
vector<int> arr;
int pre = 0;
for (int i = 0; i < n; i++) {
int c;
cin >> c;
if (pre != c) {
arr.push_back(c);
pre = c;
}
}
n = arr.size();
vector<int> next(n, 0);
vector<int> last(n + 1, -1);
for (int i = 0; i < n; i++) {
if (last[arr[i]] != -1) {
next[last[arr[i]]] = i;
}
last[arr[i]] = i;
}
vector<ll> dp(n);
dp[0] = 1;
for (int i = 0; i < n - 1; i++) {
dp[i + 1] = (dp[i + 1] + dp[i]) % MOD;
if (next[i] > 0)
dp[next[i]] = (dp[next[i]] + dp[i]) % MOD;
}
cout << dp[n - 1] << endl;
}
| #include <iostream>
#include <vector>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
int main() {
int n;
cin >> n;
vector<int> arr;
int pre = 0;
for (int i = 0; i < n; i++) {
int c;
cin >> c;
if (pre != c) {
arr.push_back(c);
pre = c;
}
}
n = arr.size();
vector<int> next(n, 0);
vector<int> last(200001, -1);
for (int i = 0; i < n; i++) {
if (last[arr[i]] != -1) {
next[last[arr[i]]] = i;
}
last[arr[i]] = i;
}
vector<ll> dp(n);
dp[0] = 1;
for (int i = 0; i < n - 1; i++) {
dp[i + 1] = (dp[i + 1] + dp[i]) % MOD;
if (next[i] > 0)
dp[next[i]] = (dp[next[i]] + dp[i]) % MOD;
}
cout << dp[n - 1] << endl;
}
| [
"identifier.replace.remove",
"literal.replace.add",
"call.arguments.change",
"expression.operation.binary.change",
"expression.operation.binary.remove"
] | 908,028 | 908,029 | u508729896 | cpp |
p03096 | // B.
#include <iostream>
#include <sstream>
#include <vector>
using namespace std;
typedef long long LL;
static const LL MOD = 1000000007LL;
int n;
vector<int> c;
LL solve() {
vector<LL> memo = vector<LL>(n + 1, 1);
vector<int> p(n + 1, -1);
LL r = 1;
int last = c[0];
p[c[0]] = 0;
memo[0] = r;
for (int i = 1; i < n; ++i) {
memo[i] = r;
if (c[i] != last) {
if (p[c[i]] >= 0) {
r = (r + memo[p[c[i]]]) % MOD;
}
p[c[i]] = i;
}
memo[i] = r;
last = c[i];
}
return r;
}
int main(int argc, char *argv[]) {
cin >> n;
c = vector<int>(n + 2, -1);
for (int i = 0; i < n; ++i) {
cin >> c[i];
}
LL ans = solve();
cout << ans << endl;
return 0;
}
| // B.
#include <iostream>
#include <sstream>
#include <vector>
using namespace std;
typedef long long LL;
static const LL MOD = 1000000007LL;
int n;
vector<int> c;
LL solve() {
vector<LL> memo = vector<LL>(n + 1, 1);
vector<int> p(200001, -1);
LL r = 1;
int last = c[0];
p[c[0]] = 0;
memo[0] = r;
for (int i = 1; i < n; ++i) {
memo[i] = r;
if (c[i] != last) {
if (p[c[i]] >= 0) {
r = (r + memo[p[c[i]]]) % MOD;
}
p[c[i]] = i;
}
memo[i] = r;
last = c[i];
}
return r;
}
int main(int argc, char *argv[]) {
cin >> n;
c = vector<int>(n + 1, -1);
for (int i = 0; i < n; ++i) {
cin >> c[i];
}
LL ans = solve();
cout << ans << endl;
return 0;
}
| [
"identifier.replace.remove",
"literal.replace.add",
"call.arguments.change",
"expression.operation.binary.change",
"expression.operation.binary.remove",
"literal.number.change",
"assignment.value.change"
] | 908,045 | 908,044 | u586336940 | cpp |
p03096 | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> C(N + 1);
vector<int> latest(N + 1, -1);
vector<int> DP(N + 1, 0);
for (int i = 1; i <= N; i++) {
cin >> C[i];
}
DP[0] = 1;
for (int i = 1; i <= N; i++) {
if (latest[C[i]] >= 0 && latest[C[i]] + 1 != i) {
DP[i] = DP[i - 1] + DP[latest[C[i]]];
} else {
DP[i] = DP[i - 1];
}
DP[i] %= (int)(1e9 + 7);
latest[C[i]] = i;
}
cout << DP[N] << endl;
return 0;
} | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> C(N + 1);
vector<int> latest(200002, -1);
vector<unsigned int> DP(N + 1, 0);
for (int i = 1; i <= N; i++) {
cin >> C[i];
}
DP[0] = 1;
for (int i = 1; i <= N; i++) {
if (latest[C[i]] >= 0 && latest[C[i]] + 1 != i) {
DP[i] = DP[i - 1] + DP[latest[C[i]]];
} else {
DP[i] = DP[i - 1];
}
DP[i] %= (int)(1e9 + 7);
latest[C[i]] = i;
}
cout << DP[N] << endl;
return 0;
} | [
"identifier.replace.remove",
"literal.replace.add",
"call.arguments.change",
"expression.operation.binary.change",
"expression.operation.binary.remove",
"variable_declaration.type.widen.change"
] | 908,054 | 908,055 | u604023588 | cpp |
p03096 | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> C(N);
vector<int> latest(N + 1, -1);
vector<int> DP(N + 1, 0);
for (int i = 1; i <= N; i++) {
cin >> C[i];
}
DP[0] = 1;
for (int i = 1; i <= N; i++) {
if (latest[C[i]] >= 0 && latest[C[i]] + 1 != i) {
DP[i] = DP[i - 1] + DP[latest[C[i]]];
} else {
DP[i] = DP[i - 1];
}
DP[i] %= (int)(1e9 + 7);
latest[C[i]] = i;
}
cout << DP[N] << endl;
return 0;
} | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> C(N + 1);
vector<int> latest(200002, -1);
vector<unsigned int> DP(N + 1, 0);
for (int i = 1; i <= N; i++) {
cin >> C[i];
}
DP[0] = 1;
for (int i = 1; i <= N; i++) {
if (latest[C[i]] >= 0 && latest[C[i]] + 1 != i) {
DP[i] = DP[i - 1] + DP[latest[C[i]]];
} else {
DP[i] = DP[i - 1];
}
DP[i] %= (int)(1e9 + 7);
latest[C[i]] = i;
}
cout << DP[N] << endl;
return 0;
} | [
"identifier.replace.remove",
"literal.replace.add",
"call.arguments.change",
"expression.operation.binary.change",
"expression.operation.binary.remove",
"variable_declaration.type.widen.change"
] | 908,056 | 908,055 | u604023588 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
int N = H * W - H * h - W * w + h * w;
cout << N << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
int N = H * W - H * w - W * h + h * w;
cout << N << endl;
} | [
"identifier.change",
"expression.operation.binary.change"
] | 908,061 | 908,062 | u701589684 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
scanf("%d%d%d%d", &H, &W, &h, &w);
int X = H * W;
int Y = H * h + W * w - h * w;
printf("%d", X - Y);
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
scanf("%d%d%d%d", &H, &W, &h, &w);
int X = H * W;
int Y = H * w + W * h - h * w;
printf("%d", X - Y);
}
| [
"identifier.change",
"expression.operation.binary.change"
] | 908,069 | 908,070 | u290679562 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << H * W - h * w - (H - h) * w << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << H * W - h * W - (H - h) * w << endl;
}
| [
"identifier.change",
"io.output.change"
] | 908,082 | 908,083 | u401900157 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << H * w + W * h - w * h << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << H * W - (H * w + W * h - w * h) << endl;
}
| [
"expression.operation.binary.add"
] | 908,086 | 908,087 | u393754572 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i, a, b) for (ll i = (a), __last_##i = (b); i < __last_##i; i++)
#define RFOR(i, a, b) for (ll i = (b)-1, __last_##i = (a); i >= __last_##i; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) {
REP(i, v.size()) {
if (i)
os << " ";
os << v[i];
}
return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<vector<T>> &v) {
REP(i, v.size()) {
if (i)
os << endl;
os << v[i];
}
return os;
}
int main() {
int h, w;
cin >> h >> w;
int a, b;
cin >> a >> b;
cout << h * w - a * h - w * b + a * b << endl;
}
| #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i, a, b) for (ll i = (a), __last_##i = (b); i < __last_##i; i++)
#define RFOR(i, a, b) for (ll i = (b)-1, __last_##i = (a); i >= __last_##i; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) {
REP(i, v.size()) {
if (i)
os << " ";
os << v[i];
}
return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<vector<T>> &v) {
REP(i, v.size()) {
if (i)
os << endl;
os << v[i];
}
return os;
}
int main() {
int h, w;
cin >> h >> w;
int a, b;
cin >> a >> b;
cout << h * w - a * w - h * b + a * b << endl;
}
| [
"expression.operation.binary.remove"
] | 908,088 | 908,089 | u430974466 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i, a, b) for (ll i = (a), __last_##i = (b); i < __last_##i; i++)
#define RFOR(i, a, b) for (ll i = (b)-1, __last_##i = (a); i >= __last_##i; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) {
REP(i, v.size()) {
if (i)
os << " ";
os << v[i];
}
return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<vector<T>> &v) {
REP(i, v.size()) {
if (i)
os << endl;
os << v[i];
}
return os;
}
int main() {
int h, w;
cin >> h >> w;
int a, b;
cin >> a >> b;
cout << h * w - a * h - w * b + h * w << endl;
}
| #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i, a, b) for (ll i = (a), __last_##i = (b); i < __last_##i; i++)
#define RFOR(i, a, b) for (ll i = (b)-1, __last_##i = (a); i >= __last_##i; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) {
REP(i, v.size()) {
if (i)
os << " ";
os << v[i];
}
return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<vector<T>> &v) {
REP(i, v.size()) {
if (i)
os << endl;
os << v[i];
}
return os;
}
int main() {
int h, w;
cin >> h >> w;
int a, b;
cin >> a >> b;
cout << h * w - a * w - h * b + a * b << endl;
}
| [
"expression.operation.binary.remove",
"identifier.change",
"io.output.change"
] | 908,090 | 908,089 | u430974466 | cpp |
p03101 | #include "bits/stdc++.h"
using namespace std;
const int MOD = 1e9 + 7;
typedef long long lint;
const int INF = 1e7;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repi(i, k, n) for (int i = (k); i < (int)(n); ++i)
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define all(x) (x).begin(), (x).end()
#define pb push_back
int main() {
int a, b, c, d;
cin >> a >> b >> c >> d;
cout << (c - a) * (b - d) << endl;
return 0;
} | #include "bits/stdc++.h"
using namespace std;
const int MOD = 1e9 + 7;
typedef long long lint;
const int INF = 1e7;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repi(i, k, n) for (int i = (k); i < (int)(n); ++i)
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define all(x) (x).begin(), (x).end()
#define pb push_back
int main() {
int a, b, c, d;
cin >> a >> b >> c >> d;
cout << (a - c) * (b - d) << endl;
return 0;
} | [
"expression.operation.binary.remove"
] | 908,099 | 908,100 | u177382472 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W;
cin >> h >> w;
int x = H - W;
int y = h - w;
cout << x * y << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W;
cin >> h >> w;
int x = H - h;
int y = W - w;
cout << x * y << endl;
} | [
"identifier.change",
"expression.operation.binary.change"
] | 908,108 | 908,109 | u041855176 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H, W, h, w;
cout << ((H - h) * (W - w));
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << ((H - h) * (W - w));
} | [] | 908,116 | 908,117 | u383166010 | cpp |
p03101 | #include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int main() {
int a, b, c, d;
char g[6];
cin >> a >> b >> c >> d;
cout << (c - a) * (b - d);
} | #include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int main() {
int a, b, c, d;
char g[6];
cin >> a >> b >> c >> d;
cout << (c - a) * (d - b);
} | [
"expression.operation.binary.remove"
] | 908,122 | 908,123 | u768204022 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int H, W, h, w;
int main() {
cin >> H >> W >> h >> w;
cout << (H * W) - h * W - w * H + 1 << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int H, W, h, w;
int main() {
cin >> H >> W >> h >> w;
cout << (H * W) - h * W - w * H + h * w << endl;
}
| [
"identifier.replace.add",
"literal.replace.remove",
"io.output.change"
] | 908,136 | 908,137 | u943070796 | cpp |
p03101 | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define INF 210000000
#define int long long
int gcd(int a, int b) {
int amari = a % b;
int c = b;
if (amari == 0) {
return b;
} else {
return gcd(b, amari);
}
}
int lcm(int a, int b) { return a * b / gcd(a, b); }
signed main() {
int h, w;
cin >> h, w;
int a, b;
cin >> a >> b;
cout << (h - a) * (w - b);
}
| #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define INF 210000000
#define int long long
int gcd(int a, int b) {
int amari = a % b;
int c = b;
if (amari == 0) {
return b;
} else {
return gcd(b, amari);
}
}
int lcm(int a, int b) { return a * b / gcd(a, b); }
signed main() {
int h, w;
cin >> h >> w;
int a, b;
cin >> a >> b;
cout << (h - a) * (w - b);
}
| [] | 908,138 | 908,139 | u005570675 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << H * W - h * w - w * (H - h) << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << H * W - h * W - w * (H - h) << endl;
return 0;
} | [
"identifier.change",
"io.output.change"
] | 908,140 | 908,141 | u366115355 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w, X, R;
cin >> H >> W >> h >> w;
X = H * W - (h * W) + (H * w) - (h * w);
cout << X;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w, X, R;
cin >> H >> W >> h >> w;
X = H * W - (h * W + H * w - h * w);
cout << X;
} | [] | 908,144 | 908,145 | u677149659 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w, X;
cin >> H >> W >> h >> w;
X == H *W - (h * W + H * w - h * w);
cout << X;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w, X, R;
cin >> H >> W >> h >> w;
X = H * W - (h * W + H * w - h * w);
cout << X;
} | [
"variable_declaration.add",
"expression.operation.compare.replace.remove",
"assignment.replace.add",
"misc.typo"
] | 908,146 | 908,145 | u677149659 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w, X;
cin >> H >> W >> h >> w;
X == H *W - (h * W + H * w - h - w);
cout << X;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w, X, R;
cin >> H >> W >> h >> w;
X = H * W - (h * W + H * w - h * w);
cout << X;
} | [
"variable_declaration.add",
"expression.operation.compare.replace.remove",
"assignment.replace.add",
"misc.typo",
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 908,148 | 908,145 | u677149659 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << h * W + w * H - w * h << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << H * W - (h * W + w * H - w * h) << endl;
} | [
"expression.operation.binary.add"
] | 908,155 | 908,156 | u263715385 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << H * W - (h * W + w * H) << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << H * W - (h * W + w * (H - h)) << endl;
}
| [] | 908,161 | 908,162 | u653482689 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << W * H - h * W - w * H + w + h - 1 << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << W * H - h * W - w * H + w * h << endl;
}
| [
"expression.operator.arithmetic.change",
"io.output.change",
"expression.operation.binary.remove"
] | 908,165 | 908,166 | u469953228 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H, W;
int h, w;
cin >> h, w;
int ans = (W - w) * (H - h);
cout << ans << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
int h, w;
cin >> h >> w;
int ans = (W - w) * (H - h);
cout << ans << endl;
}
| [] | 908,167 | 908,168 | u224951113 | cpp |
p03101 | #include <iostream>
using namespace std;
int main() {
int H, W;
int h, w;
cin >> H >> W;
cin >> h >> w;
cout << H * W - H * w - W * h + h * W << endl;
}
| #include <iostream>
using namespace std;
int main() {
int H, W;
int h, w;
cin >> H >> W;
cin >> h >> w;
cout << H * W - H * w - W * h + h * w << endl;
}
| [
"identifier.change",
"io.output.change"
] | 908,173 | 908,174 | u096717230 | cpp |
p03101 | #include <iostream>
using namespace std;
int main() {
int H, W;
int h, w;
cin >> H >> W;
cin >> h >> w;
cout << H * W - H * w - W * h + h * W << endl;
} | #include <iostream>
using namespace std;
int main() {
int H, W;
int h, w;
cin >> H >> W;
cin >> h >> w;
cout << H * W - H * w - W * h + h * w << endl;
}
| [
"identifier.change",
"io.output.change"
] | 908,175 | 908,174 | u096717230 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
int h, w;
cin >> h >> w;
int ans;
ans = H * W - (h * w) + min(h, w);
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
int h, w;
cin >> h >> w;
int ans;
ans = H * W - (h * W + w * H) + (h * w);
cout << ans << endl;
} | [
"assignment.change",
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 908,178 | 908,179 | u307834890 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
int x, y;
cin >> x >> y;
cout << ((h * w) - (x * w + y * h - max(x, y)));
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin >> h >> w;
int x, y;
cin >> x >> y;
cout << ((h * w) - (x * w + y * h - x * y));
return 0;
} | [
"call.remove",
"io.output.change",
"call.arguments.change"
] | 908,180 | 908,181 | u223389479 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << H * w + h * W - h * w;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << H * W - H * w - h * W + h * w;
} | [
"misc.opposites",
"expression.operator.arithmetic.change",
"io.output.change"
] | 908,185 | 908,186 | u885523920 | cpp |
p03101 | #include <iostream>
using namespace std;
int main(void) {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << (H * W) - (H * w) - (W - h) + (w * h) << endl;
return 0;
} | #include <iostream>
using namespace std;
int main(void) {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << (H * W) - (H * w) - (W * h) + (w * h) << endl;
return 0;
} | [
"expression.operator.arithmetic.change",
"io.output.change"
] | 908,189 | 908,190 | u121243942 | cpp |
p03101 |
#include <algorithm>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define LL long long
#define ALF "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define LLBIG 1999999999999999999LL
#define INTBIG 1111111111
#define MOD 1000000007
#define PI pair<int, int>
#define VI vector<int>
#define VVI vector<vector<int>>
int H, W, h, w;
int main() {
cin >> H >> W >> h >> w;
cout << H * w + h * W - h * w << endl;
return 0;
} |
#include <algorithm>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
#define LL long long
#define ALF "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define LLBIG 1999999999999999999LL
#define INTBIG 1111111111
#define MOD 1000000007
#define PI pair<int, int>
#define VI vector<int>
#define VVI vector<vector<int>>
int H, W, h, w;
int main() {
cin >> H >> W >> h >> w;
cout << H * W - H * w - h * W + h * w << endl;
return 0;
} | [
"misc.opposites",
"expression.operator.arithmetic.change",
"io.output.change"
] | 908,199 | 908,200 | u657512990 | cpp |
p03101 | #include <iostream>
#include <string.h>
using namespace std;
int main() {
int a, b, c, d;
cin >> a >> b >> c >> d;
cout << (a - b) * (b - d) << endl;
return 0;
} | #include <iostream>
#include <string.h>
using namespace std;
int main() {
int a, b, c, d;
cin >> a >> b >> c >> d;
cout << (a - c) * (b - d) << endl;
return 0;
} | [
"identifier.change",
"io.output.change"
] | 908,209 | 908,210 | u127768253 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> w >> h;
cout << H * W - w * H - h * W + w * h << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << H * W - w * H - h * W + w * h << endl;
} | [
"expression.operation.binary.remove"
] | 908,213 | 908,214 | u425834921 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w, ans;
cin >> H >> W >> h >> w;
ans = (H * W) - (h * W) - (w * H);
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w, ans;
cin >> H >> W >> h >> w;
ans = (H * W) - (h * W) - (w * H) + (w * h);
cout << ans << endl;
}
| [
"assignment.change"
] | 908,220 | 908,221 | u871709179 | cpp |
p03101 | #include <iostream>
#include <vector>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
int h, w;
cin >> h >> w;
cout << h * w + h * (W - w) + w * (H - h) << endl;
} | #include <iostream>
#include <vector>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
int h, w;
cin >> h >> w;
cout << W * H - (h * w + h * (W - w) + w * (H - h)) << endl;
}
| [
"expression.operation.binary.add"
] | 908,226 | 908,227 | u166632863 | cpp |
p03101 | #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define ll long long
#define INF 1e+9
#define MOD 1000000007
using namespace std;
int main() {
int H, W;
int h, w;
cin >> H >> W;
cout << (H - h) * (W - w) << endl;
return 0;
}
| #include <algorithm>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define ll long long
#define INF 1e+9
#define MOD 1000000007
using namespace std;
int main() {
int H, W;
int h, w;
cin >> H >> W >> h >> w;
cout << (H - h) * (W - w) << endl;
return 0;
}
| [
"expression.operation.binary.add"
] | 908,232 | 908,233 | u251433890 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
int area = H * W;
int black = h * w + w * (H - w);
cout << area - black << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
int area = H * W;
int black = h * W + w * (H - h);
cout << area - black << endl;
}
| [
"identifier.change",
"expression.operation.binary.change"
] | 908,234 | 908,235 | u372299304 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
int area = H * W;
int black = h * w + w * (h - w);
cout << area - black << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
int area = H * W;
int black = h * W + w * (H - h);
cout << area - black << endl;
}
| [
"identifier.change",
"expression.operation.binary.change"
] | 908,236 | 908,235 | u372299304 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
int h, w;
cin >> h >> w;
int ans;
ans = (H - h) + (W - w);
cout << ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
int h, w;
cin >> h >> w;
int ans;
ans = (H - h) * (W - w);
cout << ans << endl;
} | [
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 908,237 | 908,238 | u832995587 | cpp |
p03101 | #include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
int c, d;
cin >> c >> d;
int mas = a * b;
mas -= (a * c) + (b * d);
mas += (c * d);
cout << mas << endl;
return 0;
} | #include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
int c, d;
cin >> c >> d;
int mas = a * b;
mas -= (a * d) + (b * c);
mas += (c * d);
cout << mas << endl;
return 0;
} | [
"assignment.value.change",
"identifier.change",
"expression.operation.binary.change"
] | 908,248 | 908,249 | u653903116 | cpp |
p03101 |
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i, a, b) for (ll i = (a), __last_##i = (b); i < __last_##i; i++)
#define RFOR(i, a, b) for (ll i = (b)-1, __last_##i = (a); i >= __last_##i; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) {
REP(i, v.size()) {
if (i)
os << " ";
os << v[i];
}
return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<vector<T>> &v) {
REP(i, v.size()) {
if (i)
os << endl;
os << v[i];
}
return os;
}
const ll INF = 1LL << 60;
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;
#define int long long
inline void my_io() {
std::ios::sync_with_stdio(false);
std::cin.tie(0);
cout << fixed << setprecision(10);
}
signed main() {
ll H, W, h, w;
cin >> H >> W >> h >> w;
cout << H * W - (H - h) * (W - w) << endl;
} |
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i, a, b) for (ll i = (a), __last_##i = (b); i < __last_##i; i++)
#define RFOR(i, a, b) for (ll i = (b)-1, __last_##i = (a); i >= __last_##i; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template <typename T> ostream &operator<<(ostream &os, const vector<T> &v) {
REP(i, v.size()) {
if (i)
os << " ";
os << v[i];
}
return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<vector<T>> &v) {
REP(i, v.size()) {
if (i)
os << endl;
os << v[i];
}
return os;
}
const ll INF = 1LL << 60;
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;
#define int long long
inline void my_io() {
std::ios::sync_with_stdio(false);
std::cin.tie(0);
cout << fixed << setprecision(10);
}
signed main() {
ll H, W, h, w;
cin >> H >> W >> h >> w;
cout << (H - h) * (W - w) << endl;
} | [
"expression.operation.binary.remove"
] | 908,290 | 908,291 | u800551451 | cpp |
p03101 | #include <iostream>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
int h, w;
cin >> h >> w;
cout << H * W - (h * H + w * W - h * w) << endl;
return 0;
} | #include <iostream>
#include <math.h>
#include <string>
#include <vector>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
int h, w;
cin >> h >> w;
cout << H * W - (h * W + w * H - h * w) << endl;
return 0;
} | [
"identifier.change",
"io.output.change"
] | 908,292 | 908,293 | u899108527 | cpp |
p03101 | #include <algorithm>
#include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
typedef long long unsigned int ll;
int main() {
int a, b, c, d;
cin >> a;
cin >> b;
cin >> c;
cin >> d;
cout << a * b - c * a - b * d + c * d << endl;
return 0;
}
| #include <algorithm>
#include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
typedef long long unsigned int ll;
int main() {
int a, b, c, d;
cin >> a;
cin >> b;
cin >> c;
cin >> d;
cout << a * b - d * a - b * c + c * d << endl;
return 0;
}
| [
"identifier.change",
"io.output.change"
] | 908,294 | 908,295 | u032337012 | cpp |
p03101 | #include <iostream>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
int h, w;
cin >> h >> w;
int a;
a = H * W - (h * W + w * H) - h * w;
cout << a << endl;
}
| #include <iostream>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
int h, w;
cin >> h >> w;
int a;
a = H * W - (h * W + w * H) + h * w;
cout << a << endl;
}
| [
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 908,303 | 908,304 | u464725395 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << H * W - H * w - h * w + h * w << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << H * W - H * w - h * W + h * w << endl;
} | [
"identifier.change",
"io.output.change"
] | 908,305 | 908,306 | u069652661 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define UM unordered_map
#define ALL(a) (a).begin(), (a).end()
typedef vector<ll> vi;
typedef vector<vector<ll>> vvi;
typedef pair<ll, ll> pii;
const long long INF = 1LL << 58;
struct Edge {
ll s, t, d;
};
typedef vector<vector<Edge>> Graph;
typedef vector<pii> vpii;
template <class string> inline bool chmax(string &a, string b) {
if (a == "-") {
a = b;
return true;
}
if (a.size() < b.size()) {
a = b;
return true;
} else if (a.size() == b.size() and a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
int main() {
int H, W;
cin >> H >> W;
int ans = H * W;
int h, w;
cin >> h >> w;
ans = ans - h * W - w * H + max(h, w);
cout << ans << endl;
// system("pause");
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define UM unordered_map
#define ALL(a) (a).begin(), (a).end()
typedef vector<ll> vi;
typedef vector<vector<ll>> vvi;
typedef pair<ll, ll> pii;
const long long INF = 1LL << 58;
struct Edge {
ll s, t, d;
};
typedef vector<vector<Edge>> Graph;
typedef vector<pii> vpii;
template <class string> inline bool chmax(string &a, string b) {
if (a == "-") {
a = b;
return true;
}
if (a.size() < b.size()) {
a = b;
return true;
} else if (a.size() == b.size() and a < b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
int main() {
int H, W;
cin >> H >> W;
int ans = H * W;
int h, w;
cin >> h >> w;
ans = ans - h * W - w * H + h * w;
cout << ans << endl;
// system("pause");
}
| [
"call.remove",
"assignment.value.change",
"call.arguments.change",
"expression.operation.binary.change"
] | 908,315 | 908,316 | u913836622 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
#define lp(i, n) for (int i = 0; i < n; ++i)
#define all(v) v.begin(), v.end()
#define sz(v) (int(v.size()))
typedef unsigned long long ul;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<int>> vii;
typedef pair<int, int> pii;
typedef vector<pii> vp;
typedef pair<int, pii> piii;
int OO = 2e9;
const double eps = 1e-9;
const int N = 200005;
int mx = -1e9, mn = 1e9;
double arr[N], arr2[N];
double dd[N];
int main() {
int a, b, c, d;
cin >> a >> b >> c >> d;
cout << (a - c) * (b - c) << endl;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
#define lp(i, n) for (int i = 0; i < n; ++i)
#define all(v) v.begin(), v.end()
#define sz(v) (int(v.size()))
typedef unsigned long long ul;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<int>> vii;
typedef pair<int, int> pii;
typedef vector<pii> vp;
typedef pair<int, pii> piii;
int OO = 2e9;
const double eps = 1e-9;
const int N = 200005;
int mx = -1e9, mn = 1e9;
double arr[N], arr2[N];
double dd[N];
int main() {
int a, b, c, d;
cin >> a >> b >> c >> d;
cout << (a - c) * (b - d) << endl;
return 0;
}
| [
"identifier.change",
"io.output.change"
] | 908,320 | 908,321 | u026389788 | cpp |
p03101 | #include <cstdio>
#include <iostream>
using namespace std;
int main() {
int H, W, w, h;
cin >> H >> W;
cin >> h >> w;
int remaining = H * W - (h * W - H * w) + h * w;
cout << remaining;
} | #include <cstdio>
#include <iostream>
using namespace std;
int main() {
int H, W, w, h;
cin >> H >> W;
cin >> h >> w;
int remaining = H * W - (h * W + H * w) + h * w;
cout << remaining;
} | [
"misc.opposites",
"expression.operator.arithmetic.change",
"expression.operation.binary.change"
] | 908,322 | 908,323 | u387480576 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int W, H, w, h;
cin >> H >> W >> h >> w;
cout << (H - W) * (h - w) << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int W, H, w, h;
cin >> H >> W >> h >> w;
cout << (H - h) * (W - w) << endl;
}
| [
"identifier.change",
"io.output.change"
] | 908,324 | 908,325 | u466983830 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int h, h1, w, w1;
scanf("%d %d %d %d", &h, &h1, &w, &w1);
printf("%d", (h - h1) * (w - w1));
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int h, h1, w, w1;
scanf("%d %d %d %d", &h, &h1, &w, &w1);
printf("%d", (h - w) * (h1 - w1));
}
| [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 908,334 | 908,335 | u897518464 | cpp |
p03101 | #include <iostream>
using namespace std;
int H, W, h, w;
int main() {
cin >> H >> W >> h >> w;
int total = H * W;
int a = total - h * W;
int ans = a - w;
cout << ans << endl;
return 0;
}
| #include <iostream>
using namespace std;
int H, W, h, w;
int main() {
cin >> H >> W >> h >> w;
int total = H * W;
int a = total - h * W;
int ans = a - (H - h) * w;
cout << ans << endl;
return 0;
}
| [
"assignment.change"
] | 908,342 | 908,343 | u926089862 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, a, b;
scanf("%d %d", &n, &m);
scanf("%d %d", &a, &b);
printf("%d", (n - a) * (n - b));
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, m, a, b;
scanf("%d %d", &n, &m);
scanf("%d %d", &a, &b);
printf("%d", (n - a) * (m - b));
return 0;
} | [
"identifier.change",
"call.arguments.change",
"expression.operation.binary.change",
"io.output.change"
] | 908,349 | 908,350 | u963399321 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> W >> H >> h >> w;
cout << (H - h) * (W - w) << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << (H - h) * (W - w) << endl;
}
| [
"expression.operation.binary.remove"
] | 908,358 | 908,359 | u464957469 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, d;
scanf("%d %d %d", &a, &b, &c, &d);
printf("%d", (a - c) * (b - d));
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, d;
scanf("%d %d %d %d", &a, &b, &c, &d);
printf("%d", (a - c) * (b - d));
return 0;
} | [
"literal.string.change",
"call.arguments.change"
] | 908,363 | 908,364 | u858741867 | cpp |
p03101 | #include <iostream>
using namespace std;
int main() {
int a, b, c, d, e;
cin >> a >> b >> c >> d;
e = a * b - (c * b + d * a) - c * d;
cout << e << endl;
} | #include <iostream>
using namespace std;
int main() {
int a, b, c, d, e;
cin >> a >> b >> c >> d;
e = a * b - (c * b + d * a) + c * d;
cout << e << endl;
} | [
"misc.opposites",
"expression.operator.arithmetic.change",
"assignment.value.change",
"expression.operation.binary.change"
] | 908,365 | 908,366 | u133765395 | cpp |
p03101 |
#include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long long LL;
typedef unsigned int UI;
#define rSort(a) sort(a.rbegin(), a.rend())
#define Sort(a) sort(a.begin(), a.end())
#define Reverse(a) reverse(a.begin(), a.end())
#define Sum(a) accumulate(a.begin(), a.end(), 0)
#define REP(i, n) for (UI i = 0; i < n; i++)
#define REPR(i, n) for (UI i = n; i >= 0; i--)
#define FOR(i, m, n) for (UI i = m; i < n; i++)
#define pb(i) push_back(i)
#define MOD (LL)1e9 + 7;
#define INF (LL)1 << 62;
#define INF_I (int)100000009;
int main(int argc, const char *argv[]) {
cin.tie(0);
ios::sync_with_stdio(false);
int H, W;
int h, w;
cin >> H >> W;
cin >> h >> w;
cout << W * h + H * w - h * w << endl;
return 0;
} | #include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long long LL;
typedef unsigned int UI;
#define rSort(a) sort(a.rbegin(), a.rend())
#define Sort(a) sort(a.begin(), a.end())
#define Reverse(a) reverse(a.begin(), a.end())
#define Sum(a) accumulate(a.begin(), a.end(), 0)
#define REP(i, n) for (UI i = 0; i < n; i++)
#define REPR(i, n) for (UI i = n; i >= 0; i--)
#define FOR(i, m, n) for (UI i = m; i < n; i++)
#define pb(i) push_back(i)
#define MOD (LL)1e9 + 7;
#define INF (LL)1 << 62;
#define INF_I (int)100000009;
int main(int argc, const char *argv[]) {
cin.tie(0);
ios::sync_with_stdio(false);
int H, W;
int h, w;
cin >> H >> W;
cin >> h >> w;
cout << H * W - (W * h + H * w - h * w) << endl;
return 0;
} | [
"expression.operation.binary.add"
] | 908,369 | 908,370 | u335104842 | cpp |
p03101 | #include <iostream>
using namespace std;
int main() {
int H, W;
int h, w;
cin >> H >> W >> h >> w;
cout << H * W - h * W - w * H + h * W << endl;
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int H, W;
int h, w;
cin >> H >> W >> h >> w;
cout << H * W - h * W - w * H + h * w << endl;
return 0;
}
| [
"identifier.change",
"io.output.change"
] | 908,371 | 908,372 | u033620890 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << h * W + H * w - h * w << '\n';
} | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << H * W - (h * W + H * w - h * w) << '\n';
} | [
"expression.operation.binary.add"
] | 908,378 | 908,379 | u496254754 | cpp |
p03101 | #include <iostream>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
int h, w;
cin >> h >> w;
int sum = H * W;
int minus = h * W + w * H + h * w;
cout << sum - minus;
return 0;
} | #include <iostream>
using namespace std;
int main() {
int H, W;
cin >> H >> W;
int h, w;
cin >> h >> w;
int sum = H * W;
int minus = h * W + w * H - h * w;
cout << sum - minus;
return 0;
} | [
"misc.opposites",
"expression.operator.arithmetic.change",
"expression.operation.binary.change"
] | 908,387 | 908,388 | u196746947 | cpp |
p03101 | /*
author : s@if
*/
#include <bits/stdc++.h>
using namespace std;
#define NIL -1
#define fi first
#define sec second
#define MAX INT_MAX
#define INF 99999999
#define ll long long
#define PI acos(-1.0)
#define MOD 1000000007
#define PLL pair<ll, ll>
#define PII pair<int, int>
#define triplell pair<pair<ll, ll>, ll>
#define triple pair<pair<int, int>, int>
#define For(i, n) for (int i = 0; i < (int)n; i++)
#define Forn(i, a, b) for (int i = (int)a; i <= (int)b; i++)
#define forba(i, a, b) for (int i = (int)b; i >= (int)a; i--)
int dx[] = {+1, -1, +0, +0};
int dy[] = {+0, +0, +1, -1};
int fx[] = {+0, +0, +1, -1, -1, +1, -1, +1};
int fy[] = {-1, +1, +0, +0, +1, +1, -1, -1};
int hr[] = {-2, -2, -1, +1, +2, +2, -1, +1};
int hc[] = {+1, -1, +2, +2, -1, +1, -2, -2};
const int MAXN = (int)1e5 + 9;
const int N = 100000;
int main() {
/* freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0); */
int i, j, k, l, m, n, p, q, r, tc, t;
int h, w, h1, w1;
cin >> h >> w;
cin >> h1 >> w1;
h -= h1;
w -= w1;
cout << h * w << endl;
main();
return 0;
} | /*
author : s@if
*/
#include <bits/stdc++.h>
using namespace std;
#define NIL -1
#define fi first
#define sec second
#define MAX INT_MAX
#define INF 99999999
#define ll long long
#define PI acos(-1.0)
#define MOD 1000000007
#define PLL pair<ll, ll>
#define PII pair<int, int>
#define triplell pair<pair<ll, ll>, ll>
#define triple pair<pair<int, int>, int>
#define For(i, n) for (int i = 0; i < (int)n; i++)
#define Forn(i, a, b) for (int i = (int)a; i <= (int)b; i++)
#define forba(i, a, b) for (int i = (int)b; i >= (int)a; i--)
int dx[] = {+1, -1, +0, +0};
int dy[] = {+0, +0, +1, -1};
int fx[] = {+0, +0, +1, -1, -1, +1, -1, +1};
int fy[] = {-1, +1, +0, +0, +1, +1, -1, -1};
int hr[] = {-2, -2, -1, +1, +2, +2, -1, +1};
int hc[] = {+1, -1, +2, +2, -1, +1, -2, -2};
const int MAXN = (int)1e5 + 9;
const int N = 100000;
int main() {
/* freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0); */
int i, j, k, l, m, n, p, q, r, tc, t;
int h, w, h1, w1;
cin >> h >> w;
cin >> h1 >> w1;
h -= h1;
w -= w1;
cout << h * w << endl;
// main();
return 0;
} | [
"call.remove"
] | 908,395 | 908,396 | u253790619 | cpp |
p03101 | #include <iostream>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W;
cin >> h >> W;
cout << (H - h) * (W - w) << endl;
} | #include <iostream>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W;
cin >> h >> w;
cout << (H - h) * (W - w) << endl;
} | [
"identifier.change",
"expression.operation.binary.change"
] | 908,399 | 908,400 | u113589326 | cpp |
p03101 | #include <stdio.h>
int main() {
int a, b, c, d;
scanf("%d %d", &a, &b);
scanf("%d,%d", &c, &d);
printf("%d\n", (a - c) * (b - d));
return 0;
} | #include <stdio.h>
int main() {
int a, b, c, d;
scanf("%d %d", &a, &b);
scanf("%d %d", &c, &d);
printf("%d\n", (a - c) * (b - d));
return 0;
} | [
"literal.string.change",
"call.arguments.change"
] | 908,403 | 908,404 | u047702244 | cpp |
p03101 | #include <iostream>
int main() {
int H, W, h, w;
std::cin >> H >> W >> h >> w;
std::cout << H * W - h * W - H * w + h + w;
return 0;
} | #include <iostream>
int main() {
int H, W, h, w;
std::cin >> H >> W >> h >> w;
std::cout << H * W - h * W - H * w + h * w << std::endl;
return 0;
} | [
"expression.operator.arithmetic.change",
"expression.operation.binary.change"
] | 908,418 | 908,419 | u975701785 | cpp |
p03101 | #include <iostream>
int main() {
int H, W, h, w;
std::cin >> H >> W >> h >> w;
std::cout << H * W - h * W - H * w + h + w << std::endl;
return 0;
} | #include <iostream>
int main() {
int H, W, h, w;
std::cin >> H >> W >> h >> w;
std::cout << H * W - h * W - H * w + h * w << std::endl;
return 0;
} | [
"expression.operator.arithmetic.change",
"expression.operation.binary.change"
] | 908,420 | 908,419 | u975701785 | cpp |
p03101 | #include <iostream>
using namespace std;
int main() {
int H, W;
int h, w;
cin >> H >> W;
cin >> h >> w;
cout << (h * W) + ((H - h) * w);
return 0;
} | #include <iostream>
using namespace std;
int main() {
int H, W;
int h, w;
cin >> H >> W;
cin >> h >> w;
cout << H * W - (h * W + (H - h) * w);
return 0;
} | [
"expression.operation.binary.add"
] | 908,443 | 908,444 | u393081853 | cpp |
p03101 | #include <iostream>
using namespace std;
int main() {
int H, W, h, w;
cin >> H;
cin >> W;
cin >> h;
cin >> w;
return (H - h) * (W - w);
} | #include <iostream>
using namespace std;
int main() {
int H, W, h, w;
cin >> H;
cin >> W;
cin >> h;
cin >> w;
cout << (H - h) * (W - w);
return 0;
}
| [
"io.output.change",
"control_flow.return.add",
"control_flow.return.0.add"
] | 908,448 | 908,449 | u362403871 | cpp |
p03101 | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H, W, h, w;
cout << (H - h) * (W - w) << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
// cout << H << "," << W << "," << h << "," << w <<endl;
cout << (H - h) * (W - w) << endl;
} | [] | 908,454 | 908,455 | u596562693 | cpp |
p03101 | #include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
map<int, int> mp;
map<int, int> mm;
#define ll long long
#define ld long double
#define PI 3.14159265358979l
int main() {
int h, w, H, W;
cin >> H >> W >> h >> w;
int ans = H * W - h * W - H * W + h * w;
cout << ans << endl;
} | #include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
map<int, int> mp;
map<int, int> mm;
#define ll long long
#define ld long double
#define PI 3.14159265358979l
int main() {
int h, w, H, W;
cin >> H >> W >> h >> w;
int ans = H * W - h * W - H * w + h * w;
cout << ans << endl;
} | [
"identifier.change",
"expression.operation.binary.change"
] | 908,456 | 908,457 | u154672915 | cpp |
p03101 | #include <iostream>
#include <string>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << H * W - h * H - w * W + h * w;
} | #include <iostream>
#include <string>
using namespace std;
int main() {
int H, W, h, w;
cin >> H >> W >> h >> w;
cout << H * W - w * H - h * W + h * w;
} | [
"identifier.change",
"io.output.change"
] | 908,458 | 908,459 | u644568158 | cpp |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.