Datasets:

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
p03110
#include <bits/stdc++.h> using namespace std; #define RATE 380000.0 int main(void) { int N, sum = 0; cin >> N; double x[N]; string u[N]; for (int i = 0; i << N; i++) { cin >> x[i] >> u[i]; if (u[i] == "JPY") sum += x[i]; else if (u[i] == "BTC") sum += x[i] * RATE; } cout << sum << endl; return 0; }
#include <bits/stdc++.h> using namespace std; #define RATE 380000.0 int main(void) { int N; double sum = 0; cin >> N; double x[N]; string u[N]; for (int i = 0; i < N; i++) { cin >> x[i] >> u[i]; if (u[i] == "JPY") sum += x[i]; else if (u[i] == "BTC") sum += x[i] * RATE; } cout << sum << endl; return 0; }
[ "misc.typo", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
922,896
922,895
u341488930
cpp
p03110
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <string> #include <unordered_map> #include <utility> #include <vector> using namespace std; #define REP(i, n, m) for (long long int i = (n); i < (m); i++) #define REV(v) for (auto itr = v.rbegin(); itr != v.rend(); itr++) #define ll long long #define ALL(a) (a).begin(), (a).end() #define SORT(v) sort(ALL(v)); #define LAST(v) v[v.size() - 1] #define ZERO(a) memset(a, 0, sizeof(a)) #define MINUS(a) memset(a, -1, sizeof(a)) #define EACH(i, c) \ for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define EXIST(s, e) ((s).find(e) != (s).end()) #define pi pair<int, int> #define MP make_pair #define PB push_back #define IIN(a) \ int a; \ cin >> a; #define LIN(a) \ ll a; \ cin >> a; #define SIN(a) \ string a; \ cin >> a; #define VL(v, n) vector<ll> v(n); #define Read_VL(v, n) \ vector<ll> v(n); \ REP(i, 0, n) cin >> v[i]; #define sumV(v, n) \ Vl(acm, n) REP(i, 0, n) acm[i] = v[i] + (i == 0 ? 0 : acm[i - 1]); #define EPS (1e-10) #define INF 1000000000000LL void YN(bool b) { cout << (b ? "YES" : "NO") << "\n"; } void Yn(bool b) { cout << (b ? "Yes" : "No") << "\n"; } void yn(bool b) { cout << (b ? "yes" : "no") << "\n"; } template <class S> S max(vector<S> &a) { return *max_element(all(a)); } template <class S> S min(vector<S> &a) { return *min_element(all(a)); } template <class T> void puta(T &&t) { cout << t << "\n"; } template <class H, class... T> void puta(H &&h, T &&...t) { cout << h << ' '; puta(t...); } template <class T = ll> struct Graph { int n; vector<vector<tuple<ll, T>>> edge; Graph(int N = 1) : n(N) { edge.resize(n); } void add(ll f, ll t, T c, bool d = false) { edge[f].emplace_back(t, c); if (!d) edge[t].emplace_back(f, c); } void view() { REP(i, 0, n) for (auto &e : edge[i]) puta(i, "=>", get<0>(e), ", cost :", get<1>(e)); } }; ll StoLL(string s) { ll num = 0; REP(i, 0, s.size()) { num = num * 10 + (s[i] ^ 48); } return num; } ll CtoLL(char c) { if ('a' <= c && c <= 'z') { return (ll)(c ^ 96); } else if ('A' <= c && c <= 'Z') { return (ll)(c ^ 64); } return 0; } int MOD = 1000000007; int dx[4] = {0, 0, -1, 1}; int dy[4] = {1, -1, 0, 0}; // I ASCII code: '0' = 48; 'A' = 65; 'a' = 97 signed main() { ios_base::sync_with_stdio(0); cin.tie(0); LIN(n) double ans = 0; REP(i, 0, n) { double a; cin >> a; SIN(s) if (s == "JPY") { ans += a; } else { ans += a * 380000.0; } puta(ans); } puta(ans); return 0; }
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <stdio.h> #include <string> #include <unordered_map> #include <utility> #include <vector> using namespace std; #define REP(i, n, m) for (long long int i = (n); i < (m); i++) #define REV(v) for (auto itr = v.rbegin(); itr != v.rend(); itr++) #define ll long long #define ALL(a) (a).begin(), (a).end() #define SORT(v) sort(ALL(v)); #define LAST(v) v[v.size() - 1] #define ZERO(a) memset(a, 0, sizeof(a)) #define MINUS(a) memset(a, -1, sizeof(a)) #define EACH(i, c) \ for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) #define EXIST(s, e) ((s).find(e) != (s).end()) #define pi pair<int, int> #define MP make_pair #define PB push_back #define IIN(a) \ int a; \ cin >> a; #define LIN(a) \ ll a; \ cin >> a; #define SIN(a) \ string a; \ cin >> a; #define VL(v, n) vector<ll> v(n); #define Read_VL(v, n) \ vector<ll> v(n); \ REP(i, 0, n) cin >> v[i]; #define sumV(v, n) \ Vl(acm, n) REP(i, 0, n) acm[i] = v[i] + (i == 0 ? 0 : acm[i - 1]); #define EPS (1e-10) #define INF 1000000000000LL void YN(bool b) { cout << (b ? "YES" : "NO") << "\n"; } void Yn(bool b) { cout << (b ? "Yes" : "No") << "\n"; } void yn(bool b) { cout << (b ? "yes" : "no") << "\n"; } template <class S> S max(vector<S> &a) { return *max_element(all(a)); } template <class S> S min(vector<S> &a) { return *min_element(all(a)); } template <class T> void puta(T &&t) { cout << t << "\n"; } template <class H, class... T> void puta(H &&h, T &&...t) { cout << h << ' '; puta(t...); } template <class T = ll> struct Graph { int n; vector<vector<tuple<ll, T>>> edge; Graph(int N = 1) : n(N) { edge.resize(n); } void add(ll f, ll t, T c, bool d = false) { edge[f].emplace_back(t, c); if (!d) edge[t].emplace_back(f, c); } void view() { REP(i, 0, n) for (auto &e : edge[i]) puta(i, "=>", get<0>(e), ", cost :", get<1>(e)); } }; ll StoLL(string s) { ll num = 0; REP(i, 0, s.size()) { num = num * 10 + (s[i] ^ 48); } return num; } ll CtoLL(char c) { if ('a' <= c && c <= 'z') { return (ll)(c ^ 96); } else if ('A' <= c && c <= 'Z') { return (ll)(c ^ 64); } return 0; } int MOD = 1000000007; int dx[4] = {0, 0, -1, 1}; int dy[4] = {1, -1, 0, 0}; // I ASCII code: '0' = 48; 'A' = 65; 'a' = 97 signed main() { ios_base::sync_with_stdio(0); cin.tie(0); LIN(n) double ans = 0; REP(i, 0, n) { double a; cin >> a; SIN(s) if (s == "JPY") { ans += a; } else { ans += a * 380000.0; } } puta(ans); return 0; }
[ "call.remove" ]
922,909
922,910
u468811760
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; double x, s = 0; string u; for (int i = 0; i < n; i++) { cin >> x >> u; if (u == "JPY") s += x; else s += x * 38; } cout << s << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; double x, s = 0; string u; for (int i = 0; i < n; i++) { cin >> x >> u; if (u == "JPY") s += x; else s += x * 380000; } cout << s << endl; return 0; }
[ "literal.number.change", "assignment.value.change", "expression.operation.binary.change" ]
922,933
922,934
u930561195
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<double> x(N); vector<string> u(N); for (int i = 0; i < N; i++) { cin >> x.at(i); cin >> u.at(i); } double P = 0; double S = 0; for (int i = 0; i < N; i++) { if (u.at(i) == "JPY") { P += x.at(i); } else if (u.at(i) == "BTC") { S += x.at(i) * 38000; } } cout << P + S; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<double> x(N); vector<string> u(N); for (int i = 0; i < N; i++) { cin >> x.at(i); cin >> u.at(i); } double P = 0; double S = 0; for (int i = 0; i < N; i++) { if (u.at(i) == "JPY") { P += x.at(i); } else if (u.at(i) == "BTC") { S += x.at(i) * 380000; } } cout << P + S; }
[ "literal.number.change", "assignment.value.change", "expression.operation.binary.change" ]
922,951
922,952
u700314924
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<double> x(N); vector<string> u(N); for (int i = 0; i < N; i++) { cin >> x.at(i); cin >> u.at(i); } double P = 0; double S = 0; for (int i = 0; i < N; i++) { if (u.at(i) == "JPY") { P += x.at(i); } else if (u.at(i) == "BTC") { S += x.at(i); } } cout << P + S; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<double> x(N); vector<string> u(N); for (int i = 0; i < N; i++) { cin >> x.at(i); cin >> u.at(i); } double P = 0; double S = 0; for (int i = 0; i < N; i++) { if (u.at(i) == "JPY") { P += x.at(i); } else if (u.at(i) == "BTC") { S += x.at(i) * 380000; } } cout << P + S; }
[ "assignment.change" ]
922,953
922,952
u700314924
cpp
p03110
#include <cmath> #include <iostream> #include <map> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; #define JPY_PER_BTC 380000.0 int main(int argc, const char *argv[]) { int N; cin >> N; int jpy = 0; int btc = 0; for (int i = 0; i < N; i++) { double x; cin >> x; string u; cin >> u; if (u == "JPY") { jpy += x; } else { btc += x; } } cout << (jpy + btc * JPY_PER_BTC) << endl; return 0; }
#include <cmath> #include <iostream> #include <map> #include <set> #include <sstream> #include <string> #include <vector> using namespace std; #define JPY_PER_BTC 380000.0 int main(int argc, const char *argv[]) { int N; cin >> N; double jpy = 0; double btc = 0; for (int i = 0; i < N; i++) { double x; cin >> x; string u; cin >> u; if (u == "JPY") { jpy += x; } else { btc += x; } } cout << (jpy + btc * JPY_PER_BTC) << endl; return 0; }
[ "variable_declaration.type.primitive.change" ]
922,967
922,968
u873538240
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<double> x(n); vector<string> u(n); double count = 0; for (int i = 0; i < n; i++) { cin >> x[i] >> u[i]; if (u[i] == "JPN") { count += x[i]; } else if (u[i] == "BTC") { count += x[i] * 380000.0; } } cout << count << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<double> x(n); vector<string> u(n); double count = 0; for (int i = 0; i < n; i++) { cin >> x[i] >> u[i]; if (u[i] == "JPY") { count += x[i]; } else if (u[i] == "BTC") { count += x[i] * 380000.0; } } cout << count << endl; }
[ "literal.string.change", "control_flow.branch.if.condition.change" ]
922,976
922,977
u532401120
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<double> x(n); vector<string> u(n); double count = 0; for (int i = 0; i < n; i++) { cin >> x[i] >> u[i]; if (u[i] == "JPN") { count += x[i]; } else if (u[i] == "BTC") { count += x[i] * 380000.0; } } cout << count << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<double> x(n); vector<string> u(n); double count = 0; for (int i = 0; i < n; i++) { cin >> x[i] >> u[i]; if (u[i] == "JPY") { count += x[i]; } else if (u[i] == "BTC") { count += x[i] * 380000.0; } } cout << count << endl; }
[ "literal.string.change", "control_flow.branch.if.condition.change" ]
922,978
922,977
u532401120
cpp
p03110
#include <iostream> #include <string> #include <vector> using namespace std; int main() { int n, yen = 0, bit = 0; cin >> n; vector<double> x(n); vector<string> u(n); for (int i = 0; i < n; i++) { cin >> x.at(i); cin >> u.at(i); } for (int i = 0; i < n; i++) { if (u.at(i) == "JPY") { yen += x.at(i); } else { bit += x.at(i); } } cout << yen + bit * 380000.0 << endl; return 0; }
#include <iostream> #include <string> #include <vector> using namespace std; int main() { int n; double yen = 0, bit = 0; cin >> n; vector<double> x(n); vector<string> u(n); for (int i = 0; i < n; i++) { cin >> x.at(i); cin >> u.at(i); } for (int i = 0; i < n; i++) { if (u.at(i) == "JPY") { yen += x.at(i); } else { bit += x.at(i); } } cout << yen + bit * 380000.0 << endl; return 0; }
[ "variable_declaration.type.change" ]
922,985
922,986
u343242669
cpp
p03110
#include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #define printjudge(cond) \ { \ if (cond) \ printf("Yes\n"); \ else \ printf("No\n"); \ } #define printans(ans) \ { printf("%d\n", (ans)); } #define intscan(x) \ { scanf("%d", &x); } #define Ntimes(N) for (int i = 0; i < N; i++) #define min(x, y) (((x) < (y)) ? (x) : (y)) #define max(x, y) (((x) > (y)) ? (x) : (y)) typedef int *intarray; typedef char *string; int main() { int N; double x, ans = 0.0; char u[4]; intscan(N); Ntimes(N) { scanf("%lf %s", &x, u); if (u[0] == 'J') ans += (int)x; else ans += 380000.0 * x; } printf("%f\n", &ans); return 0; }
#include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #define printjudge(cond) \ { \ if (cond) \ printf("Yes\n"); \ else \ printf("No\n"); \ } #define printans(ans) \ { printf("%d\n", (ans)); } #define intscan(x) \ { scanf("%d", &x); } #define Ntimes(N) for (int i = 0; i < N; i++) #define min(x, y) (((x) < (y)) ? (x) : (y)) #define max(x, y) (((x) > (y)) ? (x) : (y)) typedef int *intarray; typedef char *string; int main() { int N; double x, ans = 0.0; char u[4]; intscan(N); Ntimes(N) { scanf("%lf %s", &x, u); if (u[0] == 'J') ans += (int)x; else ans += 380000.0 * x; } printf("%f\n", ans); return 0; }
[ "call.arguments.change" ]
922,992
922,993
u980205854
cpp
p03110
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0), cout.tie(0) #define ll long long int #define fr first #define se second #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define sz(v) v.size() #define pb push_back #define mp make_pair #define PI 3.141592653589793238 ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return a * b / gcd(a, b); } // bool valid(int x, int y){return x > 0 && x < 9 && y > 0 && y < 9;} long double sum; int n; int main() { cin >> n; while (n--) { string s; long double l; cin >> l >> s; if (s == "BTC") sum += (l * 380000.0); else sum += l; } printf("%.5lf", sum); return 0; }
#include <bits/stdc++.h> using namespace std; #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0), cout.tie(0) #define ll long long int #define fr first #define se second #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define sz(v) v.size() #define pb push_back #define mp make_pair #define PI 3.141592653589793238 ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; } ll lcm(ll a, ll b) { return a * b / gcd(a, b); } // bool valid(int x, int y){return x > 0 && x < 9 && y > 0 && y < 9;} double sum; int n; int main() { cin >> n; while (n--) { string s; long double l; cin >> l >> s; if (s == "BTC") sum += (l * 380000.0); else sum += l; } printf("%lf\n", sum); return 0; }
[ "variable_declaration.type.narrow.change", "literal.string.change", "call.arguments.change", "io.output.change", "io.output.newline.add" ]
923,002
923,003
u685338438
cpp
p03110
#include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; long double x, ans = 0; string u; while (n--) { cin >> x >> u; if (u == "JPY") ans += x; else ans += x * 380000.0; } printf("%.6f\n", ans); }
#include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; long double x, ans = 0; string u; while (n--) { cin >> x >> u; if (u == "JPY") ans += x; else ans += x * 380000.0; } printf("%.6Lf\n", ans); }
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
923,004
923,005
u848359007
cpp
p03110
#include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; long double x, ans = 0; string u; while (n--) { cin >> x >> u; if (u == "JPY") ans += x; else ans += x * 380000; } printf("%.6f\n", ans); }
#include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; long double x, ans = 0; string u; while (n--) { cin >> x >> u; if (u == "JPY") ans += x; else ans += x * 380000.0; } printf("%.6Lf\n", ans); }
[ "literal.number.change", "assignment.value.change", "expression.operation.binary.change", "literal.string.change", "call.arguments.change", "io.output.change" ]
923,006
923,005
u848359007
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { int N, ans; cin >> N; for (int i = 0; i < N; i++) { int x; string u; cin >> x >> u; if (u == "JPY") ans += x; else ans += x * 380000.0; } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; double ans; cin >> N; for (int i = 0; i < N; i++) { double x; string u; cin >> x >> u; if (u == "JPY") ans += x; else ans += x * 380000.0; } cout << ans << endl; }
[ "variable_declaration.type.primitive.change" ]
923,013
923,014
u828766688
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { int N, sum = 0; cin >> N; vector<int> a(N); vector<string> b(N); for (int i = 0; i < N; i++) { cin >> a[i] >> b[i]; } for (int i = 0; i < N; i++) { if (b[i] == "JPY") { sum = sum + a[i]; } else { sum = sum + a[i] * 380000; } } cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; double sum = 0; cin >> N; vector<double> a(N); vector<string> b(N); for (int i = 0; i < N; i++) { cin >> a[i] >> b[i]; } for (int i = 0; i < N; i++) { if (b[i] == "JPY") { sum = sum + a[i]; } else { sum = sum + a[i] * 380000; } } cout << sum << endl; }
[ "variable_declaration.type.primitive.change" ]
923,036
923,035
u801530021
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> x(N); vector<string> u(N); for (int i = 0; i < N; i++) { cin >> x.at(i); cin >> u.at(i); } int S = 0; for (int i = 0; i < N; i++) { if (u.at(i) == "JPY") { S += x.at(i) * 1; } else { S += x.at(i) * 380000; } } cout << S << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<double> x(N); vector<string> u(N); for (int i = 0; i < N; i++) { cin >> x.at(i); cin >> u.at(i); } double S = 0; for (int i = 0; i < N; i++) { if (u.at(i) == "JPY") { S += x.at(i) * 1; } else { S += x.at(i) * 380000.0; } } cout << S << endl; }
[ "variable_declaration.type.primitive.change", "literal.number.change", "assignment.value.change", "expression.operation.binary.change" ]
923,039
923,038
u991310813
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { int n; double ans = 0; for (int i = 0; i < n; i++) { double x; string u; cin >> x >> u; if (u == "JPY") { ans += x; } else { ans += x * 380000.0; } } cout << ans; }
#include <bits/stdc++.h> using namespace std; int main() { int n; double ans = 0; cin >> n; for (int i = 0; i < n; i++) { double x; string u; cin >> x >> u; if (u == "JPY") { ans += x; } else { ans += x * 380000.0; } } cout << ans; }
[]
923,057
923,058
u885523920
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<double> x(N); vector<string> u(N); int sum = 0; for (int i = 0; i < N; i++) { cin >> x.at(i) >> u.at(i); if (u.at(i) == "JPY") { sum += x.at(i); } else { double a = x.at(i) * 10000; sum += a; } } cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<double> x(N); vector<string> u(N); double sum = 0; for (int i = 0; i < N; i++) { cin >> x.at(i) >> u.at(i); if (u.at(i) == "JPY") { sum += x.at(i); } else { double a = x.at(i) * 380000; sum += a; } } cout << sum << endl; }
[ "variable_declaration.type.primitive.change", "literal.number.change", "expression.operation.binary.change" ]
923,063
923,062
u096717230
cpp
p03110
#include <iostream> #include <string> using namespace std; int n; int main() { cin >> n; double ret = 0; for (int i = 0; i < n; i++) { double d; cin >> d; string s; cin >> s; if (s[0] == 'J') ret += d; else ret += d * 38000; } cout << ret << endl; return 0; }
#include <iostream> #include <string> using namespace std; int n; int main() { cin >> n; double ret = 0; for (int i = 0; i < n; i++) { double d; cin >> d; string s; cin >> s; if (s[0] == 'J') ret += d; else ret += d * 380000; } cout << ret << endl; return 0; }
[ "literal.number.change", "assignment.value.change", "expression.operation.binary.change" ]
923,071
923,072
u876442898
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int i, ans = 0, x; string u; for (i = 0; i < n; i++) { cin >> x; cin >> u; if (u == "JPY") { ans += x; } else { ans += x * 380000; } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; double i, ans = 0, x; string u; for (i = 0; i < n; i++) { cin >> x; cin >> u; if (u == "JPY") { ans += x; } else { ans += x * 380000.0; } } cout << ans << endl; }
[ "variable_declaration.type.primitive.change", "literal.number.change", "assignment.value.change", "expression.operation.binary.change" ]
923,110
923,111
u479790786
cpp
p03110
#include <cstring> #include <iostream> using namespace std; int main() { int n; cin >> n; string x[n], u[n]; for (int i = 0; i < n; i++) cin >> x[i] >> u[i]; double sum = 0; for (int i = 0; i < n; i++) { if (u[i] == "BTC") sum += stoi(x[i]) * 380000.0; else sum += stoi(x[i]) * 1.0; } cout << sum << endl; }
#include <cstring> #include <iostream> using namespace std; int main() { int n; cin >> n; string x[n], u[n]; for (int i = 0; i < n; i++) cin >> x[i] >> u[i]; double sum; for (int i = 0; i < n; i++) { if (u[i] == "BTC") sum += stod(x[i]) * 380000.0; else sum += stoi(x[i]) * 1.0; } cout << sum << endl; }
[ "assignment.value.change", "identifier.change", "call.function.change", "expression.operation.binary.change" ]
923,118
923,119
u685334074
cpp
p03110
#include <iostream> using namespace std; int main() { int n; cin >> n; double x; string u; double sum = 0; for (int i = 0; i < n; i++) { cin >> x >> u; if (u == "JPY") { sum += x; } else { sum += x * 38000; } } cout << sum << endl; }
#include <iostream> using namespace std; int main() { int n; cin >> n; double x; string u; double sum = 0; for (int i = 0; i < n; i++) { cin >> x >> u; if (u == "JPY") { sum += x; } else { sum += x * 380000; } } cout << sum << endl; }
[ "literal.number.change", "assignment.value.change", "expression.operation.binary.change" ]
923,126
923,127
u456753075
cpp
p03110
#include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; int ans = 0; for (int i = 0; i < n; i++) { int money; string current; cin >> money >> current; if (current == "JPY") { ans += money; } else { ans += money * 380000; } } cout << ans << endl; }
#include <iostream> #include <string> using namespace std; int main() { int n; cin >> n; double ans = 0; for (int i = 0; i < n; i++) { double money; string current; cin >> money >> current; if (current == "JPY") { ans += money; } else { ans += money * 380000.0; } } cout << ans << endl; }
[ "variable_declaration.type.primitive.change", "literal.number.change", "assignment.value.change", "expression.operation.binary.change" ]
923,144
923,145
u245414044
cpp
p03110
#include <algorithm> #include <iostream> #include <limits.h> #include <stdio.h> #include <string.h> #include <string> #include <vector> #ifndef U_L_LONG typedef unsigned long long U_L_LONG; #endif #ifndef L_LONG typedef long long L_LONG; #endif #ifndef LL_ABS #define LL_ABS(x) (((((L_LONG)(x) < 0) ? ((L_LONG)(x) * (-1)) : ((L_LONG)(x))))) #endif // static void ABC120D_DecayedBridges(); // static void ABC119C_MonstersBattleRoyale(); // static void ABC117C_Streamline(); static void ABC119B_DigitalGifts(); #if 1 int main() { // ABC120D_DecayedBridges(); // ABC119C_MonstersBattleRoyale(); // ABC117C_Streamline(); ABC119B_DigitalGifts(); fflush(stdout); return 0; } #endif #define ABC119B_MAX (16) #define ABC119B_BTC_RATE (380000.0) static void ABC119B_DigitalGifts() { int N = 0; const std::string JPY = "JPY"; char szNum[ABC119B_MAX] = {0}; char szKind[ABC119B_MAX] = {0}; double moneySum = 0.0; scanf(" %d", &N); for (int i = 0; i < N; i++) { scanf(" %s %s", szNum, szKind); if (szKind == JPY) { moneySum += strtod(szNum, NULL); } else { moneySum += strtod(szNum, NULL) * ABC119B_BTC_RATE; } } printf("%Lf\n", moneySum); }
#include <algorithm> #include <iostream> #include <limits.h> #include <stdio.h> #include <string.h> #include <string> #include <vector> #ifndef U_L_LONG typedef unsigned long long U_L_LONG; #endif #ifndef L_LONG typedef long long L_LONG; #endif #ifndef LL_ABS #define LL_ABS(x) (((((L_LONG)(x) < 0) ? ((L_LONG)(x) * (-1)) : ((L_LONG)(x))))) #endif // static void ABC120D_DecayedBridges(); // static void ABC119C_MonstersBattleRoyale(); // static void ABC117C_Streamline(); static void ABC119B_DigitalGifts(); #if 1 int main() { // ABC120D_DecayedBridges(); // ABC119C_MonstersBattleRoyale(); // ABC117C_Streamline(); ABC119B_DigitalGifts(); fflush(stdout); return 0; } #endif #define ABC119B_MAX (16) #define ABC119B_BTC_RATE (380000.0) static void ABC119B_DigitalGifts() { int N = 0; const std::string JPY = "JPY"; char szNum[ABC119B_MAX] = {0}; char szKind[ABC119B_MAX] = {0}; double moneySum = 0.0; scanf(" %d", &N); for (int i = 0; i < N; i++) { scanf(" %s %s", szNum, szKind); if (szKind == JPY) { moneySum += strtod(szNum, NULL); } else { moneySum += strtod(szNum, NULL) * ABC119B_BTC_RATE; } } printf("%f\n", moneySum); }
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
923,152
923,153
u887675488
cpp
p03110
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; int main() { int N; cin >> N; vector<double> x(N); vector<string> u(N); for (int i = 0; i < N; i++) { cin >> x[i] >> u[1]; } double s = 0; for (int i = 0; i < N; i++) { if (u[i] == "JPY") { s += x[i]; } else { s += x[i] * 380000; } } cout << s << endl; }
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; int main() { int N; cin >> N; vector<double> x(N); vector<string> u(N); for (int i = 0; i < N; i++) { cin >> x[i] >> u[i]; } double s = 0; for (int i = 0; i < N; i++) { if (u[i] == "JPY") { s += x[i]; } else { s += x[i] * 380000; } } cout << s << endl; }
[ "identifier.replace.add", "literal.replace.remove", "variable_access.subscript.index.change", "expression.operation.binary.change" ]
923,161
923,162
u955534952
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<pair<float, string>> m(n); for (int i = 0; i < n; i++) { cin >> m[i].first >> m[i].second; } const float b2y = 380000.0; float sum = 0; for (int i = 0; i < n; i++) { if (m[i].second == "BTC") { sum += m[i].first * b2y; } else { sum += m[i].first; } cout << sum; } }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<pair<float, string>> m(n); for (int i = 0; i < n; i++) { cin >> m[i].first >> m[i].second; } const float b2y = 380000.0; float sum = 0; for (int i = 0; i < n; i++) { if (m[i].second == "BTC") { sum += m[i].first * b2y; } else { sum += m[i].first; } } cout << sum; }
[]
923,165
923,166
u261514692
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { double a, b, sum; string c; cin >> a; sum = 0; for (int i = 0; i < a; i++) { cin >> b >> c; if (c == "BTC") { b *= 38000; } sum += b; } cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; int main() { double a, b, sum; string c; cin >> a; sum = 0; for (int i = 0; i < a; i++) { cin >> b >> c; if (c == "BTC") { b *= 380000; } sum += b; } cout << sum << endl; }
[ "literal.number.change", "assignment.value.change" ]
923,167
923,168
u902787159
cpp
p03110
#include <iostream> #include <string> using namespace std; int main() { int n; int i, j = 0; double b, x; string s; cin >> n; for (i = 0; i < n; i++) { cin >> x >> s; if (s == "JPY") j += x; else b += x; } cout << j + b * 38000.0 << endl; return 0; }
#include <iostream> #include <string> using namespace std; int main() { int n; int i, j = 0; double b, x; string s; cin >> n; for (i = 0; i < n; i++) { cin >> x >> s; if (s == "JPY") j += x; else b += x; } cout << j + b * 380000.0 << endl; return 0; }
[ "literal.number.change", "io.output.change" ]
923,173
923,174
u060467857
cpp
p03110
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define int long long #define vec(a, n) vector<int>(a)((n)) #define Vec(a, n) vector<string>(a)((n)) #define twovec(a, n, m) vector<vector<int>> a(n, vector<int>(m, 0)) #define Twovec(a, n, m) vector<vector<double>> a(n, vector<double>(m, 0)) #define P pair<int, int> #define All(a) (a).begin(), (a).end() #define Sort(a) sort(All(a)) #define RSort(a) reverse(All(a)) #define Reverse(a) reverse(All(a)) #define PQ(n) priority_queue<P, vector<P>, greater<P>>(n) #define pq(n) priority_queue<int>(n) #define Lower(a, t) lower_bound(All(a), t) using namespace std; int max_int = 1000000007; void Debug(auto a) { cout << "{ "; for (auto b : a) { cout << b << " "; } cout << "}" << endl; } int gcd(int u, int v) { int r; while (0 != v) { r = u % v; u = v; v = r; } return u; } signed main() { int n; cin >> n; double ans = 0.0; REP(i, n) { double x; string u; cin >> x >> u; if (u == "JPN") { ans += x; } else { ans += x * 380000; } } cout << setprecision(10) << ans << endl; return 0; }
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) for (int i = 0; i < (n); ++i) #define int long long #define vec(a, n) vector<int>(a)((n)) #define Vec(a, n) vector<string>(a)((n)) #define twovec(a, n, m) vector<vector<int>> a(n, vector<int>(m, 0)) #define Twovec(a, n, m) vector<vector<double>> a(n, vector<double>(m, 0)) #define P pair<int, int> #define All(a) (a).begin(), (a).end() #define Sort(a) sort(All(a)) #define RSort(a) reverse(All(a)) #define Reverse(a) reverse(All(a)) #define PQ(n) priority_queue<P, vector<P>, greater<P>>(n) #define pq(n) priority_queue<int>(n) #define Lower(a, t) lower_bound(All(a), t) using namespace std; int max_int = 1000000007; void Debug(auto a) { cout << "{ "; for (auto b : a) { cout << b << " "; } cout << "}" << endl; } int gcd(int u, int v) { int r; while (0 != v) { r = u % v; u = v; v = r; } return u; } signed main() { int n; cin >> n; double ans = 0; REP(i, n) { double x; string u; cin >> x >> u; if (u == "JPY") { ans += x; } else { ans += x * 380000; } } cout << setprecision(10) << ans << endl; return 0; }
[ "literal.number.change", "variable_declaration.value.change", "literal.string.change", "control_flow.branch.if.condition.change" ]
923,182
923,183
u607741489
cpp
p03110
// #pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<ld, ld> pdd; const int maxN = 150010; const int MAXM = 310; const int MAXK = 17; const int MOD = 1000000007; const ll INF = 10000000000000000LL; const ll inf = 5000000000000LL; int n; int a[maxN]; char b[maxN]; int main() { scanf("%d", &n); double ans; for (int i = 1; i <= n; i++) { int x; scanf("%d", &x); scanf("%s", b + 1); if (b[1] == 'B') { ans += x * 380000.0; } else { ans += x; } } printf("%f\n", ans); return 0; }
// #pragma GCC optimize("Ofast") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef pair<ld, ld> pdd; const int maxN = 150010; const int MAXM = 310; const int MAXK = 17; const int MOD = 1000000007; const ll INF = 10000000000000000LL; const ll inf = 5000000000000LL; int n; int a[maxN]; char b[maxN]; int main() { scanf("%d", &n); double ans; for (int i = 1; i <= n; i++) { double x; scanf("%lf", &x); scanf("%s", b + 1); if (b[1] == 'B') { ans += x * 380000.0; } else { ans += x; } } printf("%f\n", ans); return 0; }
[ "variable_declaration.type.primitive.change", "literal.string.change", "call.arguments.change" ]
923,219
923,220
u807919574
cpp
p03110
#include <iostream> #include <sstream> // std::ostringstream #include <string> #include <vector> using namespace std; int main() { int n; float sum; cin >> n; for (int i = 0; i < n; i++) { int x; string y; cin >> x >> y; if (y.compare("JPY") == 0) { sum += x; } else { sum += x * 380000; } } cout << sum << endl; }
#include <iostream> #include <sstream> // std::ostringstream #include <string> #include <vector> using namespace std; int main() { int n; float sum; cin >> n; for (int i = 0; i < n; i++) { float x; string y; cin >> x >> y; if (y.compare("JPY") == 0) { sum += x; } else { sum += x * 380000; } } cout << sum << endl; }
[ "variable_declaration.type.primitive.change" ]
923,227
923,228
u000217193
cpp
p03110
#include <iostream> #include <sstream> // std::ostringstream #include <string> #include <vector> using namespace std; int main() { int n, sum; cin >> n; for (int i = 0; i < n; i++) { int x; string y; cin >> x >> y; if (y.compare("JPY") == 0) { sum += x; } else { sum += x * 380000; } } cout << sum << endl; }
#include <iostream> #include <sstream> // std::ostringstream #include <string> #include <vector> using namespace std; int main() { int n; float sum; cin >> n; for (int i = 0; i < n; i++) { float x; string y; cin >> x >> y; if (y.compare("JPY") == 0) { sum += x; } else { sum += x * 380000; } } cout << sum << endl; }
[ "variable_declaration.type.primitive.change" ]
923,229
923,228
u000217193
cpp
p03110
#include <iostream> #include <stdio.h> #include <string> #include <list> #include <map> #include <vector> #include <algorithm> #include <utility> using namespace std; int main(const int argc, const char **argv) { int N; scanf("%d", &N); int ans = 0; for (int i = 0; i < N; i++) { double x; char u[3]; scanf("%lf %s", &x, u); if (string(u) == "JPY") { ans += x; } else if (string(u) == "BTC") { ans += x * 380000.0; } } printf("%d", ans); return 0; }
#include <iostream> #include <stdio.h> #include <string> #include <list> #include <map> #include <vector> #include <algorithm> #include <utility> using namespace std; int main(const int argc, const char **argv) { int N; scanf("%d", &N); double ans = 0; for (int i = 0; i < N; i++) { double x; char u[3]; scanf("%lf %s", &x, u); if (string(u) == "JPY") { ans += x; } else if (string(u) == "BTC") { ans += x * 380000.0; } } printf("%f", ans); return 0; }
[ "variable_declaration.type.primitive.change", "literal.string.change", "call.arguments.change", "io.output.change" ]
923,230
923,231
u580083462
cpp
p03110
// Author: Rahul Purohit #include <bits/stdc++.h> #define vi vector<int> #define rep(i, a, b) for (ll i = a; i < b; ++i) #define ll long long int #define pi pair<ll, ll> #define f first #define mp make_pair #define mod 1000000007 #define s second #define pb push_back #define mp make_pair #define N 100001 using namespace std; int gcd(int a, int b) { if (b == 0) return a; else return (b, a % b); } /*ll isp[N]={1}; void sieve(int n) { isp[0]=isp[1]=0; for(int i=2;i<=n;i++) { if(isp[i]==1) { for(int j=i*i;j<=n;j+=i) { isp[j]==0; } } } }*/ ll pow(int x, int y, int m) { ll ans = 1; while (y != 0) { if (y % 2 == 1) { ans = (ans * x) % m; } x = (x * x) % m; y /= 2; } return ans; } template <class x> void swap(x &a, x &b) { x tp; tp = a; a = b; b = tp; } template <class x> void max(x &a, x &b) { return (a >= b ? a : b); } template <class x> void min(x &a, x &b) { return (a >= b ? b : a); } int main(void) { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); ll n; cin >> n; double a, res = 0; string b; rep(i, 0, n) { cin >> a >> b; if (b == "BTC") { res += (a * 38000.0); } else { res += a; } } cout << res << "\n"; return 0; }
// Author: Rahul Purohit #include <bits/stdc++.h> #define vi vector<int> #define rep(i, a, b) for (ll i = a; i < b; ++i) #define ll long long int #define pi pair<ll, ll> #define f first #define mp make_pair #define mod 1000000007 #define s second #define pb push_back #define mp make_pair #define N 100001 using namespace std; int gcd(int a, int b) { if (b == 0) return a; else return (b, a % b); } /*ll isp[N]={1}; void sieve(int n) { isp[0]=isp[1]=0; for(int i=2;i<=n;i++) { if(isp[i]==1) { for(int j=i*i;j<=n;j+=i) { isp[j]==0; } } } }*/ ll pow(int x, int y, int m) { ll ans = 1; while (y != 0) { if (y % 2 == 1) { ans = (ans * x) % m; } x = (x * x) % m; y /= 2; } return ans; } template <class x> void swap(x &a, x &b) { x tp; tp = a; a = b; b = tp; } template <class x> void max(x &a, x &b) { return (a >= b ? a : b); } template <class x> void min(x &a, x &b) { return (a >= b ? b : a); } int main(void) { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); ll n; cin >> n; double a, res = 0; string b; rep(i, 0, n) { cin >> a >> b; if (b == "BTC") { res += (a * 380000.0); } else { res += a; } } cout << fixed << res << "\n"; return 0; }
[ "literal.number.change", "assignment.value.change", "expression.operation.binary.change", "io.output.change" ]
923,253
923,254
u707655771
cpp
p03110
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int, int> pii; typedef pair<ll, ll> pll; int Main() { int N; float ans = 0.0; cin >> N; for (int i = 0; i < N; i++) { float x; string u; cin >> x >> u; if (u == "JPY") { ans += x; } else { ans += x * 380000.0; } cout << ans << endl; } } int main() { ios::sync_with_stdio(false); Main(); return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int, int> pii; typedef pair<ll, ll> pll; int Main() { int N; float ans = 0.0; cin >> N; for (int i = 0; i < N; i++) { float x; string u; cin >> x >> u; if (u == "JPY") { ans += x; } else { ans += x * 380000.0; } } cout << ans << endl; } int main() { ios::sync_with_stdio(false); Main(); return 0; }
[]
923,266
923,267
u572532976
cpp
p03110
#include <cstdio> #include <iostream> #include <queue> #include <stack> #include <vector> using namespace std; #define endl "\n" int main(int argc, const char *argv[]) { ios::sync_with_stdio(false); int N; cin >> N; double ans = 0; for (int i = 0; i < N; i++) { double x; string u; cin >> x >> u; if (u == "JPY") { ans += x; } else { ans += x * 380000.0; } } printf("%.10l\n", ans); }
#include <cstdio> #include <iostream> #include <queue> #include <stack> #include <vector> using namespace std; #define endl "\n" int main(int argc, const char *argv[]) { ios::sync_with_stdio(false); int N; cin >> N; double ans = 0; for (int i = 0; i < N; i++) { double x; string u; cin >> x >> u; if (u == "JPY") { ans += x; } else { ans += x * 380000.0; } } printf("%.10lf\n", ans); }
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
923,283
923,284
u477204532
cpp
p03110
#include <iostream> using namespace std; int main() { int n; cin >> n; double s; s = 0; double x; string u; for (int i = 1; i < n; i++) { cin >> x >> u; if (u == "JPY") s += x; else if (u == "BTC") s += x * 380000; } cout << s; return 0; }
#include <iostream> using namespace std; int main() { int n; cin >> n; double s; s = 0; double x; string u; for (int i = 0; i < n; i++) { cin >> x >> u; if (u == "JPY") s += x; else if (u == "BTC") s += x * 380000.0; } cout << s; return 0; }
[ "literal.number.change", "variable_declaration.value.change", "control_flow.loop.for.initializer.change", "expression.off_by_one", "assignment.value.change", "expression.operation.binary.change" ]
923,296
923,295
u057617112
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; double x[11]; char u[11]; for (int i = 0; i < N; i++) cin >> x[i] >> u[i]; double sum1 = 0; double sum2 = 0; for (int i = 0; i < N; i++) { if (u[i] == 'JPY') sum1 += x[i]; else sum2 += x[i] * 380000.0; } cout << sum1 + sum2 << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; double x[11]; string u[11]; for (int i = 0; i < N; i++) cin >> x[i] >> u[i]; double sum1 = 0; double sum2 = 0; for (int i = 0; i < N; i++) { if (u[i] == "JPY") sum1 += x[i]; else sum2 += x[i] * 380000.0; } cout << sum1 + sum2 << endl; }
[ "variable_declaration.type.change", "literal.string.change", "control_flow.branch.if.condition.change" ]
923,305
923,306
u928536113
cpp
p03110
#include <iostream> using namespace std; int main() { int n; double a, ans = 0; string s; for (int i = 0; i < n; i++) { cin >> a >> s; if (s[0] == 'J') ans += a; else ans += a * 380000; } cout << ans << endl; return 0; }
#include <iostream> using namespace std; int main() { int n; double a, ans = 0; string s; cin >> n; for (int i = 0; i < n; i++) { cin >> a >> s; if (s[0] == 'J') ans += a; else ans += a * 380000; } cout << ans << endl; return 0; }
[]
923,320
923,321
u601082779
cpp
p03110
#include <iostream> using namespace std; int main() { int N; cin >> N; double sum = 0; for (int i = 0; i < N; i++) { int x; string u; cin >> x >> u; if (u == "JPY") { sum += x; } else if (u == "BTC") { sum += x * 380000; } } cout << sum << endl; return 0; }
#include <iostream> using namespace std; int main() { int N; cin >> N; double sum = 0; for (int i = 0; i < N; i++) { double x; string u; cin >> x >> u; if (u == "JPY") { sum += x; } else if (u == "BTC") { sum += x * 380000; } } cout << sum << endl; return 0; }
[ "variable_declaration.type.primitive.change" ]
923,359
923,360
u798514691
cpp
p03110
#include <iostream> using namespace std; double s, t; int n; string a; main() { cin >> n; for (; n--;) cin >> s >> a, t += s *= a[0] % 4 ? 38e4 : 1; cout << t; }
#include <iostream> using namespace std; double s, t; int n; string a; main() { cin >> n; for (; n--;) cin >> s >> a, t += s *= a[0] % 3 ? 1 : 38e4; cout << t; }
[ "literal.number.change", "assignment.value.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
923,368
923,369
u657913472
cpp
p03110
#include <math.h> #include <stdio.h> #include <stdlib.h> int compare_int(const void *a, const void *b) { return *(int *)b - *(int *)a; } int main() { int n = 0; scanf("%d\n", &n); double money = 0; char type[5]; double ans = 0; for (int i = 0; i < n; i++) { scanf("%lf %s\n", &money, type); if (type[0] == 'J') { ans = ans + money; } else { ans = ans + money * 380000.0; } } printf("%llf\n", ans); }
#include <math.h> #include <stdio.h> #include <stdlib.h> int compare_int(const void *a, const void *b) { return *(int *)b - *(int *)a; } int main() { int n = 0; scanf("%d\n", &n); double money = 0; char type[5]; double ans = 0; for (int i = 0; i < n; i++) { scanf("%lf %s\n", &money, type); if (type[0] == 'J') { ans = ans + money; } else { ans = ans + money * 380000.0; } } printf("%lf\n", ans); }
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
923,382
923,383
u660489157
cpp
p03110
#include <iostream> using namespace std; int main() { int n; string u[11]; double x[11]; double jpy = 0, btc = 0, sum = 0; cin >> n; for (int i = 1; i < n; i++) { cin >> x[i] >> u[i]; } for (int i = 1; i < n; i++) { if (u[i] == "JPY") { jpy += x[i]; } else { btc += x[i]; } } btc *= 380000.0; sum = jpy + btc; printf("%.8f", sum); return 0; }
#include <iostream> using namespace std; int main() { int n; string u[11]; double x[11]; double jpy = 0, btc = 0, sum = 0; cin >> n; for (int i = 1; i <= n; i++) { cin >> x[i] >> u[i]; } for (int i = 1; i <= n; i++) { if (u[i] == "JPY") { jpy += x[i]; } else { btc += x[i]; } } btc *= 380000.0; sum = jpy + btc; printf("%.8f", sum); return 0; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
923,388
923,389
u454744257
cpp
p03110
#include <cstdio> #include <cstring> using namespace std; const int MAX_N = 10; const long double B_TO_J = 380000.0; long double x[MAX_N]; char u[MAX_N][4]; int N; int main() { scanf("%d", &N); for (int i = 0; i < N; i++) { scanf("%lf %s", &x[i], u[i]); } long double ans = 0.0; for (int i = 0; i < N; i++) { if (strcmp(u[i], "BTC") == 0) { ans += B_TO_J * x[i]; } else { ans += x[i]; } } printf("%lf\n", ans); return 0; }
#include <cstdio> #include <cstring> using namespace std; const int MAX_N = 10; const double B_TO_J = 380000.0; double x[MAX_N]; char u[MAX_N][4]; int N; int main() { scanf("%d", &N); for (int i = 0; i < N; i++) { scanf("%lf %s", &x[i], u[i]); } double ans = 0.0; for (int i = 0; i < N; i++) { if (strcmp(u[i], "BTC") == 0) { ans += B_TO_J * x[i]; } else { ans += x[i]; } } printf("%lf\n", ans); return 0; }
[ "variable_declaration.type.narrow.change" ]
923,400
923,401
u886708442
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long double a[n]; string s[n]; long double sum = 0; for (int i = 0; i < n; i++) { cin >> a[i] >> s[i]; if (s[i][0] == 'J') sum += a[i]; else sum += a[i] * 380000.0; } cout << setprecision(3) << sum << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; long double a[n]; string s[n]; long double sum = 0; for (int i = 0; i < n; i++) { cin >> a[i] >> s[i]; if (s[i][0] == 'J') sum += a[i]; else sum += a[i] * 380000.0; } cout << setprecision(8) << sum << endl; return 0; }
[ "literal.number.change", "io.output.change" ]
923,426
923,427
u876646747
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; double t = 0; for (int i = 1; i <= n; i++) { double a1; string a2; cin >> a1 >> a2; if (a2 == "JPY") t += a1; if (a2 == "BTC") t += (a1 * 38000000); } cout << t << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; double t = 0; for (int i = 1; i <= n; i++) { double a1; string a2; cin >> a1 >> a2; if (a2 == "JPY") t += a1; if (a2 == "BTC") t += (a1 * 380000.0); } cout << t << endl; return 0; }
[ "literal.number.change", "assignment.value.change", "expression.operation.binary.change" ]
923,457
923,458
u280396592
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { double s = 0; int n; scanf("%d", &n); for (int i = 0; i < n; i++) { double t; scanf("%lf", &t); char tmp[4]; scanf("%s", tmp); if (strcmp(tmp, "JPY") != 0) s = t * 380000; else s = t; } printf("%g", s); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { double s = 0; int n; scanf("%d", &n); for (int i = 0; i < n; i++) { double t; scanf("%lf", &t); char tmp[4]; scanf("%s", tmp); if (strcmp(tmp, "JPY") != 0) s += t * 380000; else s += t; } printf("%g", s); return 0; }
[ "assignment.value.change" ]
923,465
923,466
u258475328
cpp
p03110
#include <cstdlib> #include <iostream> #include <string> using namespace std; int main() { int i, N; cin >> N; float x[N]; string u[N]; for (i = 0; i < N; i++) cin >> x[i]; cin >> u[i]; // BTCをJPYに for (i = 0; i < N; i++) { if (u[i] == "BTC") { x[i] = x[i] * 380000.0; u[i] = "JPY"; } } // sum float sum = 0.0; for (i = 0; i < N; i++) { sum += x[i]; } cout << sum << endl; return 0; }
#include <cstdlib> #include <iostream> #include <string> using namespace std; int main() { int i, N; cin >> N; double x[N]; string u[N]; // for (i = 0; i < N; i++) { cin >> x[i]; cin >> u[i]; } // BTCをJPYに for (i = 0; i < N; i++) { if (u[i] == "BTC") { x[i] = x[i] * 380000.0; u[i] = "JPY"; } } // sum double sum = 0.0; for (i = 0; i < N; i++) { sum += x[i]; } cout << sum << endl; return 0; }
[ "variable_declaration.type.primitive.change" ]
923,475
923,476
u784645064
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; double A, sum; string B; sum = 0; for (int i = 0; i <= N; i++) { cin >> A >> B; if (B == "JPY") { sum = sum + A; } else { sum = sum + A * 380000.0; } } cout << sum << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; double A, sum; string B; sum = 0; for (int i = 0; i < N; i++) { cin >> A >> B; if (B == "JPY") { sum = sum + A; } else { sum = sum + A * 380000.0; } } cout << sum << endl; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
923,489
923,490
u403984573
cpp
p03110
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (signed i = 0; i < n; ++i) #define repi(n) rep(i, n) #define repvin(n) \ vint a(n); \ r(i, n) cin >> a[i]; #define int long long #define str string #define vint vector<signed> #define pint pair<signed, signed> #define pb(a) push_back(a) #define all(v) v.begin(), v.end() #define yn(b) cout << ((b) ? "Yes" : "No") << endl #define YN(b) cout << ((b) ? "YES" : "NO") << endl #define call(a) \ for (auto t : a) \ cout << t << " "; \ cout << endl #define ENDL printf("\n"); #define debg(a) cout << #a << ":" << a << endl; #define SORT(a) sort(all(a)); signed main() { int n; cin >> n; double a[n]; str s[n]; repi(n) cin >> a[i] >> s[i]; double res = 0; rep(i, n) { if (s[i] == "JPY") res += a[i]; else res += a[i] * 38000; } printf("%.4f", res); return 0; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (signed i = 0; i < n; ++i) #define repi(n) rep(i, n) #define repvin(n) \ vint a(n); \ r(i, n) cin >> a[i]; #define int long long #define str string #define vint vector<signed> #define pint pair<signed, signed> #define pb(a) push_back(a) #define all(v) v.begin(), v.end() #define yn(b) cout << ((b) ? "Yes" : "No") << endl #define YN(b) cout << ((b) ? "YES" : "NO") << endl #define call(a) \ for (auto t : a) \ cout << t << " "; \ cout << endl #define ENDL printf("\n"); #define debg(a) cout << #a << ":" << a << endl; #define SORT(a) sort(all(a)); signed main() { int n; cin >> n; double a[n]; str s[n]; repi(n) cin >> a[i] >> s[i]; double res = 0; rep(i, n) { if (s[i] == "JPY") res += a[i]; else res += a[i] * 380000; } printf("%.4f", res); return 0; }
[ "literal.number.change", "assignment.value.change", "expression.operation.binary.change" ]
923,524
923,525
u423624748
cpp
p03110
#include <bits/stdc++.h> using namespace std; #define ll long long typedef pair<ll, ll> P; #define M 1000000007 int main() { int n; cin >> n; double c = 0, x; string s; for (int i = 0; i < n; i++) { cin >> x >> s; if (s == "JPY") c += x * 10000.0; else c += x * 380000.0; } cout << fixed << setprecision(10) << c; }
#include <bits/stdc++.h> using namespace std; #define ll long long typedef pair<ll, ll> P; #define M 1000000007 int main() { int n; cin >> n; double c = 0, x; string s; for (int i = 0; i < n; i++) { cin >> x >> s; if (s == "JPY") c += x * 1.0; else c += x * 380000.0; } cout << fixed << setprecision(10) << c; }
[ "literal.number.change", "assignment.value.change", "expression.operation.binary.change" ]
923,528
923,529
u987476436
cpp
p03110
#define debug_interval ',' #define dump_interval ' ' #define debug_toggle 1 //{ #pragma GCC optimize("O3") #pragma GCC target("avx") #include <bits/stdc++.h> using namespace std; #define hi cerr << "hi" << endl; #define int long long #define INT_MAX LLONG_MAX #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i <= (n); i++) #define pb push_back #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define fi first #define se second #define mp make_pair #define rev reverse #define dans dump(ans) #define MOD 1000000007 #define amp(v, n) (v).count(n) ? v[n]++ : v[n] = 1 #define sysp system("pause") #define PI acos(-1) #define ins insert #define aer(v) (v).erase((v).begin(), (v).end()) //{ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } template <class... A> inline void dump() { cout << endl; } template <class... A> inline void dump_rest() { cout << endl; } template <class T, class... A> inline void dump_rest(const T &first, const A &...rest) { cout << dump_interval << first; dump_rest(rest...); } template <class T, class... A> inline void dump(const T &first, const A &...rest) { cout << first; dump_rest(rest...); } template <class... A> inline void debug() { cerr << endl; } template <class... A> inline void debug_rest() { cerr << endl; } template <class T, class... A> inline void debug_rest(const T &first, const A &...rest) { cerr << debug_interval << first; debug_rest(rest...); } template <class T, class... A> inline void debug(const T &first, const A &...rest) { if (debug_toggle) cerr << first, debug_rest(rest...); } //} typedef vector<int> vint; typedef pair<int, int> pint; typedef vector<pint> vpint; template <typename A, typename B> inline void chmin(A &a, B b) { if (a > b) a = b; } template <typename A, typename B> inline void chmax(A &a, B b) { if (a < b) a = b; } template <int m> class mint { private: int i; public: mint() : i(0) {} mint(int i) : i((i % m + m) % m) {} mint operator+(const mint &o) { return o.i + i; } mint operator*(const mint &o) { return o.i * i; } mint operator-() { return -i; } operator int() { return i; } }; //} int n; double x, ans; main() { cin >> n; rep(i, n) { string s; cin >> x >> s; if (s == "JPY") ans += x; else ans += x * 380000.0; dans; } printf("%.4lf\n", ans); }
#define debug_interval ',' #define dump_interval ' ' #define debug_toggle 1 //{ #pragma GCC optimize("O3") #pragma GCC target("avx") #include <bits/stdc++.h> using namespace std; #define hi cerr << "hi" << endl; #define int long long #define INT_MAX LLONG_MAX #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i <= (n); i++) #define pb push_back #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define fi first #define se second #define mp make_pair #define rev reverse #define dans dump(ans) #define MOD 1000000007 #define amp(v, n) (v).count(n) ? v[n]++ : v[n] = 1 #define sysp system("pause") #define PI acos(-1) #define ins insert #define aer(v) (v).erase((v).begin(), (v).end()) //{ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } template <class... A> inline void dump() { cout << endl; } template <class... A> inline void dump_rest() { cout << endl; } template <class T, class... A> inline void dump_rest(const T &first, const A &...rest) { cout << dump_interval << first; dump_rest(rest...); } template <class T, class... A> inline void dump(const T &first, const A &...rest) { cout << first; dump_rest(rest...); } template <class... A> inline void debug() { cerr << endl; } template <class... A> inline void debug_rest() { cerr << endl; } template <class T, class... A> inline void debug_rest(const T &first, const A &...rest) { cerr << debug_interval << first; debug_rest(rest...); } template <class T, class... A> inline void debug(const T &first, const A &...rest) { if (debug_toggle) cerr << first, debug_rest(rest...); } //} typedef vector<int> vint; typedef pair<int, int> pint; typedef vector<pint> vpint; template <typename A, typename B> inline void chmin(A &a, B b) { if (a > b) a = b; } template <typename A, typename B> inline void chmax(A &a, B b) { if (a < b) a = b; } template <int m> class mint { private: int i; public: mint() : i(0) {} mint(int i) : i((i % m + m) % m) {} mint operator+(const mint &o) { return o.i + i; } mint operator*(const mint &o) { return o.i * i; } mint operator-() { return -i; } operator int() { return i; } }; //} int n; double x, ans; main() { cin >> n; rep(i, n) { string s; cin >> x >> s; if (s == "JPY") ans += x; else ans += x * 380000.0; // dans; } printf("%.4lf\n", ans); }
[]
923,530
923,531
u130196064
cpp
p03110
#define debug_interval ',' #define dump_interval ' ' #define debug_toggle 1 //{ #pragma GCC optimize("O3") #pragma GCC target("avx") #include <bits/stdc++.h> using namespace std; #define hi cerr << "hi" << endl; #define int long long #define INT_MAX LLONG_MAX #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i <= (n); i++) #define pb push_back #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define fi first #define se second #define mp make_pair #define rev reverse #define dans dump(ans) #define MOD 1000000007 #define amp(v, n) (v).count(n) ? v[n]++ : v[n] = 1 #define sysp system("pause") #define PI acos(-1) #define ins insert #define aer(v) (v).erase((v).begin(), (v).end()) //{ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } template <class... A> inline void dump() { cout << endl; } template <class... A> inline void dump_rest() { cout << endl; } template <class T, class... A> inline void dump_rest(const T &first, const A &...rest) { cout << dump_interval << first; dump_rest(rest...); } template <class T, class... A> inline void dump(const T &first, const A &...rest) { cout << first; dump_rest(rest...); } template <class... A> inline void debug() { cerr << endl; } template <class... A> inline void debug_rest() { cerr << endl; } template <class T, class... A> inline void debug_rest(const T &first, const A &...rest) { cerr << debug_interval << first; debug_rest(rest...); } template <class T, class... A> inline void debug(const T &first, const A &...rest) { if (debug_toggle) cerr << first, debug_rest(rest...); } //} typedef vector<int> vint; typedef pair<int, int> pint; typedef vector<pint> vpint; template <typename A, typename B> inline void chmin(A &a, B b) { if (a > b) a = b; } template <typename A, typename B> inline void chmax(A &a, B b) { if (a < b) a = b; } template <int m> class mint { private: int i; public: mint() : i(0) {} mint(int i) : i((i % m + m) % m) {} mint operator+(const mint &o) { return o.i + i; } mint operator*(const mint &o) { return o.i * i; } mint operator-() { return -i; } operator int() { return i; } }; //} int n; double x, ans; main() { cin >> n; rep(i, n) { string s; cin >> x >> s; if (s == "JPY") ans += x; else ans += x * 380000.0; dans; } printf("%.8lf\n", ans); }
#define debug_interval ',' #define dump_interval ' ' #define debug_toggle 1 //{ #pragma GCC optimize("O3") #pragma GCC target("avx") #include <bits/stdc++.h> using namespace std; #define hi cerr << "hi" << endl; #define int long long #define INT_MAX LLONG_MAX #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i <= (n); i++) #define pb push_back #define all(v) (v).begin(), (v).end() #define rall(v) (v).rbegin(), (v).rend() #define fi first #define se second #define mp make_pair #define rev reverse #define dans dump(ans) #define MOD 1000000007 #define amp(v, n) (v).count(n) ? v[n]++ : v[n] = 1 #define sysp system("pause") #define PI acos(-1) #define ins insert #define aer(v) (v).erase((v).begin(), (v).end()) //{ inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; } template <class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); } template <class... A> inline void dump() { cout << endl; } template <class... A> inline void dump_rest() { cout << endl; } template <class T, class... A> inline void dump_rest(const T &first, const A &...rest) { cout << dump_interval << first; dump_rest(rest...); } template <class T, class... A> inline void dump(const T &first, const A &...rest) { cout << first; dump_rest(rest...); } template <class... A> inline void debug() { cerr << endl; } template <class... A> inline void debug_rest() { cerr << endl; } template <class T, class... A> inline void debug_rest(const T &first, const A &...rest) { cerr << debug_interval << first; debug_rest(rest...); } template <class T, class... A> inline void debug(const T &first, const A &...rest) { if (debug_toggle) cerr << first, debug_rest(rest...); } //} typedef vector<int> vint; typedef pair<int, int> pint; typedef vector<pint> vpint; template <typename A, typename B> inline void chmin(A &a, B b) { if (a > b) a = b; } template <typename A, typename B> inline void chmax(A &a, B b) { if (a < b) a = b; } template <int m> class mint { private: int i; public: mint() : i(0) {} mint(int i) : i((i % m + m) % m) {} mint operator+(const mint &o) { return o.i + i; } mint operator*(const mint &o) { return o.i * i; } mint operator-() { return -i; } operator int() { return i; } }; //} int n; double x, ans; main() { cin >> n; rep(i, n) { string s; cin >> x >> s; if (s == "JPY") ans += x; else ans += x * 380000.0; // dans; } printf("%.4lf\n", ans); }
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
923,532
923,531
u130196064
cpp
p03110
#include <iostream> #include <string> using namespace std; int main() { int n; long double x; string u; cin >> n; long double sum; for (int i = 0; i < n; i++) { cin >> x >> u; if (u == "JPY") { sum += x; } else { sum += (x * 380000.0); } } cout << sum << endl; }
#include <iostream> #include <string> using namespace std; int main() { int n; long double x; string u; cin >> n; long double sum = 0; for (int i = 0; i < n; i++) { cin >> x >> u; if (u == "JPY") { sum += x; } else { sum += (x * 380000.0); } } cout << sum << endl; }
[ "variable_declaration.value.change" ]
923,559
923,560
u494546941
cpp
p03110
#include <bits/stdc++.h> using namespace std; void solve(long long N, std::vector<long double> x, std::vector<std::string> u) { long double answer = 0.0f; for (int i = 0; i < N; i++) { if (u[i] == "BTC") { answer += x[i] * 380000.0; } else { answer += x[i]; } } printf("%lf\n", answer); } int main() { long long N; scanf("%lld", &N); std::vector<long double> x(N); std::vector<std::string> u(N); for (int i = 0; i < N; i++) { scanf("%Lf", &x[i]); std::cin >> u[i]; } solve(N, std::move(x), std::move(u)); return 0; }
#include <bits/stdc++.h> using namespace std; void solve(long long N, std::vector<long double> x, std::vector<std::string> u) { long double answer = 0.0f; for (int i = 0; i < N; i++) { if (u[i] == "BTC") { answer += x[i] * 380000.0; } else { answer += x[i]; } } printf("%Lf\n", answer); } int main() { long long N; scanf("%lld", &N); std::vector<long double> x(N); std::vector<std::string> u(N); for (int i = 0; i < N; i++) { scanf("%Lf", &x[i]); std::cin >> u[i]; } solve(N, std::move(x), std::move(u)); return 0; }
[ "literal.string.change", "literal.string.case.change", "call.arguments.change", "io.output.change" ]
923,570
923,571
u167780710
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; double x[n]; string u[n]; long long a = 0; long double b = 0; for (int i = 0; i < n; i++) { cin >> x[i] >> u[i]; if (u[i] == "JPY") { a += x[i]; } else { b += x[i]; } } double ans = a + 38000 * b; cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; double x[n]; string u[n]; long long a = 0; long double b = 0; for (int i = 0; i < n; i++) { cin >> x[i] >> u[i]; if (u[i] == "JPY") { a += x[i]; } else { b += x[i]; } } double ans = a + 380000 * b; cout << ans << endl; }
[ "literal.number.change", "expression.operation.binary.change" ]
923,591
923,592
u546943614
cpp
p03109
#include <algorithm> #include <iostream> using namespace std; int main() { string S; cin >> S; string a = S.substr(5, 2); int A; if (S.at(6) == '0') { A = stoi(a) % 10; } else A = stoi(a); if (A <= 4) cout << "Heisei" << endl; else cout << "TBD" << endl; }
#include <algorithm> #include <iostream> using namespace std; int main() { string S; cin >> S; string a = S.substr(5, 2); int A; if (S.at(5) == '0') { A = stoi(a) % 10; } else A = stoi(a); if (A <= 4) cout << "Heisei" << endl; else cout << "TBD" << endl; }
[ "literal.number.change", "control_flow.branch.if.condition.change" ]
923,616
923,617
u068896454
cpp
p03109
#include "bits/stdc++.h" using namespace std; /* macro */ #define rep(i, a, b) for (int i = a; i < b; i++) #define revrep(i, a, b) for (int i = a; i > b; i--) #define int long long #define exist(s, e) ((s).find(e) != (s).end()) #define all(v) (v).begin(), (v).end() #define each(s, itr) for (auto(itr) = s.begin(); (itr) != s.end(); (itr)++) #define sum(v) accumulate(all(v), (0LL)) #define isin(a, b, c) (b <= a && a <= c) #define println cout << "\n"; #define sz(v) (int)v.size() /* alias */ template <class T> using vec = vector<T>; typedef vector<int> vi; typedef pair<int, int> pi; typedef tuple<int, int, int> ti; typedef map<int, int> mi; typedef set<int> si; /* constant */ const int inf = 1LL << 62; const int mod = 1e9 + 7; const int dx[8] = {1, 0, -1, 0, -1, 1, -1, 1}; const int dy[8] = {0, 1, 0, -1, -1, -1, 1, 1}; const string alphabet = "abcdefghijklmnopqrstuvwxyz"; /* io_method */ int input() { int tmp; cin >> tmp; return tmp; } string raw_input() { string tmp; cin >> tmp; return tmp; } template <class T> void printx(T n) { cout << n; } template <class T, class U> void printx(pair<T, U> p) { cout << "(" << p.first << "," << p.second << ")"; } template <class T, class U, class V> void printx(tuple<T, U, V> t) { cout << "{" << get<0>(t) << "," << get<1>(t) << "," << get<2>(t) << "}" << endl; } template <class T> void printx(vector<T> v) { cout << "{"; rep(i, 0, v.size()) { printx(v[i]); if (i != v.size() - 1) printx(","); } cout << "}"; } template <class T> void print(T n) { printx(n); cout << endl; } template <class T> void print(set<T> s) { cout << "{"; each(s, e) { if (e != s.begin()) printx(","); printx(*e); } cout << "}" << endl; } template <class T, class U> void print(map<T, U> mp) { cout << "{"; each(mp, e) { cout << "(" << e->first << "," << e->second << ")"; } cout << "}" << endl; } template <class T> void printans(vec<T> v) { rep(i, 0, sz(v)) { cout << v[i] << (i == sz(v) - 1 ? "" : " "); } cout << endl; } /* general_method */ template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } template <class T> T cut(T &a, int l, int r) { return T(a.begin() + l, a.begin() + r); } /* main */ int a, b, c; int tmp; void in() { char t; cin >> a >> t >> b >> t >> c; tmp = a * 100000000 + b * 10000 + c; } void solve() { if (tmp <= 201900040030) { print("Heisei"); } else { print("BTD"); } } signed main() { cin.tie(0); ios::sync_with_stdio(false); in(); solve(); }
#include "bits/stdc++.h" using namespace std; /* macro */ #define rep(i, a, b) for (int i = a; i < b; i++) #define revrep(i, a, b) for (int i = a; i > b; i--) #define int long long #define exist(s, e) ((s).find(e) != (s).end()) #define all(v) (v).begin(), (v).end() #define each(s, itr) for (auto(itr) = s.begin(); (itr) != s.end(); (itr)++) #define sum(v) accumulate(all(v), (0LL)) #define isin(a, b, c) (b <= a && a <= c) #define println cout << "\n"; #define sz(v) (int)v.size() /* alias */ template <class T> using vec = vector<T>; typedef vector<int> vi; typedef pair<int, int> pi; typedef tuple<int, int, int> ti; typedef map<int, int> mi; typedef set<int> si; /* constant */ const int inf = 1LL << 62; const int mod = 1e9 + 7; const int dx[8] = {1, 0, -1, 0, -1, 1, -1, 1}; const int dy[8] = {0, 1, 0, -1, -1, -1, 1, 1}; const string alphabet = "abcdefghijklmnopqrstuvwxyz"; /* io_method */ int input() { int tmp; cin >> tmp; return tmp; } string raw_input() { string tmp; cin >> tmp; return tmp; } template <class T> void printx(T n) { cout << n; } template <class T, class U> void printx(pair<T, U> p) { cout << "(" << p.first << "," << p.second << ")"; } template <class T, class U, class V> void printx(tuple<T, U, V> t) { cout << "{" << get<0>(t) << "," << get<1>(t) << "," << get<2>(t) << "}" << endl; } template <class T> void printx(vector<T> v) { cout << "{"; rep(i, 0, v.size()) { printx(v[i]); if (i != v.size() - 1) printx(","); } cout << "}"; } template <class T> void print(T n) { printx(n); cout << endl; } template <class T> void print(set<T> s) { cout << "{"; each(s, e) { if (e != s.begin()) printx(","); printx(*e); } cout << "}" << endl; } template <class T, class U> void print(map<T, U> mp) { cout << "{"; each(mp, e) { cout << "(" << e->first << "," << e->second << ")"; } cout << "}" << endl; } template <class T> void printans(vec<T> v) { rep(i, 0, sz(v)) { cout << v[i] << (i == sz(v) - 1 ? "" : " "); } cout << endl; } /* general_method */ template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } template <class T> T cut(T &a, int l, int r) { return T(a.begin() + l, a.begin() + r); } /* main */ int a, b, c; int tmp; void in() { char t; cin >> a >> t >> b >> t >> c; tmp = a * 100000000 + b * 10000 + c; } void solve() { if (tmp <= 201900040030) { print("Heisei"); } else { print("TBD"); } } signed main() { cin.tie(0); ios::sync_with_stdio(false); in(); solve(); }
[ "literal.string.change", "call.arguments.change", "io.output.change" ]
923,618
923,619
u828847847
cpp
p03109
#include "bits/stdc++.h" using namespace std; /* macro */ #define rep(i, a, b) for (int i = a; i < b; i++) #define revrep(i, a, b) for (int i = a; i > b; i--) #define int long long #define exist(s, e) ((s).find(e) != (s).end()) #define all(v) (v).begin(), (v).end() #define each(s, itr) for (auto(itr) = s.begin(); (itr) != s.end(); (itr)++) #define sum(v) accumulate(all(v), (0LL)) #define isin(a, b, c) (b <= a && a <= c) #define println cout << "\n"; #define sz(v) (int)v.size() /* alias */ template <class T> using vec = vector<T>; typedef vector<int> vi; typedef pair<int, int> pi; typedef tuple<int, int, int> ti; typedef map<int, int> mi; typedef set<int> si; /* constant */ const int inf = 1LL << 62; const int mod = 1e9 + 7; const int dx[8] = {1, 0, -1, 0, -1, 1, -1, 1}; const int dy[8] = {0, 1, 0, -1, -1, -1, 1, 1}; const string alphabet = "abcdefghijklmnopqrstuvwxyz"; /* io_method */ int input() { int tmp; cin >> tmp; return tmp; } string raw_input() { string tmp; cin >> tmp; return tmp; } template <class T> void printx(T n) { cout << n; } template <class T, class U> void printx(pair<T, U> p) { cout << "(" << p.first << "," << p.second << ")"; } template <class T, class U, class V> void printx(tuple<T, U, V> t) { cout << "{" << get<0>(t) << "," << get<1>(t) << "," << get<2>(t) << "}" << endl; } template <class T> void printx(vector<T> v) { cout << "{"; rep(i, 0, v.size()) { printx(v[i]); if (i != v.size() - 1) printx(","); } cout << "}"; } template <class T> void print(T n) { printx(n); cout << endl; } template <class T> void print(set<T> s) { cout << "{"; each(s, e) { if (e != s.begin()) printx(","); printx(*e); } cout << "}" << endl; } template <class T, class U> void print(map<T, U> mp) { cout << "{"; each(mp, e) { cout << "(" << e->first << "," << e->second << ")"; } cout << "}" << endl; } template <class T> void printans(vec<T> v) { rep(i, 0, sz(v)) { cout << v[i] << (i == sz(v) - 1 ? "" : " "); } cout << endl; } /* general_method */ template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } template <class T> T cut(T &a, int l, int r) { return T(a.begin() + l, a.begin() + r); } /* main */ int a, b, c; int tmp; void in() { char t; cin >> a >> t >> b >> t >> c; tmp = a * 1000000 + b * 1000 + c; } void solve() { if (tmp <= 2019004030) { print("Heisei"); } else { print("BTD"); } } signed main() { cin.tie(0); ios::sync_with_stdio(false); in(); solve(); }
#include "bits/stdc++.h" using namespace std; /* macro */ #define rep(i, a, b) for (int i = a; i < b; i++) #define revrep(i, a, b) for (int i = a; i > b; i--) #define int long long #define exist(s, e) ((s).find(e) != (s).end()) #define all(v) (v).begin(), (v).end() #define each(s, itr) for (auto(itr) = s.begin(); (itr) != s.end(); (itr)++) #define sum(v) accumulate(all(v), (0LL)) #define isin(a, b, c) (b <= a && a <= c) #define println cout << "\n"; #define sz(v) (int)v.size() /* alias */ template <class T> using vec = vector<T>; typedef vector<int> vi; typedef pair<int, int> pi; typedef tuple<int, int, int> ti; typedef map<int, int> mi; typedef set<int> si; /* constant */ const int inf = 1LL << 62; const int mod = 1e9 + 7; const int dx[8] = {1, 0, -1, 0, -1, 1, -1, 1}; const int dy[8] = {0, 1, 0, -1, -1, -1, 1, 1}; const string alphabet = "abcdefghijklmnopqrstuvwxyz"; /* io_method */ int input() { int tmp; cin >> tmp; return tmp; } string raw_input() { string tmp; cin >> tmp; return tmp; } template <class T> void printx(T n) { cout << n; } template <class T, class U> void printx(pair<T, U> p) { cout << "(" << p.first << "," << p.second << ")"; } template <class T, class U, class V> void printx(tuple<T, U, V> t) { cout << "{" << get<0>(t) << "," << get<1>(t) << "," << get<2>(t) << "}" << endl; } template <class T> void printx(vector<T> v) { cout << "{"; rep(i, 0, v.size()) { printx(v[i]); if (i != v.size() - 1) printx(","); } cout << "}"; } template <class T> void print(T n) { printx(n); cout << endl; } template <class T> void print(set<T> s) { cout << "{"; each(s, e) { if (e != s.begin()) printx(","); printx(*e); } cout << "}" << endl; } template <class T, class U> void print(map<T, U> mp) { cout << "{"; each(mp, e) { cout << "(" << e->first << "," << e->second << ")"; } cout << "}" << endl; } template <class T> void printans(vec<T> v) { rep(i, 0, sz(v)) { cout << v[i] << (i == sz(v) - 1 ? "" : " "); } cout << endl; } /* general_method */ template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } template <class T> T cut(T &a, int l, int r) { return T(a.begin() + l, a.begin() + r); } /* main */ int a, b, c; int tmp; void in() { char t; cin >> a >> t >> b >> t >> c; tmp = a * 100000000 + b * 10000 + c; } void solve() { if (tmp <= 201900040030) { print("Heisei"); } else { print("TBD"); } } signed main() { cin.tie(0); ios::sync_with_stdio(false); in(); solve(); }
[ "literal.number.change", "assignment.value.change", "expression.operation.binary.change", "control_flow.branch.if.condition.change", "literal.string.change", "call.arguments.change", "io.output.change" ]
923,620
923,619
u828847847
cpp
p03109
#include <bits/stdc++.h> using namespace std; int x, y, z; int main() { scanf("%d %d %d", &x, &y, &z); if (x < 2019) puts("Heisei"); else if (x == 2019) { if (y < 4) puts("Heisei"); else if (y == 4) { if (z < 30) puts("Heisei"); else if (z == 30) puts("Heisei"); else puts("TBD"); } else puts("TBD"); } else puts("TBD"); return 0; }
#include <bits/stdc++.h> using namespace std; int x, y, z; int main() { scanf("%d/%d/%d", &x, &y, &z); if (x < 2019) puts("Heisei"); else if (x == 2019) { if (y < 4) puts("Heisei"); else if (y == 4) { if (z < 30) puts("Heisei"); else if (z == 30) puts("Heisei"); else puts("TBD"); } else puts("TBD"); } else puts("TBD"); return 0; }
[ "literal.string.change", "call.arguments.change" ]
923,625
923,626
u210455745
cpp
p03109
#include <bits/stdc++.h> using namespace std; int main() { string S, hiduke; cin >> S; hiduke = "2019/5/1"; if (S < hiduke) { cout << "Heisei" << endl; //入力した日付が4月30日までなら平成 } if (S >= hiduke) { cout << "TBD" << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { string S, hiduke; cin >> S; hiduke = "2019/05/01"; if (S < hiduke) { cout << "Heisei" << endl; //入力した日付が4月30日までなら平成 } if (S >= hiduke) { cout << "TBD" << endl; } }
[ "literal.string.change", "assignment.value.change" ]
923,631
923,632
u015874763
cpp
p03109
#include "bits/stdc++.h" using namespace std; typedef long long ll; #define INF (1 << 30) #define INFLL (1ll << 60) typedef pair<int, int> P; typedef pair<int, P> E; #define MOD (1000000007ll) #define l_ength size void mul_mod(ll &a, ll b) { a *= b; a %= MOD; } void add_mod(ll &a, ll b) { b += MOD; a += b; a %= MOD; } int main(void) { int y, m, d, i; string s; cin >> s; for (i = 0; i < 10; ++i) { s[i] -= '0'; } y = s[0] * 1000 + s[1] * 100 + s[2] * 10 + s[3]; m = s[5] * 10 + s[6]; d = s[8] * 10 + s[9]; if (y > 2019) { cout << "TDB" << endl; } else if (y < 2019) { cout << "Heisei" << endl; } else if (m > 4) { cout << "TDB" << endl; } else if (m < 4) { cout << "Heisei" << endl; } else if (d > 30) { cout << "TDB" << endl; } else { cout << "Heisei" << endl; } return 0; }
#include "bits/stdc++.h" using namespace std; typedef long long ll; #define INF (1 << 30) #define INFLL (1ll << 60) typedef pair<int, int> P; typedef pair<int, P> E; #define MOD (1000000007ll) #define l_ength size void mul_mod(ll &a, ll b) { a *= b; a %= MOD; } void add_mod(ll &a, ll b) { b += MOD; a += b; a %= MOD; } int main(void) { int y, m, d, i; string s; cin >> s; for (i = 0; i < 10; ++i) { s[i] -= '0'; } y = s[0] * 1000 + s[1] * 100 + s[2] * 10 + s[3]; m = s[5] * 10 + s[6]; d = s[8] * 10 + s[9]; if (y > 2019) { cout << "TBD" << endl; } else if (y < 2019) { cout << "Heisei" << endl; } else if (m > 4) { cout << "TBD" << endl; } else if (m < 4) { cout << "Heisei" << endl; } else if (d > 30) { cout << "TBD" << endl; } else { cout << "Heisei" << endl; } return 0; }
[ "literal.string.change", "io.output.change" ]
923,665
923,666
u548624367
cpp
p03109
#include <cstdio> #include <iostream> using namespace std; int main() { int year, month, day; scanf("%d/%d/%d", &year, &month, &day); if (day >= 30) cout << "Heisei" << endl; else cout << "TBD" << endl; }
#include <cstdio> #include <iostream> using namespace std; int main() { int year, month, day; scanf("%d/%d/%d", &year, &month, &day); if (month <= 4) cout << "Heisei" << endl; else cout << "TBD" << endl; }
[]
923,667
923,668
u766858540
cpp
p03109
#include <cstdio> #include <iostream> using namespace std; int main() { int year, month, day; scanf("%d/%d/%d", &year, &month, &day); if (day == 30) cout << "Heisei" << endl; else cout << "TBD" << endl; }
#include <cstdio> #include <iostream> using namespace std; int main() { int year, month, day; scanf("%d/%d/%d", &year, &month, &day); if (month <= 4) cout << "Heisei" << endl; else cout << "TBD" << endl; }
[]
923,669
923,668
u766858540
cpp
p03109
#include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <iostream> #include <numeric> #include <string> #include <vector> using namespace std; typedef long long ll; int main() { string s; cin >> s; if (s >= "2019/04/30") { cout << "Heisei" << endl; } else { cout << "TBD" << endl; } return 0; }
#include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <iostream> #include <numeric> #include <string> #include <vector> using namespace std; typedef long long ll; int main() { string s; cin >> s; if (s <= "2019/04/30") { cout << "Heisei" << endl; } else { cout << "TBD" << endl; } return 0; }
[ "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
923,670
923,671
u223160139
cpp
p03109
#include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <iostream> #include <numeric> #include <string> #include <vector> using namespace std; typedef long long ll; int main() { string s; cin >> s; if (s >= "2019/4/30") { cout << "Heisei" << endl; } else { cout << "TBD" << endl; } return 0; }
#include <algorithm> #include <cmath> #include <cstdlib> #include <cstring> #include <iostream> #include <numeric> #include <string> #include <vector> using namespace std; typedef long long ll; int main() { string s; cin >> s; if (s <= "2019/04/30") { cout << "Heisei" << endl; } else { cout << "TBD" << endl; } return 0; }
[ "misc.opposites", "expression.operator.compare.change", "control_flow.branch.if.condition.change", "literal.string.change" ]
923,672
923,671
u223160139
cpp
p03109
#include <algorithm> #include <complex> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <string.h> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < n; i++) #define RREP(i, n) for (int i = (n)-1; i >= 0; i--) #define FOR(i, b, e) for (int i = b; i < e; i++) #define to_bit(i) static_cast<bitset<8>>(i) #define INF (1 << 28) #define EPS 1e-9 typedef long long ll; typedef unsigned long long ull; typedef vector<int> VI; typedef vector<string> VS; typedef pair<int, int> PII; typedef pair<long long, long long> PLL; typedef queue<int> QI; typedef priority_queue<int> maxpq; typedef priority_queue<int, vector<int>, greater<int>> minpq; struct edge { int to, cost; }; int gcd(int a, int b) { if (a % b == 0) { return (b); } else { return (gcd(b, a % b)); } }; int lcm(int m, int n) { if ((0 == m) || (0 == n)) { return 0; } return ((m / gcd(m, n)) * n); }; unsigned long long comb(long n, long m) { unsigned long long c = 1; m = (n - m < m ? n - m : m); for (long ns = n - m + 1, ms = 1; ms <= m; ns++, ms++) { c *= ns; c /= ms; } return c; }; void cp(int a1[], int a2[], int l) { REP(i, l) a2[i] = a1[i]; }; void cp(string a1[], string a2[], int l) { REP(i, l) a2[i] = a1[i]; }; double sq(double d) { return d * d; }; int sq(int i) { return i * i; }; double sqdist(int x1, int y1, int x2, int y2) { double dx = x1 - x2, dy = y1 - y2; return dx * dx + dy * dy; }; bool inside(int y, int x, int h, int w) { return 0 <= y && y <= (h - 1) && 0 <= x && x <= (w - 1); }; // 線分の交差判定 bool isCross(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) { // 並行な場合 int m = (x2 - x1) * (y4 - y3) - (y2 - y1) * (x4 - x3); if (m == 0) return false; // 媒介変数の値が0より大きく1以下なら交差する、これは問題の状況によって変わるかも。 double r = (double)((y4 - y3) * (x3 - x1) - (x4 - x3) * (y3 - y1)) / m; double s = (double)((y2 - y1) * (x3 - x1) - (x2 - x1) * (y3 - y1)) / m; return (0 < r && r <= 1 && 0 < s && s <= 1); }; // 外積の計算 AB CD の内積を求める int crossProdct(int ax, int ay, int bx, int by, int cx, int cy, int dx, int dy) { int abx = bx - ax; int aby = by - ay; int cdx = dx - cx; int cdy = dy - cy; return abx * cdy - cdx * aby; }; double crossProdct(double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy) { double abx = bx - ax; double aby = by - ay; double cdx = dx - cx; double cdy = dy - cy; return abx * cdy - cdx * aby; }; double innerProduct(double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy) { double abx = bx - ax; double aby = by - ay; double cdx = dx - cx; double cdy = dy - cy; return abx * cdx + aby * cdy; }; // 三角形の内部判定 ABCの中にPがあるか判定 bool inTriangle(int ax, int ay, int bx, int by, int cx, int cy, int px, int py) { int c1 = crossProdct(ax, ay, bx, by, bx, by, px, py); int c2 = crossProdct(bx, by, cx, cy, cx, cy, px, py); int c3 = crossProdct(cx, cy, ax, ay, ax, ay, px, py); return (c1 > 0 && c2 > 0 && c3 > 0) || (c1 < 0 && c2 < 0 && c3 < 0); }; bool inTriangle(double ax, double ay, double bx, double by, double cx, double cy, double px, double py) { double c1 = crossProdct(ax, ay, bx, by, bx, by, px, py); double c2 = crossProdct(bx, by, cx, cy, cx, cy, px, py); double c3 = crossProdct(cx, cy, ax, ay, ax, ay, px, py); return (c1 > 0 && c2 > 0 && c3 > 0) || (c1 < 0 && c2 < 0 && c3 < 0); }; // 三角形の外心 void circumcenter(double ax, double ay, double bx, double by, double cx, double cy, double res[3]) { // AB AC を求める double abx = bx - ax; double aby = by - ay; double acx = cx - ax; double acy = cy - ay; double m = abx * acy - acx * aby; // 分母 m = 0 となるのは3点が一直線になるとき double s = (abx * acx + aby * acy - sq(acx) - sq(acy)) / m; // 媒介変数s res[0] = abx / 2 + s * aby / 2; res[1] = aby / 2 - s * abx / 2; // cout << res[0] << " " << res[1] << endl; res[2] = sqrt(sqdist(0, 0, res[0], res[1])); res[0] += ax; res[1] += ay; }; class BinaryIndexedTree { public: int n; vector<int> bit; BinaryIndexedTree(int _n) { n = _n; bit.resize(n + 1, 0); } int sum(int i) { int sum = 0; while (i > 0) { sum += bit[i]; i -= i & -i; } return sum; } void add(int i, int v) { while (i <= n) { bit[i] += v; i += i & -i; } } }; class UnionFindTree { public: vector<int> parent, rank; int n; std::set<int> set; // 初期化 UnionFindTree(int _n) { n = _n; for (int i = 0; i < n; i++) { parent.resize(n); rank.resize(n); parent[i] = i; rank[i] = 0; } } // 根を求める int find(int x) { if (parent[x] == x) { return x; } else { return parent[x] = find(parent[x]); } } // xとyの集合を結合 void unite(int x, int y) { x = find(x); y = find(y); if (x == y) { set.insert(x); return; } if (rank[x] < rank[y]) { parent[x] = y; set.erase(x); set.insert(y); } else { parent[y] = x; set.erase(y); set.insert(x); if (rank[x] == rank[y]) rank[x]++; } } // xとyが同じ集合か bool same(int x, int y) { return find(x) == find(y); } // 集合の数を数える int count() { return (int)set.size(); } }; // ワーシャルフロイド法 void warshallFloyd(int graph[100][100], int graph_size) { for (int mid_node = 0; mid_node < graph_size; mid_node++) for (int s_node = 0; s_node < graph_size; s_node++) for (int g_node = 0; g_node < graph_size; g_node++) if (s_node == g_node) graph[s_node][g_node] = 0; else graph[s_node][g_node] = min(graph[s_node][g_node], graph[s_node][mid_node] + graph[mid_node][g_node]); }; // d:隣接行列 n:グラフのサイズ s:始点 dist:始点からの距離が入る配列 void dijkstra(int graph[1000][1000], int node_count, int start_node, int distances[1000]) { REP(i, node_count) distances[i] = -1; distances[start_node] = 0; priority_queue<PII, vector<PII>, greater<PII>> dijkstra_pq; dijkstra_pq.push(PII(0, start_node)); while (!dijkstra_pq.empty()) { PII p = dijkstra_pq.top(); dijkstra_pq.pop(); int i = p.second; if (distances[i] < p.first) continue; for (int j = 0; j < node_count; j++) { if (graph[i][j] == -1) continue; if (distances[j] == -1) { distances[j] = distances[i] + graph[i][j]; dijkstra_pq.push(PII(distances[j], j)); } else if (distances[j] > distances[i] + graph[i][j]) { distances[j] = distances[i] + graph[i][j]; dijkstra_pq.push(PII(distances[j], j)); } } } }; // return とかの位置によってうまい具合にする int vi[4] = {-1, 1, 0, 0}, vj[4] = {0, 0, -1, 1}; void dfs2d(int i, int j, int r, int c){// 終了条件とかをここに書く REP(k, 4){int ni = i + vi[k]; int nj = j + vj[k]; if (inside(ni, nj, r, c)) { dfs2d(ni, nj, r, c); } } } ; // 高速フーリエ変換 // inverse = 1 でフーリエ変換、inverse = -1 で逆フーリエ変換 const double PI = 4.0 * atan(1.0); const complex<double> I(0, 1); void fft(complex<double> a[], int n, int inverse) { double theta = 2 * inverse * PI / n; for (int m = n; m >= 2; m >>= 1) { int mh = m >> 1; for (int i = 0; i < mh; i++) { complex<double> w = exp(i * theta * I); for (int j = i; j < n; j += m) { int k = j + mh; complex<double> x = a[j] - a[k]; a[j] += a[k]; a[k] = w * x; } } theta *= 2; } int i = 0; for (int j = 1; j < n - 1; j++) { for (int k = n >> 1; k > (i ^= k); k >>= 1) ; if (j < i) swap(a[i], a[j]); } if (inverse == -1) { complex<double> d(n, 0); REP(i, n) { a[i] = a[i] / d; } } } // 文字列分割 vector<string> splitString(const std::string &str, char sep) { std::vector<std::string> v; std::stringstream ss(str); std::string buffer; while (std::getline(ss, buffer, sep)) { v.push_back(buffer); } return v; } int main(int argc, const char *argv[]) { string str; cin >> str; vector<string> res = splitString(str, '/'); int val = stoi(res[0]) * 10000 + stoi(res[1]) * 100 + stoi(res[2]); if (val > 20194030) { cout << "TBD" << endl; } else { cout << "Heisei" << endl; } }
#include <algorithm> #include <complex> #include <cstdio> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <sstream> #include <stack> #include <string.h> #include <string> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < n; i++) #define RREP(i, n) for (int i = (n)-1; i >= 0; i--) #define FOR(i, b, e) for (int i = b; i < e; i++) #define to_bit(i) static_cast<bitset<8>>(i) #define INF (1 << 28) #define EPS 1e-9 typedef long long ll; typedef unsigned long long ull; typedef vector<int> VI; typedef vector<string> VS; typedef pair<int, int> PII; typedef pair<long long, long long> PLL; typedef queue<int> QI; typedef priority_queue<int> maxpq; typedef priority_queue<int, vector<int>, greater<int>> minpq; struct edge { int to, cost; }; int gcd(int a, int b) { if (a % b == 0) { return (b); } else { return (gcd(b, a % b)); } }; int lcm(int m, int n) { if ((0 == m) || (0 == n)) { return 0; } return ((m / gcd(m, n)) * n); }; unsigned long long comb(long n, long m) { unsigned long long c = 1; m = (n - m < m ? n - m : m); for (long ns = n - m + 1, ms = 1; ms <= m; ns++, ms++) { c *= ns; c /= ms; } return c; }; void cp(int a1[], int a2[], int l) { REP(i, l) a2[i] = a1[i]; }; void cp(string a1[], string a2[], int l) { REP(i, l) a2[i] = a1[i]; }; double sq(double d) { return d * d; }; int sq(int i) { return i * i; }; double sqdist(int x1, int y1, int x2, int y2) { double dx = x1 - x2, dy = y1 - y2; return dx * dx + dy * dy; }; bool inside(int y, int x, int h, int w) { return 0 <= y && y <= (h - 1) && 0 <= x && x <= (w - 1); }; // 線分の交差判定 bool isCross(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4) { // 並行な場合 int m = (x2 - x1) * (y4 - y3) - (y2 - y1) * (x4 - x3); if (m == 0) return false; // 媒介変数の値が0より大きく1以下なら交差する、これは問題の状況によって変わるかも。 double r = (double)((y4 - y3) * (x3 - x1) - (x4 - x3) * (y3 - y1)) / m; double s = (double)((y2 - y1) * (x3 - x1) - (x2 - x1) * (y3 - y1)) / m; return (0 < r && r <= 1 && 0 < s && s <= 1); }; // 外積の計算 AB CD の内積を求める int crossProdct(int ax, int ay, int bx, int by, int cx, int cy, int dx, int dy) { int abx = bx - ax; int aby = by - ay; int cdx = dx - cx; int cdy = dy - cy; return abx * cdy - cdx * aby; }; double crossProdct(double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy) { double abx = bx - ax; double aby = by - ay; double cdx = dx - cx; double cdy = dy - cy; return abx * cdy - cdx * aby; }; double innerProduct(double ax, double ay, double bx, double by, double cx, double cy, double dx, double dy) { double abx = bx - ax; double aby = by - ay; double cdx = dx - cx; double cdy = dy - cy; return abx * cdx + aby * cdy; }; // 三角形の内部判定 ABCの中にPがあるか判定 bool inTriangle(int ax, int ay, int bx, int by, int cx, int cy, int px, int py) { int c1 = crossProdct(ax, ay, bx, by, bx, by, px, py); int c2 = crossProdct(bx, by, cx, cy, cx, cy, px, py); int c3 = crossProdct(cx, cy, ax, ay, ax, ay, px, py); return (c1 > 0 && c2 > 0 && c3 > 0) || (c1 < 0 && c2 < 0 && c3 < 0); }; bool inTriangle(double ax, double ay, double bx, double by, double cx, double cy, double px, double py) { double c1 = crossProdct(ax, ay, bx, by, bx, by, px, py); double c2 = crossProdct(bx, by, cx, cy, cx, cy, px, py); double c3 = crossProdct(cx, cy, ax, ay, ax, ay, px, py); return (c1 > 0 && c2 > 0 && c3 > 0) || (c1 < 0 && c2 < 0 && c3 < 0); }; // 三角形の外心 void circumcenter(double ax, double ay, double bx, double by, double cx, double cy, double res[3]) { // AB AC を求める double abx = bx - ax; double aby = by - ay; double acx = cx - ax; double acy = cy - ay; double m = abx * acy - acx * aby; // 分母 m = 0 となるのは3点が一直線になるとき double s = (abx * acx + aby * acy - sq(acx) - sq(acy)) / m; // 媒介変数s res[0] = abx / 2 + s * aby / 2; res[1] = aby / 2 - s * abx / 2; // cout << res[0] << " " << res[1] << endl; res[2] = sqrt(sqdist(0, 0, res[0], res[1])); res[0] += ax; res[1] += ay; }; class BinaryIndexedTree { public: int n; vector<int> bit; BinaryIndexedTree(int _n) { n = _n; bit.resize(n + 1, 0); } int sum(int i) { int sum = 0; while (i > 0) { sum += bit[i]; i -= i & -i; } return sum; } void add(int i, int v) { while (i <= n) { bit[i] += v; i += i & -i; } } }; class UnionFindTree { public: vector<int> parent, rank; int n; std::set<int> set; // 初期化 UnionFindTree(int _n) { n = _n; for (int i = 0; i < n; i++) { parent.resize(n); rank.resize(n); parent[i] = i; rank[i] = 0; } } // 根を求める int find(int x) { if (parent[x] == x) { return x; } else { return parent[x] = find(parent[x]); } } // xとyの集合を結合 void unite(int x, int y) { x = find(x); y = find(y); if (x == y) { set.insert(x); return; } if (rank[x] < rank[y]) { parent[x] = y; set.erase(x); set.insert(y); } else { parent[y] = x; set.erase(y); set.insert(x); if (rank[x] == rank[y]) rank[x]++; } } // xとyが同じ集合か bool same(int x, int y) { return find(x) == find(y); } // 集合の数を数える int count() { return (int)set.size(); } }; // ワーシャルフロイド法 void warshallFloyd(int graph[100][100], int graph_size) { for (int mid_node = 0; mid_node < graph_size; mid_node++) for (int s_node = 0; s_node < graph_size; s_node++) for (int g_node = 0; g_node < graph_size; g_node++) if (s_node == g_node) graph[s_node][g_node] = 0; else graph[s_node][g_node] = min(graph[s_node][g_node], graph[s_node][mid_node] + graph[mid_node][g_node]); }; // d:隣接行列 n:グラフのサイズ s:始点 dist:始点からの距離が入る配列 void dijkstra(int graph[1000][1000], int node_count, int start_node, int distances[1000]) { REP(i, node_count) distances[i] = -1; distances[start_node] = 0; priority_queue<PII, vector<PII>, greater<PII>> dijkstra_pq; dijkstra_pq.push(PII(0, start_node)); while (!dijkstra_pq.empty()) { PII p = dijkstra_pq.top(); dijkstra_pq.pop(); int i = p.second; if (distances[i] < p.first) continue; for (int j = 0; j < node_count; j++) { if (graph[i][j] == -1) continue; if (distances[j] == -1) { distances[j] = distances[i] + graph[i][j]; dijkstra_pq.push(PII(distances[j], j)); } else if (distances[j] > distances[i] + graph[i][j]) { distances[j] = distances[i] + graph[i][j]; dijkstra_pq.push(PII(distances[j], j)); } } } }; // return とかの位置によってうまい具合にする int vi[4] = {-1, 1, 0, 0}, vj[4] = {0, 0, -1, 1}; void dfs2d(int i, int j, int r, int c){// 終了条件とかをここに書く REP(k, 4){int ni = i + vi[k]; int nj = j + vj[k]; if (inside(ni, nj, r, c)) { dfs2d(ni, nj, r, c); } } } ; // 高速フーリエ変換 // inverse = 1 でフーリエ変換、inverse = -1 で逆フーリエ変換 const double PI = 4.0 * atan(1.0); const complex<double> I(0, 1); void fft(complex<double> a[], int n, int inverse) { double theta = 2 * inverse * PI / n; for (int m = n; m >= 2; m >>= 1) { int mh = m >> 1; for (int i = 0; i < mh; i++) { complex<double> w = exp(i * theta * I); for (int j = i; j < n; j += m) { int k = j + mh; complex<double> x = a[j] - a[k]; a[j] += a[k]; a[k] = w * x; } } theta *= 2; } int i = 0; for (int j = 1; j < n - 1; j++) { for (int k = n >> 1; k > (i ^= k); k >>= 1) ; if (j < i) swap(a[i], a[j]); } if (inverse == -1) { complex<double> d(n, 0); REP(i, n) { a[i] = a[i] / d; } } } // 文字列分割 vector<string> splitString(const std::string &str, char sep) { std::vector<std::string> v; std::stringstream ss(str); std::string buffer; while (std::getline(ss, buffer, sep)) { v.push_back(buffer); } return v; } int main(int argc, const char *argv[]) { string str; cin >> str; vector<string> res = splitString(str, '/'); int val = stoi(res[0]) * 10000 + stoi(res[1]) * 100 + stoi(res[2]); if (val > 20190430) { cout << "TBD" << endl; } else { cout << "Heisei" << endl; } }
[ "literal.number.change", "control_flow.branch.if.condition.change" ]
923,676
923,677
u293703041
cpp
p03109
#include <iostream> #include <regex> #include <vector> using namespace std; int main(int argc, const char *argv[]) { string str; cin >> str; int yy[3]; std::regex regex(R"((\d+)\/(\d+)\/(\d+))"); std::smatch match; if (std::regex_search(str, match, regex)) { int i = 0; for (auto m : match) { yy[i] = atoi(m.str().c_str()); i++; if (i >= 3) { break; } } if (yy[1] >= 5) { cout << "TBD" << endl; } else { cout << "Heisei" << endl; } } return 0; }
#include <iostream> #include <regex> #include <vector> using namespace std; int main(int argc, const char *argv[]) { string str; cin >> str; int yy[4]; std::regex regex(R"((\d+)\/(\d+)\/(\d+))"); std::smatch match; if (std::regex_search(str, match, regex)) { int i = 0; for (auto m : match) { yy[i] = atoi(m.str().c_str()); i++; if (i >= 4) { break; } } // cout << yy[1] << " " << yy[2] << " " <<yy[3] << endl; if (yy[2] >= 5) { cout << "TBD" << endl; } else { cout << "Heisei" << endl; } } return 0; }
[ "literal.number.change", "variable_declaration.array_dimensions.change", "control_flow.branch.if.condition.change", "variable_access.subscript.index.change" ]
923,685
923,686
u681358160
cpp
p03109
#include <bits/stdc++.h> using namespace std; #define FOR(i, n) for (int i = 0; i < n; i++) typedef long long ll; int main() { string s; cin >> s; if ((s[6] - '0') < 5 && (s[5] - '0') == 0) { cout << "heisei" << endl; } else { cout << "TBD" << endl; } }
#include <bits/stdc++.h> using namespace std; #define FOR(i, n) for (int i = 0; i < n; i++) typedef long long ll; int main() { string s; cin >> s; if ((s[6] - '0') < 5 && (s[5] - '0') == 0) { cout << "Heisei" << endl; } else { cout << "TBD" << endl; } }
[ "literal.string.change", "literal.string.case.change", "io.output.change" ]
923,700
923,701
u962104148
cpp
p03109
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; string head = s.substr(0, 4); string bottom = s.substr(5, 2); int heads = atoi(s.c_str()); int bottoms = atoi(s.c_str()); if (heads > 2019) { cout << "TBD" << endl; } else if (heads == 2019 && bottoms > 4) { cout << "TBD" << endl; } else cout << "Heisei" << endl; }
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; string head = s.substr(0, 4); string bottom = s.substr(5, 2); int heads = atoi(head.c_str()); int bottoms = atoi(bottom.c_str()); if (heads > 2019) { cout << "TBD" << endl; } else if (heads == 2019 && bottoms > 4) { cout << "TBD" << endl; } else cout << "Heisei" << endl; }
[ "identifier.change", "call.arguments.change" ]
923,706
923,707
u692381563
cpp
p03109
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; string head = s.substr(0, 4); string bottom = s.substr(5, 2); int heads = atoi(s.c_str()); int bottoms = atoi(s.c_str()); if (heads > 2019) { cout << "TBD" << endl; } else if (heads == 2019 && bottoms >= 4) { cout << "TBD" << endl; } else cout << "Heisei" << endl; }
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; string head = s.substr(0, 4); string bottom = s.substr(5, 2); int heads = atoi(head.c_str()); int bottoms = atoi(bottom.c_str()); if (heads > 2019) { cout << "TBD" << endl; } else if (heads == 2019 && bottoms > 4) { cout << "TBD" << endl; } else cout << "Heisei" << endl; }
[ "identifier.change", "call.arguments.change", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
923,708
923,707
u692381563
cpp
p03109
#include <cstdio> #include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; int y = (s[0] - '0') * 1000 + (s[1] - '0') * 100 + (s[2] - '0') * 10 + (s[3] - '0'); int m = (s[5] - '0') * 10 + (s[6] - '0'); int d = (s[8] - '0') * 10 + (s[9] - '0'); int flag = 0; if (y > 2019) { flag = 1; } if (y >= 2019 && m >= 4) { flag = 1; } if (y >= 2019 && m >= 4 && d > 30) { flag = 1; } if (flag == 1) { printf("TBD"); } else { printf("Heisei"); } }
#include <cstdio> #include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; int y = (s[0] - '0') * 1000 + (s[1] - '0') * 100 + (s[2] - '0') * 10 + (s[3] - '0'); int m = (s[5] - '0') * 10 + (s[6] - '0'); int d = (s[8] - '0') * 10 + (s[9] - '0'); int flag = 0; if (y > 2019) { flag = 1; } if (y >= 2019 && m > 4) { flag = 1; } if (y >= 2019 && m >= 4 && d > 30) { flag = 1; } if (flag == 1) { printf("TBD"); } else { printf("Heisei"); } }
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
923,711
923,712
u737168568
cpp
p03109
#include <cstdio> #include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; int y = (s[0] - '0') * 1000 + (s[1] - '0') * 100 + (s[2] - '0') * 10 + (s[3] - '0'); int m = (s[5] - '0') * 10 + (s[6] - '0'); int d = (s[8] - '0') * 10 + (s[9] - '0'); int flag = 0; if (y > 2019) { flag = 1; } if (y > 2019 && m > 4) { flag = 1; } if (y > 2019 && m > 4 && d > 30) { flag = 1; } if (flag == 1) { printf("TBD"); } else { printf("Heisei"); } }
#include <cstdio> #include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; int y = (s[0] - '0') * 1000 + (s[1] - '0') * 100 + (s[2] - '0') * 10 + (s[3] - '0'); int m = (s[5] - '0') * 10 + (s[6] - '0'); int d = (s[8] - '0') * 10 + (s[9] - '0'); int flag = 0; if (y > 2019) { flag = 1; } if (y >= 2019 && m > 4) { flag = 1; } if (y >= 2019 && m >= 4 && d > 30) { flag = 1; } if (flag == 1) { printf("TBD"); } else { printf("Heisei"); } }
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
923,713
923,712
u737168568
cpp
p03109
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; int count = 0; int start = 0; int a[3]; for (int i = 0; i < s.size(); i++) { if (s[i] == '/') { a[count] = atoi((s.substr(start, i - start)).c_str()); start = i; } } if (a[1] < 5) cout << "Heisei"; else cout << "TBD"; return 0; }
#include <iostream> #include <string> using namespace std; int main() { string s; cin >> s; int count = 0; int start = 0; int a[3]; for (int i = 0; i < s.size(); i++) { if (s[i] == '/') { a[count] = atoi((s.substr(start + 1, i - start)).c_str()); start = i; count++; } } // cout << a[1]; if (a[1] < 5) cout << "Heisei"; else cout << "TBD"; return 0; }
[ "call.arguments.add", "expression.unary.arithmetic.add" ]
923,716
923,717
u462329577
cpp
p03109
#include <iostream> using namespace std; int main() { char s[10]; int a, b, c; cin >> s; sscanf(s, "%d/%d/%d", &a, &b, &c); if (a <= 2018 || (a == 2019 && b <= 4)) { cout << "HEISEI" << endl; } else { cout << "TBD" << endl; } }
#include <iostream> using namespace std; int main() { char s[10]; int a, b, c; cin >> s; sscanf(s, "%d/%d/%d", &a, &b, &c); if (a <= 2018 || (a == 2019 && b <= 4)) { cout << "Heisei" << endl; } else { cout << "TBD" << endl; } }
[ "literal.string.change", "literal.string.case.change", "io.output.change" ]
923,734
923,735
u731175398
cpp
p03109
#include <iostream> int main() { std::string s; std::cin >> s; bool is_heisei; std::string year = s.substr(0, 4); int n = atoi(year.c_str()); if (n < 2019) { is_heisei = true; } else if (n > 2019) { is_heisei = false; } else { std::string month = s.substr(5, 2); n = atoi(month.c_str()); if (n <= 4) { is_heisei = true; } else { is_heisei = false; } } if (is_heisei) { std::cout << "heisei" << std::endl; } else { std::cout << "TBD" << std::endl; } return 0; }
#include <iostream> int main() { std::string s; std::cin >> s; bool is_heisei; std::string year = s.substr(0, 4); int n = atoi(year.c_str()); if (n < 2019) { is_heisei = true; } else if (n > 2019) { is_heisei = false; } else { std::string month = s.substr(5, 2); n = atoi(month.c_str()); if (n <= 4) { is_heisei = true; } else { is_heisei = false; } } if (is_heisei) { std::cout << "Heisei" << std::endl; } else { std::cout << "TBD" << std::endl; } return 0; }
[ "literal.string.change", "literal.string.case.change", "expression.operation.binary.change" ]
923,741
923,742
u514655285
cpp
p03110
#include <iostream> #include <string> using namespace std; int main() { int n, ans = 0; double x; string u; cin >> n; for (int i = 0; i < n; i++) { cin >> x >> u; if (u == "BTC") { ans += 38000 * x; } else { ans += x; } } printf("%.1f\n", x); return 0; }
#include <iostream> #include <string> using namespace std; int main() { int n; double ans = 0; double x; string u; cin >> n; for (int i = 0; i < n; i++) { cin >> x >> u; if (u == "BTC") { ans += 380000 * x; } else { ans += x; } } printf("%f\n", ans); return 0; }
[ "literal.number.change", "assignment.value.change", "expression.operation.binary.change", "literal.string.change", "call.arguments.change", "io.output.change", "identifier.change" ]
923,747
923,746
u273110458
cpp
p03110
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; int main() { int n; cin >> n; double ans = 0; for (int i = 0; i < n; i++) { double kane; string syu; cin >> kane >> syu; if (syu == "BTS") kane *= 380000; ans += kane; } cout << ans; return 0; }
#include <algorithm> #include <cstdio> #include <iostream> using namespace std; int main() { int n; cin >> n; double ans = 0; for (int i = 0; i < n; i++) { double kane; string syu; cin >> kane >> syu; if (syu == "BTC") kane *= 380000; ans += kane; } cout << ans; return 0; }
[ "literal.string.change", "control_flow.branch.if.condition.change" ]
923,752
923,753
u190462847
cpp
p03110
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <stack> #include <vector> using namespace std; #define int long long #define fr(s, n, i) for (int i = s; i < n; i++) #define fr_(s, n, i) for (int i = s; i >= n; i--) #define srt(v) sort(v.begin(), v.end()) #define upr(v, aim, ind) \ int ind; \ ind = (int)distance(v.begin(), upper_bound(v.begin(), v.end(), aim)); #define sz(v) (int)v.size() #define ers(v, i) v.erase(v.begin() + i) #define swp(v, i, j) \ int buf = v[j]; \ v[j] = v[i]; \ v[i] = buf; #define shout(a) cout << a << endl; #define dshout(a) printf(".%16f\n", a); #define vi vector<int> #define iinp(a) \ int a; \ cin >> a; #define sinp(a) \ string a; \ cin >> a; #define dinp(a) \ double a; \ cin >> a; int MOD = 1000000007; void solve(); signed main() { solve(); return 0; } void solve() { iinp(N) double ans = 0; fr(0, N, i) { dinp(x) sinp(u) if (u == "JPY") { ans += x; } else { ans += 380000 * x; } } dshout(ans) }
#include <algorithm> #include <cmath> #include <iostream> #include <map> #include <queue> #include <stack> #include <vector> using namespace std; #define int long long #define fr(s, n, i) for (int i = s; i < n; i++) #define fr_(s, n, i) for (int i = s; i >= n; i--) #define srt(v) sort(v.begin(), v.end()) #define upr(v, aim, ind) \ int ind; \ ind = (int)distance(v.begin(), upper_bound(v.begin(), v.end(), aim)); #define sz(v) (int)v.size() #define ers(v, i) v.erase(v.begin() + i) #define swp(v, i, j) \ int buf = v[j]; \ v[j] = v[i]; \ v[i] = buf; #define shout(a) cout << a << endl; #define dshout(a) printf("%.16f\n", a); #define vi vector<int> #define iinp(a) \ int a; \ cin >> a; #define sinp(a) \ string a; \ cin >> a; #define dinp(a) \ double a; \ cin >> a; int MOD = 1000000007; void solve(); signed main() { solve(); return 0; } void solve() { iinp(N) double ans = 0; fr(0, N, i) { dinp(x) sinp(u) if (u == "JPY") { ans += x; } else { ans += 380000 * x; } } dshout(ans) }
[ "preprocessor.define.value.change" ]
923,765
923,766
u847307807
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { double x, ans = 0.0; string s; int n; cin >> n; for (int i = 0; i < n; i++) { cin >> x >> s; if (s == "JPY") ans += x; else ans += x * 38000; } cout << fixed << setprecision(10) << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { double x, ans = 0.0; string s; int n; cin >> n; for (int i = 0; i < n; i++) { cin >> x >> s; if (s == "JPY") ans += x; else ans += x * 380000.0; } cout << fixed << setprecision(10) << ans << endl; }
[ "literal.number.change", "assignment.value.change", "expression.operation.binary.change" ]
923,771
923,772
u373958718
cpp
p03110
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; #define int long long signed main() { int n; cin >> n; double ans = 0; for (int i = 0; i < n; i++) { double p; string s; cin >> p >> s; if (s[0] == 'B') p *= 3800000; ans += p; } printf("%.6f\n", ans); }
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; #define int long long signed main() { int n; cin >> n; double ans = 0; for (int i = 0; i < n; i++) { double p; string s; cin >> p >> s; if (s[0] == 'B') p *= 380000; ans += p; } printf("%.6f\n", ans); }
[ "literal.number.change", "assignment.value.change" ]
923,780
923,781
u141968173
cpp
p03110
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> P; int main() { ll n; string u; long double ans = 0.0, x; cin >> n; for (int i = 0; i < n; i++) { cin >> x >> u; if (u == "JPY") ans += x; else ans += x * 38000.0; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> P; int main() { ll n; string u; long double ans = 0.0, x; cin >> n; for (int i = 0; i < n; i++) { cin >> x >> u; if (u == "JPY") ans += x; else ans += x * 380000.0; } cout << fixed << ans << endl; return 0; }
[ "literal.number.change", "assignment.value.change", "expression.operation.binary.change", "io.output.change" ]
923,782
923,783
u774202056
cpp
p03110
#include <bits/stdc++.h> #define rep(i, a, n) for (int i = a; i < n; i++) #define per(i, a, n) for (int i = n - 1; i >= a; i--) #define fill0(n) setfill('0') << right << setw(n) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define MAX 1000000001; using namespace std; typedef long long ll; int n; ll x; string u; int main() { std::cin >> n; ll res = 0; rep(i, 1, n + 1) { std::cin >> x >> u; if (u == "JPY") res += x; else res += x * 380000.0; } std::cout << res << '\n'; }
#include <bits/stdc++.h> #define rep(i, a, n) for (int i = a; i < n; i++) #define per(i, a, n) for (int i = n - 1; i >= a; i--) #define fill0(n) setfill('0') << right << setw(n) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define MAX 1000000001; using namespace std; typedef long long ll; int n; double x; string u; int main() { std::cin >> n; double res = 0; rep(i, 1, n + 1) { std::cin >> x >> u; if (u == "JPY") res += x; else res += x * 380000.0; } std::cout << res << '\n'; }
[ "variable_declaration.type.change" ]
923,786
923,785
u255001744
cpp
p03110
#define _CRT_SECURE_NO_WARNINGS #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> void Str2Year(char *str, int &year, int &month, int &day) { char *tp; tp = strtok(str, "/"); year = atoi(tp); tp = strtok(NULL, "/"); month = atoi(tp); tp = strtok(NULL, "/"); day = atoi(tp); } int main(void) { int N = 0; double x; char u[4] = {0}; double sum = 0; scanf("%d", &N); for (int cnt = 0; cnt < N; cnt++) { scanf("%lf %s", &x, u); if (0 == strcmp(u, "JPN")) { sum += x; } else { sum += x * 380000.0; } } printf("%f", sum); printf("\n"); return 0; }
#define _CRT_SECURE_NO_WARNINGS #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> void Str2Year(char *str, int &year, int &month, int &day) { char *tp; tp = strtok(str, "/"); year = atoi(tp); tp = strtok(NULL, "/"); month = atoi(tp); tp = strtok(NULL, "/"); day = atoi(tp); } int main(void) { int N = 0; double x; char u[4] = {0}; double sum = 0; scanf("%d", &N); for (int cnt = 0; cnt < N; cnt++) { scanf("%lf %s", &x, u); if (0 == strcmp(u, "JPY")) { sum += x; } else { sum += x * 380000.0; } } printf("%f", sum); printf("\n"); return 0; }
[ "literal.string.change", "control_flow.branch.if.condition.change" ]
923,793
923,794
u193560928
cpp
p03110
#define _CRT_SECURE_NO_WARNINGS #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> void Str2Year(char *str, int &year, int &month, int &day) { char *tp; tp = strtok(str, "/"); year = atoi(tp); tp = strtok(NULL, "/"); month = atoi(tp); tp = strtok(NULL, "/"); day = atoi(tp); } int main(void) { int N = 0; double x; char u[4] = {0}; double sum = 0; scanf("%d", &N); for (int cnt = 0; cnt < N; cnt++) { scanf("%lf %s", &x, u); if (0 == strcmp(u, "JPN")) { sum += x; } else { sum += x * 380000.0; } } printf("%f", sum); printf("\n"); return 0; }
#define _CRT_SECURE_NO_WARNINGS #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> void Str2Year(char *str, int &year, int &month, int &day) { char *tp; tp = strtok(str, "/"); year = atoi(tp); tp = strtok(NULL, "/"); month = atoi(tp); tp = strtok(NULL, "/"); day = atoi(tp); } int main(void) { int N = 0; double x; char u[4] = {0}; double sum = 0; scanf("%d", &N); for (int cnt = 0; cnt < N; cnt++) { scanf("%lf %s", &x, u); if (0 == strcmp(u, "JPY")) { sum += x; } else { sum += x * 380000.0; } } printf("%f", sum); printf("\n"); return 0; }
[ "literal.string.change", "control_flow.branch.if.condition.change" ]
923,795
923,794
u193560928
cpp
p03110
#include <iostream> #include <string> using namespace std; int main() { int N; cin >> N; double ans = 0; for (int i = 0; i < N; i++) { double num; string str; cin >> num >> str; if (str == "BTC") num *= 380000; ans += num; cout << ans << endl; } return 0; }
#include <iostream> #include <string> using namespace std; int main() { int N; cin >> N; double ans = 0; for (int i = 0; i < N; i++) { double num; string str; cin >> num >> str; if (str == "BTC") num *= 380000; ans += num; } cout << ans << endl; return 0; }
[]
923,796
923,797
u110653681
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { int N; double money = 0; cin >> N; for (int i = 0; i < N; i++) { int x; string u; cin >> x >> u; if (u == "JPY") { money += x; } else if (u == "BTC") { money += x * 380000; } } cout << money << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; double money = 0; cin >> N; for (int i = 0; i < N; i++) { double x; string u; cin >> x >> u; if (u == "JPY") { money += x; } else if (u == "BTC") { money += x * 380000; } } cout << money << endl; }
[ "variable_declaration.type.primitive.change" ]
923,803
923,804
u000598325
cpp
p03110
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n - 1; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define INF 2e9 #define ALL(v) v.begin(), v.end() #define ll long long #define GREATER greater<int>() using namespace std; string pop_back(string s) { string t = s.substr(0, s.size() - 1); return t; } int gcd(int max, int min) { if (max < min) { int tmp = max; max = min; min = tmp; } if (max % min == 0) return min; else return gcd(min, max % min); } int main(void) { int n; cin >> n; double ans = 0; for (int i = 0; i < n; i++) { double x; string s; cin >> x >> s; if (s == "JPY") ans += x; else ans += x * 380000; } printf("%f.10\n", ans); return 0; }
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n - 1; i >= 0; i--) #define FOR(i, m, n) for (int i = m; i < n; i++) #define INF 2e9 #define ALL(v) v.begin(), v.end() #define ll long long #define GREATER greater<int>() using namespace std; string pop_back(string s) { string t = s.substr(0, s.size() - 1); return t; } int gcd(int max, int min) { if (max < min) { int tmp = max; max = min; min = tmp; } if (max % min == 0) return min; else return gcd(min, max % min); } int main(void) { int n; cin >> n; double ans = 0; for (int i = 0; i < n; i++) { double x; string s; cin >> x >> s; if (s == "JPY") ans += x; else ans += x * 380000; } printf("%f", ans); return 0; }
[ "literal.string.change", "call.arguments.change", "io.output.change", "io.output.newline.remove" ]
923,807
923,808
u069035678
cpp
p03110
#include <algorithm> #include <queue> #include <stdio.h> #include <vector> using namespace std; #include <iostream> #include <string> using namespace std; int N; double x[15]; string u[15]; double e = 380000; int main() { cin >> N; int ans = 0; for (int i = 0; i < N; i++) { cin >> x[i] >> u[i]; if (u[i] == "JPY") { ans += x[i]; } else { ans += x[i] * e; } } printf("%.11f\n", ans); return 0; }
#include <algorithm> #include <queue> #include <stdio.h> #include <vector> using namespace std; #include <iostream> #include <string> using namespace std; int N; double x[15]; string u[15]; double e = 380000; int main() { cin >> N; double ans = 0; for (int i = 0; i < N; i++) { cin >> x[i] >> u[i]; if (u[i] == "JPY") { ans += x[i]; } else { ans += x[i] * e; } } printf("%.11f\n", ans); return 0; }
[ "variable_declaration.type.primitive.change" ]
923,828
923,829
u522548464
cpp
p03110
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) FOR(i, 0, n) typedef long long ll; int main() { int n; double ans = 0; rep(i, n) { double a; string b; cin >> a >> b; if (b == "JPY") { ans += a; } else { ans += a * 38000; } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) FOR(i, 0, n) typedef long long ll; int main() { int n; cin >> n; double ans = 0; rep(i, n) { double a; string b; cin >> a >> b; if (b == "JPY") { ans += a; } else { ans += a * 380000; } } cout << ans << endl; }
[ "literal.number.change", "assignment.value.change", "expression.operation.binary.change" ]
923,836
923,837
u320267096
cpp
p03110
#include "bits/stdc++.h" using namespace std; #ifdef _DEBUG #define _GLIBCXX_DEBUG #include "dump.hpp" #else #define dump(...) #endif #define int long long #define ll long long #define ll1 1ll #define ONE 1ll #define DBG 1 #define rep(i, a, b) for (int i = (a); i < (b); i++) #define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--) #define loop(n) rep(loop, (0), (n)) #define all(c) begin(c), end(c) const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f; const int MOD = (int)(1e9) + 7; const double PI = acos(-1); const double EPS = 1e-9; #define fi first #define se second #define pb push_back #define eb emplace_back using pii = pair<int, int>; // template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;} template <typename T, typename S> istream &operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; } template <typename T, typename S> ostream &operator<<(ostream &os, pair<T, S> &p) { os << p.first << " " << p.second; return os; } template <typename T> void printvv(const vector<vector<T>> &v) { cerr << endl; rep(i, 0, v.size()) rep(j, 0, v[i].size()) { if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) { cerr << "INF"; } else cerr << v[i][j]; cerr << (j == v[i].size() - 1 ? '\n' : ' '); } cerr << endl; } /* typedef __int128_t Int; std::ostream &operator<<(std::ostream &dest, __int128_t value) { std::ostream::sentry s(dest); if (s) { __uint128_t tmp = value < 0 ? -value : value; char buffer[128]; char *d = std::end(buffer); do { --d; *d = "0123456789"[tmp % 10]; tmp /= 10; } while (tmp != 0); if (value < 0) { --d; *d = '-'; } int len = std::end(buffer) - d; if (dest.rdbuf()->sputn(d, len) != len) { dest.setstate(std::ios_base::badbit); } } return dest; } __int128 parse(string &s) { __int128 ret = 0; for (int i = 0; i < s.length(); i++) if ('0' <= s[i] && s[i] <= '9') ret = 10 * ret + s[i] - '0'; return ret; } */ #ifndef _DEBUG #define printvv(...) #endif void YES(bool f) { cout << (f ? "YES" : "NO") << endl; } void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; } template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template <class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; } signed main(signed argc, char *argv[]) { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(12); int N; cin >> N; double ans = 0; rep(i, 0, N) { int x; cin >> x; string s; cin >> s; if (s == "BTC") { ans += 380000.0 * x; } else { ans += x; } } cout << ans << endl; return 0; }
#include "bits/stdc++.h" using namespace std; #ifdef _DEBUG #define _GLIBCXX_DEBUG #include "dump.hpp" #else #define dump(...) #endif #define int long long #define ll long long #define ll1 1ll #define ONE 1ll #define DBG 1 #define rep(i, a, b) for (int i = (a); i < (b); i++) #define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--) #define loop(n) rep(loop, (0), (n)) #define all(c) begin(c), end(c) const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f; const int MOD = (int)(1e9) + 7; const double PI = acos(-1); const double EPS = 1e-9; #define fi first #define se second #define pb push_back #define eb emplace_back using pii = pair<int, int>; // template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;} template <typename T, typename S> istream &operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; } template <typename T, typename S> ostream &operator<<(ostream &os, pair<T, S> &p) { os << p.first << " " << p.second; return os; } template <typename T> void printvv(const vector<vector<T>> &v) { cerr << endl; rep(i, 0, v.size()) rep(j, 0, v[i].size()) { if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) { cerr << "INF"; } else cerr << v[i][j]; cerr << (j == v[i].size() - 1 ? '\n' : ' '); } cerr << endl; } /* typedef __int128_t Int; std::ostream &operator<<(std::ostream &dest, __int128_t value) { std::ostream::sentry s(dest); if (s) { __uint128_t tmp = value < 0 ? -value : value; char buffer[128]; char *d = std::end(buffer); do { --d; *d = "0123456789"[tmp % 10]; tmp /= 10; } while (tmp != 0); if (value < 0) { --d; *d = '-'; } int len = std::end(buffer) - d; if (dest.rdbuf()->sputn(d, len) != len) { dest.setstate(std::ios_base::badbit); } } return dest; } __int128 parse(string &s) { __int128 ret = 0; for (int i = 0; i < s.length(); i++) if ('0' <= s[i] && s[i] <= '9') ret = 10 * ret + s[i] - '0'; return ret; } */ #ifndef _DEBUG #define printvv(...) #endif void YES(bool f) { cout << (f ? "YES" : "NO") << endl; } void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; } template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template <class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; } signed main(signed argc, char *argv[]) { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(12); int N; cin >> N; double ans = 0; rep(i, 0, N) { double x; cin >> x; string s; cin >> s; if (s == "BTC") { ans += 380000.0 * x; } else { ans += x; } } cout << ans << endl; return 0; }
[ "variable_declaration.type.primitive.change" ]
923,838
923,839
u570522509
cpp
p03110
#include <cstring> #include <iostream> using namespace std; int main() { int n; double m[10]; char coin[10][5]; cin >> n; for (int i = 1; i <= n; i++) cin >> m[i] >> coin[i]; double sum = 0; for (int i = 1; i <= n; i++) { if (strcmp(coin[i], "YEN") == 0) sum = sum + m[i]; else sum = sum + m[i] * 380000; } cout << sum; }
#include <cstring> #include <iostream> using namespace std; int main() { int n; double m[10]; char coin[10][5]; cin >> n; for (int i = 1; i <= n; i++) cin >> m[i] >> coin[i]; double sum = 0; for (int i = 1; i <= n; i++) { if (strcmp(coin[i], "JPY") == 0) sum = sum + m[i]; else sum = sum + m[i] * 380000; } cout << sum; }
[ "literal.string.change", "control_flow.branch.if.condition.change" ]
923,840
923,841
u437083392
cpp
p03110
#include <algorithm> #include <deque> #include <iomanip> #include <iostream> #include <math.h> #include <numeric> #include <queue> #include <stdio.h> #include <string> #include <tuple> #include <vector> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, a, b) for (int i = (a); i < (b); i++) using namespace std; int GCD(int x, int y) { return x ? GCD(y % x, x) : y; // xが0以外なら、GCD(y % x, x) の結果を返し // xが0ならyを返す } int main() { int n; cin >> n; long int sum = 0.0000000000; rep(i, n) { float x; string u; cin >> x >> u; // cout << x <<endl<< u << endl; if (u == "JPY") { sum += x; } else { x = x * 380000.0; sum += x; } cout << sum << endl; } }
#include <algorithm> #include <deque> #include <iomanip> #include <iostream> #include <math.h> #include <numeric> #include <queue> #include <stdio.h> #include <string> #include <tuple> #include <vector> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, a, b) for (int i = (a); i < (b); i++) using namespace std; int GCD(int x, int y) { return x ? GCD(y % x, x) : y; // xが0以外なら、GCD(y % x, x) の結果を返し // xが0ならyを返す } int main() { int n; cin >> n; double sum = 0.0000000000; rep(i, n) { double x; string u; cin >> x >> u; // cout << x <<endl<< u << endl; if (u == "JPY") { sum += x; } else { x = x * 380000.0; sum += x; } } cout << sum << endl; }
[ "variable_declaration.type.primitive.change", "variable_declaration.type.narrow.change" ]
923,846
923,845
u775013393
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { int n; double s, ans = 0; char c[5]; scanf("%d", &n); for (int i = 1; i <= n; i++) { scanf("%lf %s", &s, c); if (c == "JPY") ans += s; else ans += s * 380000; } printf("%.5lf", ans); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; double s, ans = 0; char c[5]; scanf("%d", &n); for (int i = 1; i <= n; i++) { scanf("%lf %s", &s, c); if (c[0] == 'J') ans += s; else ans += s * 380000; } printf("%.5lf", ans); return 0; }
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
923,854
923,855
u521747257
cpp
p03110
#include <iostream> #include <stdio.h> using namespace std; int main() { int n; cin >> n; float a[10]; string b[10]; float ans; float sum; for (int i = 1; i <= n; i++) { cin >> a[i - 2]; cin >> b[i - 2]; if (b[i - 2] == "BTC") { ans = a[i - 1] * 380000; } else { ans = a[i - 1]; } sum = sum + ans; } cout << sum << endl; return 0; }
#include <iostream> #include <stdio.h> using namespace std; int main() { int n; cin >> n; float a[10]; string b[10]; float ans; float sum = 0; for (int i = 1; i <= n; i++) { cin >> a[i - 1]; cin >> b[i - 1]; if (b[i - 1] == "BTC") { ans = a[i - 1] * 380000; } else { ans = a[i - 1]; } sum = sum + ans; } cout << sum << endl; return 0; }
[ "variable_declaration.value.change", "literal.number.change", "variable_access.subscript.index.change", "expression.operation.binary.change", "control_flow.branch.if.condition.change" ]
923,856
923,857
u506441365
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; double y; for (int i = 0; i < n; i++) { double x; cin >> x; string u; cin >> u; if (u.at(0) == 'BTC') x *= 380000; y += x; } cout << y << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; double y; for (int i = 0; i < n; i++) { double x; cin >> x; string u; cin >> u; if (u.at(0) == 'B') x *= 380000; y += x; } cout << y << endl; }
[ "literal.string.change", "control_flow.branch.if.condition.change" ]
923,862
923,863
u323481695
cpp
p03110
#include <bits/stdc++.h> using namespace std; int main() { int n, y; cin >> n; for (int i = 0; i < n; i++) { double x; cin >> x; string u; cin >> u; if (u.at(0) == 'B') x *= 380000; y += x; } cout << y << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; double y; for (int i = 0; i < n; i++) { double x; cin >> x; string u; cin >> u; if (u.at(0) == 'B') x *= 380000; y += x; } cout << y << endl; }
[ "variable_declaration.remove", "variable_declaration.add" ]
923,864
923,863
u323481695
cpp
p03110
#include "bits/stdc++.h" using namespace std; using ll = int64_t; int main() { ll N; cin >> N; long double ans = 0.0; for (ll i = 0; i < N; i++) { long double x; string u; cin >> x >> u; if (u == "JPY") { ans += x; } else { ans += x * 380000; } } printf("%.10f\n", ans); }
#include "bits/stdc++.h" using namespace std; using ll = int64_t; int main() { ll N; cin >> N; double ans = 0.0; for (ll i = 0; i < N; i++) { double x; string u; cin >> x >> u; if (u == "JPY") { ans += x; } else { ans += x * 380000; } } printf("%.10f\n", ans); }
[ "variable_declaration.type.narrow.change" ]
923,876
923,877
u456065785
cpp
p03110
#include <iostream> using namespace std; const double rate = 380000; int main() { int n; cin >> n; int x; string u; double ret = 0; for (int i = 0; i < n; i++) { cin >> x >> u; if (u == "JPY") ret += x; else ret += rate * x; } cout << ret; return 0; }
#include <iostream> using namespace std; const double rate = 380000; int main() { int n; cin >> n; double x; string u; double ret = 0; for (int i = 0; i < n; i++) { cin >> x >> u; if (u == "JPY") ret += x; else ret += rate * x; } cout << ret; return 0; }
[ "variable_declaration.type.primitive.change" ]
923,880
923,881
u809153881
cpp
p03111
#include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <fstream> //ファイルストリーム(標準入力変更用) #include <functional> //sortのgreater #include <iomanip> //setprecision(浮動小数点の出力の誤差) #include <iostream> //入出力 #include <iterator> //集合演算(積集合,和集合,差集合など) #include <map> //map(辞書) #include <numeric> //iota(整数列の生成),gcdとlcm(c++17) #include <queue> //キュー #include <set> //集合 #include <stack> //スタック #include <string> //文字列 #include <unordered_map> //イテレータあるけど順序保持しないmap #include <unordered_set> //イテレータあるけど順序保持しないset #include <utility> //pair #include <vector> //可変長配列 //名前 using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef map<string, int> msi; typedef map<string, ll> msll; typedef pair<int, int> pii; typedef pair<ll, ll> pllll; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<string> vs; typedef vector<bool> vb; typedef vector<vector<int>> vvi; typedef vector<vector<ll>> vvll; typedef vector<vector<string>> vvs; typedef vector<vector<bool>> vvb; //定数 const ll MOD = 1000000007; const ll INF = 1000000000000000000; //マクロ #define rep(i, n) for (int i = 0; i < n; i++) #define reps(i, s, e) for (int i = s; i < e; i++) #define repse(i, s, e) for (int i = s; i <= e; i++) #define rrep(i, n) for (int i = n - 1; i >= 0; i--) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define in1(x1) cin >> x1 #define in2(x1, x2) cin >> x1 >> x2 #define in3(x1, x2, x3) cin >> x1 >> x2 >> x3 #define inN(x, N) rep(i, N) in1(x[i]) #define outl(x) cout << x << endl #define out2l(x, y) cout << x << " " << y << endl //よく使う関数 template <class T> inline bool chmax(T &a, T b) { if (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 N; ll A, B, C; vll h; ll rec(int n, ll a, ll b, ll c) { if (n == N) { if (a == 0 && b == 0 && c == 0) return INF; return abs(a - A) + abs(b - B) + abs(c - C) - 30; } ll ans = rec(n + 1, a, b, c); chmin(ans, rec(n + 1, a + h[n], b, c) + 10); chmin(ans, rec(n + 1, a, b + h[n], c) + 10); chmin(ans, rec(n + 1, a, b, c + h[n]) + 10); return ans; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); //標準入力をファイルに変更 // std::ifstream in("input.txt"); // std::cin.rdbuf(in.rdbuf()); in1(N); in3(A, B, C); h.resize(N); inN(h, N); outl(rec(0, 0, 0, 0)); return 0; }
#include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <fstream> //ファイルストリーム(標準入力変更用) #include <functional> //sortのgreater #include <iomanip> //setprecision(浮動小数点の出力の誤差) #include <iostream> //入出力 #include <iterator> //集合演算(積集合,和集合,差集合など) #include <map> //map(辞書) #include <numeric> //iota(整数列の生成),gcdとlcm(c++17) #include <queue> //キュー #include <set> //集合 #include <stack> //スタック #include <string> //文字列 #include <unordered_map> //イテレータあるけど順序保持しないmap #include <unordered_set> //イテレータあるけど順序保持しないset #include <utility> //pair #include <vector> //可変長配列 //名前 using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef map<string, int> msi; typedef map<string, ll> msll; typedef pair<int, int> pii; typedef pair<ll, ll> pllll; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<string> vs; typedef vector<bool> vb; typedef vector<vector<int>> vvi; typedef vector<vector<ll>> vvll; typedef vector<vector<string>> vvs; typedef vector<vector<bool>> vvb; //定数 const ll MOD = 1000000007; const ll INF = 1000000000000000000; //マクロ #define rep(i, n) for (int i = 0; i < n; i++) #define reps(i, s, e) for (int i = s; i < e; i++) #define repse(i, s, e) for (int i = s; i <= e; i++) #define rrep(i, n) for (int i = n - 1; i >= 0; i--) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define in1(x1) cin >> x1 #define in2(x1, x2) cin >> x1 >> x2 #define in3(x1, x2, x3) cin >> x1 >> x2 >> x3 #define inN(x, N) rep(i, N) in1(x[i]) #define outl(x) cout << x << endl #define out2l(x, y) cout << x << " " << y << endl //よく使う関数 template <class T> inline bool chmax(T &a, T b) { if (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 N; ll A, B, C; vll h; ll rec(int n, ll a, ll b, ll c) { if (n == N) { if (a == 0 || b == 0 || c == 0) return INF; return abs(a - A) + abs(b - B) + abs(c - C) - 30; } ll ans = rec(n + 1, a, b, c); chmin(ans, rec(n + 1, a + h[n], b, c) + 10); chmin(ans, rec(n + 1, a, b + h[n], c) + 10); chmin(ans, rec(n + 1, a, b, c + h[n]) + 10); return ans; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); //標準入力をファイルに変更 // std::ifstream in("input.txt"); // std::cin.rdbuf(in.rdbuf()); in1(N); in3(A, B, C); h.resize(N); inN(h, N); outl(rec(0, 0, 0, 0)); return 0; }
[ "misc.opposites", "control_flow.branch.if.condition.change" ]
923,882
923,883
u889915625
cpp