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
8 values
p02927
#include <algorithm> #include <cstdio> #include <iostream> #include <string.h> using namespace std; #define MAX 9 int main(void) { int M, D, answer = 0, i, j; cin >> M >> D; for (i = 2; i < D / 10; i++) { for (j = 2; j <= MAX; j++) { if (i * j <= M) { answer++; } else { break; } } } for (j = 2; j <= M - i * 10; j++) { if (i * j <= M) { answer++; } else { break; } } cout << answer << endl; return 0; }
#include <algorithm> #include <cstdio> #include <iostream> #include <string.h> using namespace std; #define MAX 9 int main(void) { int M, D, answer = 0, i, j; cin >> M >> D; for (i = 2; i < D / 10; i++) { for (j = 2; j <= MAX; j++) { if (i * j <= M) { answer++; } else { break; } } } for (j = 2; j <= D - i * 10; j++) { if (i * j <= M) { answer++; } else { break; } } cout << answer << endl; return 0; }
[ "identifier.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
730,108
730,109
u499078067
cpp
p02927
#include <iostream> using namespace std; int main() { int M, D; cin >> M >> D; int cnt = 0; for (int im = 1; im <= M; ++im) { for (int id = 1; id <= D; ++id) { int d10 = id / 10; int d1 = id % 10; if (d1 < 1) { continue; } if (d10 < 1) { continue; } if (im == d10 * d1) { ++cnt; } } } cout << cnt << endl; }
#include <iostream> using namespace std; int main() { int M, D; cin >> M >> D; int cnt = 0; for (int im = 4; im <= M; ++im) { for (int id = 22; id <= D; ++id) { int d10 = id / 10; int d1 = id % 10; if (d1 < 2) { continue; } if (d10 < 2) { continue; } if (im == d10 * d1) { ++cnt; } } } cout << cnt << endl; }
[ "literal.number.change", "variable_declaration.value.change", "control_flow.loop.for.initializer.change", "control_flow.branch.if.condition.change" ]
730,110
730,111
u160952711
cpp
p02927
#include <bits/stdc++.h> using namespace std; #define DEBUG 0 #define nl '\n' #if DEBUG #define trace(var) \ { cerr << "Line " << __LINE__ << ": " << #var << "=" << var << nl; } #else #define trace(var) \ {} #endif #define fori(n) for (int i = 0; i < n; ++i) #define forj(n) for (int j = 0; j < n; ++j) #define fork(n) for (int k = 0; k < n; ++k) #define forl(n) for (int l = 0; l < n; ++l) typedef long long ll; typedef pair<int, int> pii; typedef vector<bool> vbool; typedef vector<int> vint; typedef vector<ll> vll; typedef long double ld; typedef vector<vector<int>> vvi; const ll N = 10010; const ll INF = 0x3f3f3f3f; const ll MOD = 1e9 + 7; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int m, d; cin >> m >> d; int ans = 0; for (int i = 22; i < d; ++i) { int tenth = i / 10; int oneth = i % 10; if (tenth >= 2 && oneth >= 2) { if (tenth * oneth <= m) ans++; } } cout << ans << nl; #if DEBUG cerr << "Time: " << (ld)clock() / CLOCKS_PER_SEC << " s" << nl; #endif return 0; }
#include <bits/stdc++.h> using namespace std; #define DEBUG 0 #define nl '\n' #if DEBUG #define trace(var) \ { cerr << "Line " << __LINE__ << ": " << #var << "=" << var << nl; } #else #define trace(var) \ {} #endif #define fori(n) for (int i = 0; i < n; ++i) #define forj(n) for (int j = 0; j < n; ++j) #define fork(n) for (int k = 0; k < n; ++k) #define forl(n) for (int l = 0; l < n; ++l) typedef long long ll; typedef pair<int, int> pii; typedef vector<bool> vbool; typedef vector<int> vint; typedef vector<ll> vll; typedef long double ld; typedef vector<vector<int>> vvi; const ll N = 10010; const ll INF = 0x3f3f3f3f; const ll MOD = 1e9 + 7; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int m, d; cin >> m >> d; int ans = 0; for (int i = 22; i <= d; ++i) { int tenth = i / 10; int oneth = i % 10; if (tenth >= 2 && oneth >= 2) { if (tenth * oneth <= m) ans++; } } cout << ans << nl; #if DEBUG cerr << "Time: " << (ld)clock() / CLOCKS_PER_SEC << " s" << nl; #endif return 0; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
730,112
730,113
u899116900
cpp
p02927
#include <iostream> using namespace std; int main() { int M, D; cin >> M >> D; int ans = 0; int d_1, d_10; for (int i = 4; i <= M; i++) { for (int d_ini = 22; d_ini <= D; d_ini++) { d_10 = d_ini / 10; d_1 = d_ini % 10; if (d_1 * d_10 == i) ans++; } } cout << ans << endl; }
#include <iostream> using namespace std; int main() { int M, D; cin >> M >> D; int ans = 0; int d_1, d_10; for (int i = 4; i <= M; i++) { for (int d_ini = 22; d_ini <= D; d_ini++) { d_10 = d_ini / 10; d_1 = d_ini % 10; if (d_1 * d_10 == i && d_1 > 1) ans++; } } cout << ans << endl; }
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
730,124
730,125
u609182361
cpp
p02927
#include <bits/stdc++.h> using namespace std; signed main() { int M; int D1; int D2; int count = 0; cin >> M >> D1; D2 = D1 % 10; D1 = D1 / 10; if (M <= 3) { cout << "0" << "\n"; } for (int i = 2; i <= M; i++) { for (int j = 2; j <= D1; j++) { if (D1 != j) { for (int k = 2; k <= 9; k++) { if (i == j * k) { count++; } } } else { for (int k = 2; k <= D2; k++) { if (i == j * k) { count++; } } } } } cout << count << "\n"; return (0); }
#include <bits/stdc++.h> using namespace std; signed main() { int M; int D1; int D2; int count = 0; cin >> M >> D1; D2 = D1 % 10; D1 = D1 / 10; if (M <= 3) { cout << "0" << "\n"; } else { for (int i = 4; i <= M; i++) { for (int j = 2; j <= D1; j++) { if (D1 != j) { for (int k = 2; k <= 9; k++) { if (i == j * k) { count++; } } } else { for (int k = 2; k <= D2; k++) { if (i == j * k) { count++; } } } } } cout << count << "\n"; } return (0); }
[ "control_flow.branch.else.add", "literal.number.change", "variable_declaration.value.change", "control_flow.loop.for.initializer.change" ]
730,126
730,127
u111405656
cpp
p02927
#include <bits/stdc++.h> using namespace std; int main() { int m, d; long long count = 0; cin >> m >> d; int o = d / 10; int s = d % 10; for (int i = 1; i <= m; i++) { int s = 0; for (int j = 2; j <= o; j++) { if (i % j == 0 && i / j < 10 && i / j >= 2) { count++; if (j == o && i / j > s) count--; // cout<<i<<' '<<j<<' '<< count<<endl; } } } cout << count << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int m, d; long long count = 0; cin >> m >> d; int o = d / 10; int s = d % 10; for (int i = 1; i <= m; i++) { for (int j = 2; j <= o; j++) { if (i % j == 0 && i / j < 10 && i / j >= 2) { count++; if (j == o && i / j > s) count--; // cout<<i<<' '<<j<<' '<< count<<endl; } } } cout << count << endl; return 0; }
[ "variable_declaration.remove" ]
730,130
730,131
u161616073
cpp
p02927
#include <algorithm> #include <array> #include <cmath> #include <cstdio> #include <deque> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> #define for0(i, n) for (int i = 0; i < (n); ++i) #define for1n(i, n) for (int i = 1; i <= (n); ++i) #define for1(i, n) for (int i = 1; i < (n); ++i) #define forn(i, n) for (int i = 0; i <= (n); ++i) #define forx(i, n, x) for (int i = (x); i < (n); ++i) using namespace std; typedef long long ll; typedef priority_queue<ll> pq; typedef priority_queue<ll, vector<ll>, greater<ll>> pql; typedef stack<ll> stk; typedef queue<ll> qu; int main(void) { int M, D; cin >> M >> D; int result = 0; for1n(i, M) { for1n(j, D) { int d1 = j % 10; int d10 = j / 10; if (d1 >= 2 && d10 == 2 && i == d1 * d10) { ++result; } } } cout << result; return 0; }
#include <algorithm> #include <array> #include <cmath> #include <cstdio> #include <deque> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> #define for0(i, n) for (int i = 0; i < (n); ++i) #define for1n(i, n) for (int i = 1; i <= (n); ++i) #define for1(i, n) for (int i = 1; i < (n); ++i) #define forn(i, n) for (int i = 0; i <= (n); ++i) #define forx(i, n, x) for (int i = (x); i < (n); ++i) using namespace std; typedef long long ll; typedef priority_queue<ll> pq; typedef priority_queue<ll, vector<ll>, greater<ll>> pql; typedef stack<ll> stk; typedef queue<ll> qu; int main(void) { int M, D; cin >> M >> D; int result = 0; for1n(i, M) { for1n(j, D) { int d1 = j % 10; int d10 = j / 10; if (d1 >= 2 && d10 >= 2 && i == d1 * d10) { ++result; } } } cout << result; return 0; }
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
730,136
730,137
u643747754
cpp
p02927
#include <bits/stdc++.h> using namespace std; int main() { int m, d, count = 0; cin >> m >> d; for (int i = 4; i <= m; i++) { for (int j = 22; j < d; j++) { int d1 = j % 10; int d10 = j / 10; if (d1 < 2) { continue; } if (d1 * d10 == i) { count++; } } } cout << count << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int m, d, count = 0; cin >> m >> d; for (int i = 4; i <= m; i++) { for (int j = 22; j <= d; j++) { int d1 = j % 10; int d10 = j / 10; if (d1 < 2) { continue; } if (d1 * d10 == i) { count++; } } } cout << count << endl; return 0; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
730,138
730,139
u203527087
cpp
p02927
#include <algorithm> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define rep(i, n) for (ll(i) = 0; (i) < (n); (i)++) #define repf(i, m, n) for (ll(i) = m; (i) < n; (i)++) #define all(v) (v).begin(), (v).end() #define ll long long #define vec(name, num) vector<ll> name((num), 0); #define op(i) cout << (i) << endl; #define opf(i) cout << fixed << setprecision(10) << (i) << endl; #define ip(i) cin >> (i); #define opN cout << "No" << endl; #define opY cout << "Yes" << endl; #define opP cout << "Possible" << endl; #define opI cout << "Impossible" << endl; #define mat(name, fnum, snum) \ ; \ vector<vector<ll>> name((fnum), vector<ll>((snum), 0)); #define matC(name, fnum, snum) \ ; \ vector<vector<char>> name((fnum), vector<char>((snum), 0)); #define debugP \ int debug_point; \ cin >> debug_point; #define FI first #define SE second const ll MOD = 1e9 + 7; // void solve(long long M, long long D) { ll cnt = 0; repf(i, 1, M + 1) { repf(j, 1, D) { if (i == (j / 10) * (j % 10) && j / 10 >= 2 && j % 10 >= 2) cnt++; } } op(cnt) } // Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools (tips: You // use the default template now. You can remove this line by using your custom // template) int main() { long long M; scanf("%lld", &M); long long D; scanf("%lld", &D); solve(M, D); return 0; }
#include <algorithm> #include <climits> #include <cmath> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using namespace std; #define rep(i, n) for (ll(i) = 0; (i) < (n); (i)++) #define repf(i, m, n) for (ll(i) = m; (i) < n; (i)++) #define all(v) (v).begin(), (v).end() #define ll long long #define vec(name, num) vector<ll> name((num), 0); #define op(i) cout << (i) << endl; #define opf(i) cout << fixed << setprecision(10) << (i) << endl; #define ip(i) cin >> (i); #define opN cout << "No" << endl; #define opY cout << "Yes" << endl; #define opP cout << "Possible" << endl; #define opI cout << "Impossible" << endl; #define mat(name, fnum, snum) \ ; \ vector<vector<ll>> name((fnum), vector<ll>((snum), 0)); #define matC(name, fnum, snum) \ ; \ vector<vector<char>> name((fnum), vector<char>((snum), 0)); #define debugP \ int debug_point; \ cin >> debug_point; #define FI first #define SE second const ll MOD = 1e9 + 7; // void solve(long long M, long long D) { ll cnt = 0; repf(i, 1, M + 1) { repf(j, 1, D + 1) { if (i == (j / 10) * (j % 10) && j / 10 >= 2 && j % 10 >= 2) cnt++; } } op(cnt) } // Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools (tips: You // use the default template now. You can remove this line by using your custom // template) int main() { long long M; scanf("%lld", &M); long long D; scanf("%lld", &D); solve(M, D); return 0; }
[ "expression.operation.binary.add" ]
730,142
730,143
u190234543
cpp
p02927
#include <bits/stdc++.h> using namespace std; #define ll long long int main(void) { ll m, d; cin >> m >> d; ll cnt = 0; for (int i = 0; i < d; i++) { ll a = i % 10, b = i / 10; if (a >= 2 && b >= 2 && a * b <= m) cnt++; } cout << cnt << endl; return 0; }
#include <bits/stdc++.h> using namespace std; #define ll long long int main(void) { ll m, d; cin >> m >> d; ll cnt = 0; for (int i = 1; i <= d; i++) { ll a = i % 10, b = i / 10; if (a >= 2 && b >= 2 && a * b <= m) cnt++; } cout << cnt << endl; return 0; }
[ "literal.number.change", "variable_declaration.value.change", "control_flow.loop.for.initializer.change", "expression.off_by_one", "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
730,154
730,155
u030848580
cpp
p02927
// include //------------------------------------------ #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; // conversion //------------------------------------------ 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(); } // math //------------------------------------------- template <class T> inline T sqr(T x) { return x * x; } // typedef //------------------------------------------ typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef long long LL; // container util //------------------------------------------ #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define PB push_back #define MP make_pair #define SZ(a) int((a).size()) #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 EXISTch(s, c) \ ((((s).find_first_of(c)) != std::string::npos) ? 1 : 0) // cがあれば1 if(1) #define SORT(c) sort((c).begin(), (c).end()) #define REP(i, n) for (int i = 0; i < (int)n; ++i) #define FOR(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) // constant //-------------------------------------------- const double EPS = 1e-10; const double PI = acos(-1.0); const int INF = (int)1000000007; const LL MOD = (LL)1000000007; // 10^9+7 const LL INF2 = (LL)100000000000000000; // 10^18 int main() { int m, d; cin >> m >> d; int ans = 0; for (int i = 1; i < m + 1; i++) { for (int j = 1; j < d + 1; j++) { int x = j / 10; int y = j % 10; if (x < 2 || y < 2) continue; if (m == (x * y)) ans++; } } cout << ans << endl; return 0; }
// include //------------------------------------------ #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; // conversion //------------------------------------------ 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(); } // math //------------------------------------------- template <class T> inline T sqr(T x) { return x * x; } // typedef //------------------------------------------ typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef long long LL; // container util //------------------------------------------ #define ALL(a) (a).begin(), (a).end() #define RALL(a) (a).rbegin(), (a).rend() #define PB push_back #define MP make_pair #define SZ(a) int((a).size()) #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 EXISTch(s, c) \ ((((s).find_first_of(c)) != std::string::npos) ? 1 : 0) // cがあれば1 if(1) #define SORT(c) sort((c).begin(), (c).end()) #define REP(i, n) for (int i = 0; i < (int)n; ++i) #define FOR(i, c) \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i) // constant //-------------------------------------------- const double EPS = 1e-10; const double PI = acos(-1.0); const int INF = (int)1000000007; const LL MOD = (LL)1000000007; // 10^9+7 const LL INF2 = (LL)100000000000000000; // 10^18 int main() { int m, d; cin >> m >> d; int ans = 0; for (int i = 1; i < m + 1; i++) { for (int j = 1; j < d + 1; j++) { int x = j / 10; int y = j % 10; if (x < 2 || y < 2) continue; if (i == (x * y)) ans++; } } cout << ans << endl; return 0; }
[ "identifier.change", "control_flow.branch.if.condition.change" ]
730,158
730,159
u874996917
cpp
p02927
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define LLINF 9223372036854775807 #define MOD ll(1e9 + 7) #define all(x) (x).begin(), (x).end() #define dbg(x) cerr << #x << ": " << x << endl int main() { int m, d; cin >> m >> d; int ans = 0; for (int i = 1; i <= m; i++) { for (int j = 1; j <= d; j++) { int d1 = j % 10; int d2 = j / 10; if (d1 >= 2 && d2 >= 2 && d1 * d2 == m) { ans++; } } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define LLINF 9223372036854775807 #define MOD ll(1e9 + 7) #define all(x) (x).begin(), (x).end() #define dbg(x) cerr << #x << ": " << x << endl int main() { int m, d; cin >> m >> d; int ans = 0; for (int i = 1; i <= m; i++) { for (int j = 1; j <= d; j++) { int d1 = j % 10; int d2 = j / 10; if (d1 >= 2 && d2 >= 2 && d1 * d2 == i) { ans++; } } } cout << ans << endl; return 0; }
[ "identifier.change", "control_flow.branch.if.condition.change" ]
730,162
730,163
u677421794
cpp
p02927
#include <iostream> using namespace std; int main() { int M, D; cin >> M >> D; int maxD10 = D / 10; int ans = 0; for (int d10 = 2; d10 <= maxD10; ++d10) { int maxD1 = D - d10 * 10; for (int d1 = 2; d1 < 9 && d1 <= maxD1; ++d1) { if (d1 * d10 <= M) { ++ans; } } } cout << ans << endl; return 0; }
#include <iostream> using namespace std; int main() { int M, D; cin >> M >> D; int maxD10 = D / 10; int ans = 0; for (int d10 = 2; d10 <= maxD10; ++d10) { int maxD1 = D - d10 * 10; for (int d1 = 2; d1 <= 9 && d1 <= maxD1; ++d1) { if (d1 * d10 <= M) { ++ans; } } } cout << ans << endl; return 0; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
730,164
730,165
u851470173
cpp
p02927
#include <algorithm> #include <climits> #include <cmath> #include <csignal> #include <cstdio> #include <cstdlib> #include <iomanip> #include <iostream> #include <queue> #include <string> #include <vector> using ll = long long; using namespace std; int main() { int m = 0, d = 0; cin >> m >> d; int cnt = 0; for (int i = 1; i <= d; i++) { int buf = (i / 10) * (i & 10); if (i / 10 < 2 || i % 10 < 2) { continue; } if (buf > 0 && buf <= m) { cnt++; } } cout << cnt << endl; return 0; }
#include <algorithm> #include <climits> #include <cmath> #include <csignal> #include <cstdio> #include <cstdlib> #include <iomanip> #include <iostream> #include <queue> #include <string> #include <vector> using ll = long long; using namespace std; int main() { int m = 0, d = 0; cin >> m >> d; int cnt = 0; for (int i = 1; i <= d; i++) { int buf = (i / 10) * (i % 10); if (i / 10 < 2 || i % 10 < 2) { continue; } if (buf > 0 && buf <= m) { cnt++; } } cout << cnt << endl; return 0; }
[ "expression.operation.binary.change" ]
730,170
730,171
u324549724
cpp
p02927
//↓template↓ #include "bits/stdc++.h" using namespace std; #define Would #define you #define all(n) n.begin(), n.end() #define rall(n) n.rbegin(), n.rend() typedef long long ll; const ll INF = 1e18; const ll MOD = 1e9 + 7; const double EPS = 1e-10; const double pi = acos(-1); // 3.1415926535897932384626433832795028... const ll SIZE = 1 << 17; int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1}, alp[30]; ll fac[200005], finv[200005], inv[200005]; vector<ll> dij; struct edge { ll to, cost; }; vector<vector<edge>> G; ll mod_pow(ll a, ll b) { ll res = 1, mul = a; for (int i = 0; i < 31; ++i) { if (b >> i & 1) { res *= mul; res %= MOD; } mul = (mul * mul) % MOD; } return res; } void addedge(int from, int to, int cost) { G[from].push_back({to, cost}); G[to].push_back({from, cost}); } template <typename T> vector<T> make_v(size_t a) { return vector<T>(a); } template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...)); } template <typename T, typename V> typename enable_if<is_class<T>::value == 0>::type fill_v(T &t, const V &v) { t = v; } template <typename T, typename V> typename enable_if<is_class<T>::value != 0>::type fill_v(T &t, const V &v) { for (auto &e : t) fill_v(e, v); } template <typename T> void outp(vector<T> v) { for (int i = 0; i < v.size(); ++i) { cout << v[i]; if (i != v.size() - 1) { cout << " "; } } } double add(double a, double b) { if (abs(a + b) < EPS * (abs(a) + abs(b))) { return 0; } return a + b; } //↑template↑ int a, b, ans; int main() { cin >> a >> b; for (int i = 1; i <= a; ++i) { for (int j = 1; j < b; ++j) { if (j % 10 >= 2 && j >= 20 && j % 10 * (j - j % 10) / 10 == i) { ++ans; } } } cout << ans << endl; }
//↓template↓ #include "bits/stdc++.h" using namespace std; #define Would #define you #define all(n) n.begin(), n.end() #define rall(n) n.rbegin(), n.rend() typedef long long ll; const ll INF = 1e18; const ll MOD = 1e9 + 7; const double EPS = 1e-10; const double pi = acos(-1); // 3.1415926535897932384626433832795028... const ll SIZE = 1 << 17; int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1}, alp[30]; ll fac[200005], finv[200005], inv[200005]; vector<ll> dij; struct edge { ll to, cost; }; vector<vector<edge>> G; ll mod_pow(ll a, ll b) { ll res = 1, mul = a; for (int i = 0; i < 31; ++i) { if (b >> i & 1) { res *= mul; res %= MOD; } mul = (mul * mul) % MOD; } return res; } void addedge(int from, int to, int cost) { G[from].push_back({to, cost}); G[to].push_back({from, cost}); } template <typename T> vector<T> make_v(size_t a) { return vector<T>(a); } template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...)); } template <typename T, typename V> typename enable_if<is_class<T>::value == 0>::type fill_v(T &t, const V &v) { t = v; } template <typename T, typename V> typename enable_if<is_class<T>::value != 0>::type fill_v(T &t, const V &v) { for (auto &e : t) fill_v(e, v); } template <typename T> void outp(vector<T> v) { for (int i = 0; i < v.size(); ++i) { cout << v[i]; if (i != v.size() - 1) { cout << " "; } } } double add(double a, double b) { if (abs(a + b) < EPS * (abs(a) + abs(b))) { return 0; } return a + b; } //↑template↑ int a, b, ans; int main() { cin >> a >> b; for (int i = 1; i <= a; ++i) { for (int j = 1; j <= b; ++j) { if (j % 10 >= 2 && j >= 20 && j % 10 * (j - j % 10) / 10 == i) { ++ans; } } } cout << ans << endl; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
730,172
730,173
u539402331
cpp
p02927
#include <algorithm> #include <iostream> #include <map> #include <string> #include <tuple> #include <vector> #define rep(i, n) for (int i = 0; i <= int(n); i++) typedef long long ll; using namespace std; int main() { int M, D; cin >> M >> D; int ans = 0; for (int x = 2; x <= 9; x++) { for (int y = 2; y <= 9; y++) { if (x * y == M && 10 * x + y <= D) ans++; } } cout << ans << endl; }
#include <algorithm> #include <iostream> #include <map> #include <string> #include <tuple> #include <vector> #define rep(i, n) for (int i = 0; i <= int(n); i++) typedef long long ll; using namespace std; int main() { int M, D; cin >> M >> D; int ans = 0; for (int x = 2; x <= 9; x++) { for (int y = 2; y <= 9; y++) { if (x * y <= M && 10 * x + y <= D) ans++; } } cout << ans << endl; }
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
730,174
730,175
u539675863
cpp
p02927
#include <bits/stdc++.h> using namespace std; using ll = long long int; const int MAX = (int)(1e5 + 5); const ll INF = (ll)(1e10 + 5); int m, d; int ans; int main(void) { // Here your code ! scanf("%d %d", &m, &d); ans = 0; for (int i = 1; i <= m; ++i) { for (int j = 1; j <= d; ++j) { int d1 = j / 10; int d2 = j % 10; if (m == d1 * d2 && d1 >= 2 && d2 >= 2) ans += 1; } } printf("%d\n", ans); return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long int; const int MAX = (int)(1e5 + 5); const ll INF = (ll)(1e10 + 5); int m, d; int ans; int main(void) { // Here your code ! scanf("%d %d", &m, &d); ans = 0; for (int i = 1; i <= m; ++i) { for (int j = 1; j <= d; ++j) { int d1 = j / 10; int d2 = j % 10; if (i == d1 * d2 && d1 >= 2 && d2 >= 2) { ans += 1; } } } printf("%d\n", ans); return 0; }
[ "identifier.change", "control_flow.branch.if.condition.change" ]
730,176
730,177
u497422208
cpp
p02927
#include <algorithm> #include <cstdio> using namespace std; #define N 105 #define ll long long int M, D, ans; inline int rd() { int f = 1, x = 0; char c = getchar(); while (c < '0' || '9' < c) { if (c == '-') f = -1; c = getchar(); } while ('0' <= c && c <= '9') x = (x << 3) + (x << 1) + (c ^ 48), c = getchar(); return f * x; } int main() { M = rd(), D = rd(); for (int m = 4; m <= M; m++) for (int d1 = 2; d1 <= D; d1++) for (int d2 = 2; d2 <= D; d2++) { if (d1 * 10 + d2 > D) break; if (d1 * d2 == m) ans++; } printf("%d\n", ans); return 0; }
#include <algorithm> #include <cstdio> using namespace std; #define N 105 #define ll long long int M, D, ans; inline int rd() { int f = 1, x = 0; char c = getchar(); while (c < '0' || '9' < c) { if (c == '-') f = -1; c = getchar(); } while ('0' <= c && c <= '9') x = (x << 3) + (x << 1) + (c ^ 48), c = getchar(); return f * x; } int main() { M = rd(), D = rd(); for (int m = 4; m <= M; m++) for (int d1 = 2; d1 <= 9; d1++) for (int d2 = 2; d2 <= 9; d2++) { if (d1 * 10 + d2 > D) break; if (d1 * d2 == m) ans++; } printf("%d\n", ans); return 0; }
[ "identifier.replace.remove", "literal.replace.add", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
730,178
730,179
u158378528
cpp
p02927
#include <iostream> using namespace std; int main() { int m, d; cin >> m >> d; int ans = 0; for (int i = 1; i <= m; i++) { for (int j = 1; j <= d; j++) { int d1, d2; d1 = d / 10; d2 = d % 10; if (d1 > 1 && d2 > 1) { if (d1 * d2 == i) ans++; } } } cout << ans << endl; return 0; }
#include <iostream> using namespace std; int main() { int m, d; cin >> m >> d; int ans = 0; for (int i = 1; i <= m; i++) { for (int j = 1; j <= d; j++) { int d1, d2; d1 = j / 10; d2 = j % 10; if (d1 > 1 && d2 > 1) { if (d1 * d2 == i) ans++; } } } cout << ans << endl; return 0; }
[ "assignment.value.change", "identifier.change", "expression.operation.binary.change" ]
730,180
730,181
u313043608
cpp
p02927
#include <iostream> using namespace std; int main() { int m, d; cin >> m >> d; int ans = 0; for (int i = 1; i <= m; i++) { for (int j = 1; j <= d; j++) { int d1, d2; d1 = d / 10; d2 = d % 10; if (d1 > 1 && d2 > 1) { if (d1 * d2 == m) ans++; } } } cout << ans << endl; return 0; }
#include <iostream> using namespace std; int main() { int m, d; cin >> m >> d; int ans = 0; for (int i = 1; i <= m; i++) { for (int j = 1; j <= d; j++) { int d1, d2; d1 = j / 10; d2 = j % 10; if (d1 > 1 && d2 > 1) { if (d1 * d2 == i) ans++; } } } cout << ans << endl; return 0; }
[ "assignment.value.change", "identifier.change", "expression.operation.binary.change", "control_flow.branch.if.condition.change" ]
730,182
730,181
u313043608
cpp
p02927
#include <bits/stdc++.h> using namespace std; int main() { int m, d; cin >> m >> d; int cnt = 0; for (int i = 1; i <= m; i++) { for (int j = 1; j <= d; j++) { int d1 = j % 10, d2 = j / 10; if (d1 >= 2 && d2 >= 2 && d1 * d2 == m) cnt++; } } cout << cnt << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int m, d; cin >> m >> d; int cnt = 0; for (int i = 1; i <= m; i++) { for (int j = 1; j <= d; j++) { int d1 = j % 10, d2 = j / 10; if (d1 >= 2 && d2 >= 2 && d1 * d2 == i) cnt++; } } cout << cnt << endl; }
[ "identifier.change", "control_flow.branch.if.condition.change" ]
730,187
730,188
u218759384
cpp
p02927
#include <bits/stdc++.h> using namespace std; int main() { int m, d; cin >> m >> d; int cnt = 0; for (int i = 1; i <= m; i++) { for (int j = 1; j <= d; j++) { int d1 = d % 10, d2 = d / 10; if (d1 >= 2 && d2 >= 2 && d1 * d2 == m) cnt++; } } cout << cnt << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int m, d; cin >> m >> d; int cnt = 0; for (int i = 1; i <= m; i++) { for (int j = 1; j <= d; j++) { int d1 = j % 10, d2 = j / 10; if (d1 >= 2 && d2 >= 2 && d1 * d2 == i) cnt++; } } cout << cnt << endl; }
[ "identifier.change", "expression.operation.binary.change", "control_flow.branch.if.condition.change" ]
730,189
730,188
u218759384
cpp
p02927
#include <bits/stdc++.h> using namespace std; int m, d; int main() { scanf("%d%d", &m, &d); int res = 0; for (int d1 = 2; d1 <= 100; ++d1) for (int d2 = 2; d2 <= 100; ++d2) if (d1 * d2 <= m && d1 + d2 * 10 <= d) ++res; printf("%d\n", res); return 0; }
#include <bits/stdc++.h> using namespace std; int m, d; int main() { scanf("%d%d", &m, &d); int res = 0; for (int d1 = 2; d1 <= 9; ++d1) for (int d2 = 2; d2 <= 9; ++d2) if (d1 * d2 <= m && d1 + d2 * 10 <= d) ++res; printf("%d\n", res); return 0; }
[ "literal.number.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
730,201
730,202
u075739430
cpp
p02927
#include <bits/stdc++.h> using namespace std; int main() { int a, b, cnt = 0, ones, tens; cin >> a >> b; for (int j = 22; j < b; j++) { ones = j % 10; int c = j; c = c / 10; tens = c % 10; if (ones * tens <= a && ones * tens != 0 && ones >= 2) { cnt++; } } cout << cnt; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, cnt = 0, ones, tens; cin >> a >> b; for (int j = 22; j <= b; j++) { ones = j % 10; int c = j; c = c / 10; tens = c % 10; if (ones * tens <= a && ones * tens != 0 && ones >= 2) { cnt++; } } cout << cnt; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
730,205
730,206
u692691097
cpp
p02927
#include <bits/stdc++.h> #include <chrono> #define watch(x) cout << (#x) << " is " << (x) << endl #define eps 1e-9 typedef long long ll; using namespace std; const ll inf = 1e18; const int mod = 1e9 + 7; const int N = 1e5 + 5; // int a[N]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int m, d, ans = 0; cin >> m >> d; for (int i = 4; i <= m; i++) { for (int j = 2; j <= d; j++) { for (int k = 2; k <= d; k++) { if (j * k == i && j * 10 + k <= d) { ans++; // cout << j << " " << k << endl; } } } } cout << ans; return 0; } // long long vs int // pow function (+0.5) // read carefully: overflow, constraints, etc...
#include <bits/stdc++.h> #include <chrono> #define watch(x) cout << (#x) << " is " << (x) << endl #define eps 1e-9 typedef long long ll; using namespace std; const ll inf = 1e18; const int mod = 1e9 + 7; const int N = 1e5 + 5; // int a[N]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int m, d, ans = 0; cin >> m >> d; for (int i = 4; i <= m; i++) { for (int j = 2; j <= d; j++) { for (int k = 2; k < 10; k++) { if (j * k == i && j * 10 + k <= d) { ans++; // cout << j << " " << k << endl; } } } } cout << ans; return 0; } // long long vs int // pow function (+0.5) // read carefully: overflow, constraints, etc...
[ "control_flow.loop.for.condition.change" ]
730,210
730,211
u409343817
cpp
p02927
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <set> #include <sstream> #include <stack> #include <string> #include <type_traits> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef vector<ll> vl; #define FOR(i, a, b) for (ll i = (a); i < (b); i++) #define REP(i, n) FOR(i, 0, n) ll gcd(ll a, ll b) { // gcdを返す if (a == 0) { return b; } else if (b == 0) { return a; } else { if (a < b) return gcd(b, a); ll r; while ((r = a % b)) { a = b; b = r; } return b; } } ll ketasum(ll n) { //桁の数字全ての和を返す 例: 112 -> 4 ll sum = 0; if (n < 0) return 0; while (n > 0) { sum += n % 10; n /= 10; } return sum; } typedef pair<ll, ll> pair_t; bool comp(const pair_t &a, const pair_t &b) { return a.first < b.first; } void sort2vectors( vector<ll> &av, vector<ll> &bv) { // ふたつの配列をまとめてそーと A[2,1] B[3,4] -> 1,4 2,3 ll n = av.size(); vector<pair_t> p(n); vector<ll> av2(n), bv2(n); for (ll i = 0; i < n; i++) p[i] = make_pair(av[i], bv[i]); sort(p.begin(), p.end(), comp); for (ll i = 0; i < n; i++) { av2[i] = p[i].first; bv2[i] = p[i].second; } av = av2; bv = bv2; } ll facctorialMethod(ll k) { //階乗 ll sum = 1; for (ll i = 1; i <= k; ++i) { sum *= i; } return sum; } int main() { ll M, D; cin >> M >> D; ll ans = 0; for (ll d1 = 2; d1 < 10; d1++) { for (ll d10 = 2; d10 < 10; d10++) { if (D > d10 * 10 + d1 && 1 < d10 * 10 + d1) { if (M >= d1 * d10) { ans++; } } } } cout << ans << endl; }
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <set> #include <sstream> #include <stack> #include <string> #include <type_traits> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef vector<ll> vl; #define FOR(i, a, b) for (ll i = (a); i < (b); i++) #define REP(i, n) FOR(i, 0, n) ll gcd(ll a, ll b) { // gcdを返す if (a == 0) { return b; } else if (b == 0) { return a; } else { if (a < b) return gcd(b, a); ll r; while ((r = a % b)) { a = b; b = r; } return b; } } ll ketasum(ll n) { //桁の数字全ての和を返す 例: 112 -> 4 ll sum = 0; if (n < 0) return 0; while (n > 0) { sum += n % 10; n /= 10; } return sum; } typedef pair<ll, ll> pair_t; bool comp(const pair_t &a, const pair_t &b) { return a.first < b.first; } void sort2vectors( vector<ll> &av, vector<ll> &bv) { // ふたつの配列をまとめてそーと A[2,1] B[3,4] -> 1,4 2,3 ll n = av.size(); vector<pair_t> p(n); vector<ll> av2(n), bv2(n); for (ll i = 0; i < n; i++) p[i] = make_pair(av[i], bv[i]); sort(p.begin(), p.end(), comp); for (ll i = 0; i < n; i++) { av2[i] = p[i].first; bv2[i] = p[i].second; } av = av2; bv = bv2; } ll facctorialMethod(ll k) { //階乗 ll sum = 1; for (ll i = 1; i <= k; ++i) { sum *= i; } return sum; } int main() { ll M, D; cin >> M >> D; ll ans = 0; for (ll d1 = 2; d1 < 10; d1++) { for (ll d10 = 2; d10 < 10; d10++) { if (D >= d10 * 10 + d1 && 1 < d10 * 10 + d1) { if (M >= d1 * d10) { ans++; } } } } cout << ans << endl; }
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
730,212
730,213
u313994303
cpp
p02927
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int M, D; cin >> M >> D; int ans = 0; for (int m = 1; m <= M; m++) { for (int t = 2; t <= 9; t++) { if (m % t) continue; auto o = m / t; if (o < 2) continue; auto d = t * 10 + o; if (d <= D) { ans++; } } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int M, D; cin >> M >> D; int ans = 0; for (int m = 1; m <= M; m++) { for (int t = 2; t <= 9; t++) { if (m % t) continue; auto o = m / t; if (o < 2 or o > 9) continue; auto d = t * 10 + o; if (d <= D) { ans++; } } } cout << ans << endl; return 0; }
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
730,227
730,228
u500092662
cpp
p02927
///**Bismillahir Rahmanir Rahim.** #include <bits/stdc++.h> #define clr(a, v) memset(a, v, sizeof a) #define all(v) v.begin(), v.end() #define ast(v) sort(v.begin(), v.end()) #define dst(v) sort(v.begin(), v.end(), greater<int>()) #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define ass(tmp, v) tmp.assign(v.begin(), v.end()) #define rep(i, l, r) for (int i = l; i < r; i++) #define rep2(i, l, r) for (int i = l - 1; i >= r; i--) #define sf(n) scanf("%d", &n) #define sff(n, m) scanf("%d %d", &n, &m) #define sfl(n) scanf("%lld", &n) #define sfu(n) scanf("%llu", &n) #define sffl(n, m) scanf("%lld %lld", &n, &m) #define sfff(n, m, o) scanf("%d %d %d", &n, &m, &o) #define pf(n) printf("%d", n) #define sp printf(" ") #define nl printf("\n") #define prln(n) printf("%d\n", n) #define pfl(n) printf("%lld", n) #define pfu(n) printf("%llu", n) #define pb push_back #define pii pair<int, int> #define mp make_pair #define S second #define F first #define PI 3.1415926 struct greaters { bool operator()(const long &a, const long &b) const { return a > b; } }; //-----------------------------------***********************----------------------------------------------// typedef long long int ll; typedef unsigned long long int ull; using namespace std; const int N = 200050; const int mod = 1e9 + 7; int main() { // freopen("test.txt", "r", stdin); // freopen("output.txt", "w", stdout); fast; int tcase = 1, cas = 0; while (tcase--) { int m, d; cin >> m >> d; int cnt = 0; for (int i = 22; i <= m; i++) { int x = i; int a = x % 10; x /= 10; int b = x % 10; if (a >= 2 and b >= 2 and (a * b) <= m) cnt++; } cout << cnt; // printf("Case %d: %lld\n", ++cas, ans); } return 0; } //-----------------------------------***********************----------------------------------------------//
///**Bismillahir Rahmanir Rahim.** #include <bits/stdc++.h> #define clr(a, v) memset(a, v, sizeof a) #define all(v) v.begin(), v.end() #define ast(v) sort(v.begin(), v.end()) #define dst(v) sort(v.begin(), v.end(), greater<int>()) #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(0); \ cout.tie(0); #define ass(tmp, v) tmp.assign(v.begin(), v.end()) #define rep(i, l, r) for (int i = l; i < r; i++) #define rep2(i, l, r) for (int i = l - 1; i >= r; i--) #define sf(n) scanf("%d", &n) #define sff(n, m) scanf("%d %d", &n, &m) #define sfl(n) scanf("%lld", &n) #define sfu(n) scanf("%llu", &n) #define sffl(n, m) scanf("%lld %lld", &n, &m) #define sfff(n, m, o) scanf("%d %d %d", &n, &m, &o) #define pf(n) printf("%d", n) #define sp printf(" ") #define nl printf("\n") #define prln(n) printf("%d\n", n) #define pfl(n) printf("%lld", n) #define pfu(n) printf("%llu", n) #define pb push_back #define pii pair<int, int> #define mp make_pair #define S second #define F first #define PI 3.1415926 struct greaters { bool operator()(const long &a, const long &b) const { return a > b; } }; //-----------------------------------***********************----------------------------------------------// typedef long long int ll; typedef unsigned long long int ull; using namespace std; const int N = 200050; const int mod = 1e9 + 7; int main() { // freopen("test.txt", "r", stdin); // freopen("output.txt", "w", stdout); fast; int tcase = 1, cas = 0; while (tcase--) { int m, d; cin >> m >> d; int cnt = 0; for (int i = 22; i <= d; i++) { int x = i; int a = x % 10; x /= 10; int b = x % 10; if (a >= 2 and b >= 2 and (a * b) <= m) cnt++; } cout << cnt; // printf("Case %d: %lld\n", ++cas, ans); } return 0; } //-----------------------------------***********************----------------------------------------------//
[ "identifier.change", "control_flow.loop.condition.change" ]
730,229
730,230
u912245812
cpp
p02927
#include <bits/stdc++.h> using namespace std; int m, d, d1, d10, ans; int main() { cin >> m >> d; for (int i = 1; i <= m; i++) { for (int j = 10; j < d; j++) { d1 = j % 10; d10 = j / 10; if (d1 * d10 == i && d1 >= 2 && d10 >= 2) ans++; } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int m, d, d1, d10, ans; int main() { cin >> m >> d; for (int i = 1; i <= m; i++) { for (int j = 10; j <= d; j++) { d1 = j % 10; d10 = j / 10; if (d1 * d10 == i && d1 >= 2 && d10 >= 2) ans++; } } cout << ans << endl; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
730,241
730,242
u576357314
cpp
p02927
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int m, d; cin >> m >> d; if (d < 22) { cout << "0" << endl; return 0; } int ans = 0; int d1 = d % 10; int d10 = d / 10; for (int k = 1; k <= m; k++) { for (int i = 2; i < d10; i++) { for (int j = 2; j < 10; j++) { if (k == i * j) { ans++; } } } if (d1 >= 2) { for (int i = 2; i < d1; i++) { if (k == d10 * i) { ans++; } } } } cout << ans << endl; return 0; }
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int m, d; cin >> m >> d; if (d < 22) { cout << "0" << endl; return 0; } int ans = 0; int d1 = d % 10; int d10 = d / 10; for (int k = 1; k <= m; k++) { for (int i = 2; i < d10; i++) { for (int j = 2; j < 10; j++) { if (k == i * j) { ans++; } } } if (d1 >= 2) { for (int i = 2; i <= d1; i++) { if (k == d10 * i) { ans++; } } } } cout << ans << endl; return 0; }
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
730,247
730,248
u442057402
cpp
p02927
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int m, d; cin >> m >> d; if (d < 22) { cout << "0" << endl; return 0; } int ans = 0; int d1 = d % 10; int d10 = d / 10; for (int k = 1; k <= m; k++) { for (int i = 2; i < d10; i++) { for (int j = 2; j < 10; j++) { if (k == i * j) { ans++; } } } if (d1 >= 2) { for (int i = 2; i < d1; i++) { if (m == d10 * i) { ans++; } } } } cout << ans << endl; return 0; }
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int m, d; cin >> m >> d; if (d < 22) { cout << "0" << endl; return 0; } int ans = 0; int d1 = d % 10; int d10 = d / 10; for (int k = 1; k <= m; k++) { for (int i = 2; i < d10; i++) { for (int j = 2; j < 10; j++) { if (k == i * j) { ans++; } } } if (d1 >= 2) { for (int i = 2; i <= d1; i++) { if (k == d10 * i) { ans++; } } } } cout << ans << endl; return 0; }
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change", "identifier.change" ]
730,249
730,248
u442057402
cpp
p02927
#include <bits/stdc++.h> #define reg register using namespace std; typedef long long ll; const int maxn = 100005; inline ll read() { reg ll s = 0, t = 0; reg char ch = getchar(); while (!isdigit(ch)) t |= ch == '-', ch = getchar(); while (isdigit(ch)) s = (s << 1) + (s << 3) + (ch ^ 48), ch = getchar(); return t ? -s : s; } int M, d; bool used[102]; int main() { M = read(), d = read(); int ans = 0; for (reg int m = 1; m <= M; m++) { memset(used, 0, sizeof(used)); for (int i = 2; i <= sqrt(m); i++) { if (m % i == 0) { if (i + 10 * (m / i) <= d && i <= 10 && (m / i) <= 10) used[i + 10 * (m / i)] = true; if (m / i + 10 * i <= d && i <= 10 && (m / i) <= 10) used[m / i + 10 * i] = true; } } for (reg int i = 1; i <= d; i++) ans += used[i]; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> #define reg register using namespace std; typedef long long ll; const int maxn = 100005; inline ll read() { reg ll s = 0, t = 0; reg char ch = getchar(); while (!isdigit(ch)) t |= ch == '-', ch = getchar(); while (isdigit(ch)) s = (s << 1) + (s << 3) + (ch ^ 48), ch = getchar(); return t ? -s : s; } int M, d; bool used[102]; int main() { M = read(), d = read(); int ans = 0; for (reg int m = 1; m <= M; m++) { memset(used, 0, sizeof(used)); for (int i = 2; i <= sqrt(m); i++) { if (m % i == 0) { if (i + 10 * (m / i) <= d && i < 10 && (m / i) < 10) used[i + 10 * (m / i)] = true; if (m / i + 10 * i <= d && i < 10 && (m / i) < 10) used[m / i + 10 * i] = true; } } for (reg int i = 1; i <= d; i++) ans += used[i]; } cout << ans << endl; return 0; }
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
730,252
730,253
u023223236
cpp
p02927
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <numeric> #include <queue> #include <stack> #include <string> #include <vector> #define repd(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) repd(i, 0, n) typedef long long ll; using namespace std; int inputValue() { int a; cin >> a; return a; }; void inputArray(int *p, int a){rep(i, a){cin >> p[i]; } } ; void inputVector(vector<int> *p, int a) { rep(i, a) { int input; cin >> input; p->push_back(input); } } template <typename T> void output(T a, int precision) { if (precision > 0) { cout << setprecision(precision) << a << "\n"; } else { cout << a << "\n"; } } int main(int argc, const char *argv[]) { // source code int m = inputValue(); int d = inputValue(); int count = 0; repd(i, 1, m) { repd(j, 1, d) { int a = j / 10; int b = j % 10; if (a >= 2 && b >= 2 && i == a * b) { count++; } } } cout << count; return 0; }
#include <algorithm> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <numeric> #include <queue> #include <stack> #include <string> #include <vector> #define repd(i, a, b) for (int i = (a); i < (b); i++) #define rep(i, n) repd(i, 0, n) typedef long long ll; using namespace std; int inputValue() { int a; cin >> a; return a; }; void inputArray(int *p, int a){rep(i, a){cin >> p[i]; } } ; void inputVector(vector<int> *p, int a) { rep(i, a) { int input; cin >> input; p->push_back(input); } } template <typename T> void output(T a, int precision) { if (precision > 0) { cout << setprecision(precision) << a << "\n"; } else { cout << a << "\n"; } } int main(int argc, const char *argv[]) { // source code int m = inputValue(); int d = inputValue(); int count = 0; repd(i, 1, m + 1) { repd(j, 1, d + 1) { int a = j / 10; int b = j % 10; if (a >= 2 && b >= 2 && i == a * b) { count++; } } } cout << count; return 0; }
[ "expression.operation.binary.add" ]
730,256
730,257
u647592933
cpp
p02927
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <vector> long gcd(long a, long b) { long count = 0; for (long i = 22; i < b; i++) { long d1 = i % 10; long d10 = i / 10; if (d1 * d10 == a) { if (d1 >= 2 && d10 >= 2) { count++; } } } return count; } int main() { int M, D; std::cin >> M >> D; long count = 0; for (long i = 4; i <= M; i++) { count += gcd(i, D); } std::cout << count << std::endl; return 0; }
#include <algorithm> #include <cmath> #include <functional> #include <iostream> #include <vector> long gcd(long a, long b) { long count = 0; for (long i = 22; i <= b; i++) { long d1 = i % 10; long d10 = i / 10; if (d1 * d10 == a) { if (d1 >= 2 && d10 >= 2) { count++; } } } return count; } int main() { int M, D; std::cin >> M >> D; long count = 0; for (long i = 4; i <= M; i++) { count += gcd(i, D); } std::cout << count << std::endl; return 0; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
730,260
730,261
u329731898
cpp
p02927
#include <iostream> using namespace std; int main() { int M, D; cin >> M; cin >> D; int days = 0; for (int i = 4; i <= M; i++) { for (int j = 22; j <= D; j++) { if (j % 10 >= 2 && j % 10 * j / 10 == M) { days++; } } } cout << days; return 0; }
#include <iostream> using namespace std; int main() { int M, D; cin >> M; cin >> D; int days = 0; for (int i = 4; i <= M; i++) { for (int j = 22; j <= D; j++) { if (j % 10 >= 2 && (j % 10) * (j / 10) == i) { days++; } } } cout << days; return 0; }
[ "control_flow.branch.if.condition.change", "identifier.change" ]
730,262
730,263
u846661778
cpp
p02927
#include <iostream> using namespace std; int main() { int M, D; cin >> M; cin >> D; int days = 0; for (int i = 4; i <= M; i++) { for (int j = 22; j <= D; j++) { if (j / 10 >= 2 && j % 10 * j / 10 == M) { days++; } } } cout << days; return 0; }
#include <iostream> using namespace std; int main() { int M, D; cin >> M; cin >> D; int days = 0; for (int i = 4; i <= M; i++) { for (int j = 22; j <= D; j++) { if (j % 10 >= 2 && (j % 10) * (j / 10) == i) { days++; } } } cout << days; return 0; }
[ "expression.operator.arithmetic.change", "control_flow.branch.if.condition.change", "identifier.change" ]
730,264
730,263
u846661778
cpp
p02927
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int m, d, cnt = 0; cin >> m >> d; if (d < 22) { cout << 0 << "\n"; return 0; } // int a = d %10; // int b = ((d/10)%10)*10; // if(a==0) a+=10; // cout<<"a b "<<a<<" "<<b<<endl; for (int i = 2; i < d; i++) { int a = i % 10; int b = (i / 10) % 10; if ((b * 10) + (a) <= d && a >= 2 && b >= 2) { for (int k = 0; k <= m; k++) { if (a * b == k) { // cout<<a<<" "<<b<<" "<<k<<endl; cnt++; } } } } cout << cnt << "\n"; }
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int m, d, cnt = 0; cin >> m >> d; if (d < 22) { cout << 0 << "\n"; return 0; } // int a = d %10; // int b = ((d/10)%10)*10; // if(a==0) a+=10; // cout<<"a b "<<a<<" "<<b<<endl; for (int i = 0; i <= d; i++) { int a = i % 10; int b = (i / 10) % 10; if ((b * 10) + (a) <= d && a >= 2 && b >= 2) { for (int k = 1; k <= m; k++) { if (a * b == k) { // cout<<a<<" "<<b<<" "<<k<<endl; cnt++; } } } } cout << cnt << "\n"; }
[ "literal.number.change", "variable_declaration.value.change", "control_flow.loop.for.initializer.change", "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
730,268
730,269
u930494948
cpp
p02927
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int m, d, cnt = 0; cin >> m >> d; if (d < 22) { cout << 0 << "\n"; return 0; } // int a = d %10; // int b = ((d/10)%10)*10; // if(a==0) a+=10; // cout<<"a b "<<a<<" "<<b<<endl; for (int i = 2; i < d; i++) { int a = i % 10; int b = (i / 10) % 10; if ((b * 10) + (a) <= d && a >= 2 && b >= 2) { for (int k = 1; k <= m; k++) { if (a * b == k) { // cout<<a<<" "<<b<<" "<<k<<endl; cnt++; } } } } cout << cnt << "\n"; }
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int m, d, cnt = 0; cin >> m >> d; if (d < 22) { cout << 0 << "\n"; return 0; } // int a = d %10; // int b = ((d/10)%10)*10; // if(a==0) a+=10; // cout<<"a b "<<a<<" "<<b<<endl; for (int i = 0; i <= d; i++) { int a = i % 10; int b = (i / 10) % 10; if ((b * 10) + (a) <= d && a >= 2 && b >= 2) { for (int k = 1; k <= m; k++) { if (a * b == k) { // cout<<a<<" "<<b<<" "<<k<<endl; cnt++; } } } } cout << cnt << "\n"; }
[ "literal.number.change", "variable_declaration.value.change", "control_flow.loop.for.initializer.change", "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
730,270
730,269
u930494948
cpp
p02926
#include <bits/stdc++.h> #define PI 3.1415926535897932384626433832795029L using namespace std; const int INF = (int)2e9 + 1; const long long LINF = (long long)9e18 + 1; long double check_rad(long double rad) { if (rad <= -PI) { rad += 2 * PI; } else if (rad > PI) { rad -= 2 * PI; } return rad; } bool check_direction(complex<long double> comp, long double term_m, double term_p) { long double now = arg(comp); if (term_m < term_p) { if (term_m <= now && now <= term_p) return true; else return false; } else { if (term_m <= now || now <= term_p) return true; else return false; } return -1; } long double Pythagoras(long double x, long double y) { return sqrtl(powl(x, 2) + powl(y, 2)); } int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector<complex<long double>> engine(N); for (auto &v : engine) { long double in1, in2; cin >> in1 >> in2; v.real(in1); v.imag(in2); } long double max_d = 0; for (int i = 0; i < 360; i++) { long double temp_arg = check_rad((-(long double)i / 180 + 1) * (long double)PI); long double temp_plus90 = check_rad(temp_arg + PI / 2); long double temp_minus90 = check_rad(temp_arg - PI / 2); long double now_x = 0, now_y = 0; for (auto &v : engine) { if (check_direction(v, temp_minus90, temp_plus90)) { now_x += v.real(); now_y += v.imag(); } } long double now_d = Pythagoras(now_x, now_y); if (max_d < now_d) { max_d = now_d; } } cout << max_d << endl; return 0; }
#include <bits/stdc++.h> #define PI 3.1415926535897932384626433832795029L using namespace std; const int INF = (int)2e9 + 1; const long long LINF = (long long)9e18 + 1; long double check_rad(long double rad) { if (rad <= -PI) { rad += 2 * PI; } else if (rad > PI) { rad -= 2 * PI; } return rad; } bool check_direction(complex<long double> comp, long double term_m, double term_p) { long double now = arg(comp); if (term_m < term_p) { if (term_m <= now && now <= term_p) return true; else return false; } else { if (term_m <= now || now <= term_p) return true; else return false; } return -1; } long double Pythagoras(long double x, long double y) { return sqrtl(powl(x, 2) + powl(y, 2)); } int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector<complex<long double>> engine(N); for (auto &v : engine) { long double in1, in2; cin >> in1 >> in2; v.real(in1); v.imag(in2); } long double max_d = 0; for (int i = 0; i < 360; i++) { long double temp_arg = check_rad((-(long double)i / 180 + 1) * (long double)PI); long double temp_plus90 = check_rad(temp_arg + PI / 2); long double temp_minus90 = check_rad(temp_arg - PI / 2); long double now_x = 0, now_y = 0; for (auto &v : engine) { if (check_direction(v, temp_minus90, temp_plus90)) { now_x += v.real(); now_y += v.imag(); } } long double now_d = Pythagoras(now_x, now_y); if (max_d < now_d) { max_d = now_d; } } cout << setprecision(52) << max_d << endl; return 0; }
[ "io.output.change" ]
730,279
730,280
u480117549
cpp
p02926
#define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace std; typedef long long ll; typedef long double ld; #define all(a) (a).begin(), (a).end() #define EPS (1e-5) #define bit(n, k) ((n >> k) & 1) const ll Mod = 1000000007; const ll mod = 998244353; struct H { ll x, y; bool operator<(const H &b) const { if (x != b.x) return x < b.x; return y < b.y; } bool operator>(const H &b) const { if (x != b.x) return x > b.x; return y > b.y; } bool operator==(const H &b) const { return x == b.x && y == b.y; } bool operator!=(const H &b) const { return (*this) != b; } }; struct P { ll pos, cost; bool operator<(const P &b) const { return cost < b.cost; } bool operator>(const P &b) const { return cost > b.cost; } }; struct B { ll to, cost; }; struct E { ll from, to, cost; bool operator<(const E &b) const { return cost < b.cost; } bool operator>(const E &b) const { return cost > b.cost; } }; template <typename T, typename U> void chmin(T &a, U b) { if (a > b) a = b; } template <typename T, typename U> void chmax(T &a, U b) { if (a < b) a = b; } template <typename T> T max_0(T a) { if (a < 0) return 0; return a; } template <typename T> T min_0(T a) { if (a > 0) return 0; return a; } ll read() { ll u; ll k = scanf("%lld", &u); return u; } ll gcd(ll i, ll j) { if (i > j) swap(i, j); if (i == 0) return j; return gcd(j % i, i); } ll mod_pow(ll x, ll n, ll p) { ll res = 1; while (n > 0) { if (n & 1) res = res * x % p; x = x * x % p; n >>= 1; } return res; } // x^n%p const ll Inf = 3023372036854775807; const int inf = 1500000000; #define int long long //---------------------------------------------------- int n; struct A { int x, y; ld t; } a[2000]; bool operator<(A a, A b) { return a.t < b.t; } signed main() { cin >> n; for (int i = 0; i < n; i++) { cin >> a[i].x >> a[i].y; a[i].t = atan2(a[i].y, a[i].x); } sort(a, a + n); for (int i = 0; i < n; i++) { a[i + n] = a[i]; } H t{0, 0}; int ans = 0; for (int i = 0; i < n; i++) { H t = {0, 0}; for (int j = i; j < 2 * n; j++) { t.x += a[j].x, t.y += a[j].y; ans = max(ans, t.x * t.x + t.y * t.y); } } printf("%.30LF\n", (ld)sqrt(ans)); }
#define _USE_MATH_DEFINES #include <algorithm> #include <bitset> #include <climits> #include <cmath> #include <cstdio> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <unordered_map> #include <vector> using namespace std; typedef long long ll; typedef long double ld; #define all(a) (a).begin(), (a).end() #define EPS (1e-5) #define bit(n, k) ((n >> k) & 1) const ll Mod = 1000000007; const ll mod = 998244353; struct H { ll x, y; bool operator<(const H &b) const { if (x != b.x) return x < b.x; return y < b.y; } bool operator>(const H &b) const { if (x != b.x) return x > b.x; return y > b.y; } bool operator==(const H &b) const { return x == b.x && y == b.y; } bool operator!=(const H &b) const { return (*this) != b; } }; struct P { ll pos, cost; bool operator<(const P &b) const { return cost < b.cost; } bool operator>(const P &b) const { return cost > b.cost; } }; struct B { ll to, cost; }; struct E { ll from, to, cost; bool operator<(const E &b) const { return cost < b.cost; } bool operator>(const E &b) const { return cost > b.cost; } }; template <typename T, typename U> void chmin(T &a, U b) { if (a > b) a = b; } template <typename T, typename U> void chmax(T &a, U b) { if (a < b) a = b; } template <typename T> T max_0(T a) { if (a < 0) return 0; return a; } template <typename T> T min_0(T a) { if (a > 0) return 0; return a; } ll read() { ll u; ll k = scanf("%lld", &u); return u; } ll gcd(ll i, ll j) { if (i > j) swap(i, j); if (i == 0) return j; return gcd(j % i, i); } ll mod_pow(ll x, ll n, ll p) { ll res = 1; while (n > 0) { if (n & 1) res = res * x % p; x = x * x % p; n >>= 1; } return res; } // x^n%p const ll Inf = 3023372036854775807; const int inf = 1500000000; #define int long long //---------------------------------------------------- int n; struct A { int x, y; ld t; } a[2000]; bool operator<(A a, A b) { return a.t < b.t; } signed main() { cin >> n; for (int i = 0; i < n; i++) { cin >> a[i].x >> a[i].y; a[i].t = atan2(a[i].y, a[i].x); } sort(a, a + n); for (int i = 0; i < n; i++) { a[i + n] = a[i]; } H t{0, 0}; int ans = 0; for (int i = 0; i < n; i++) { H t = {0, 0}; for (int j = i; j < i + n; j++) { t.x += a[j].x, t.y += a[j].y; ans = max(ans, t.x * t.x + t.y * t.y); } } printf("%.30LF\n", (ld)sqrt(ans)); }
[ "control_flow.loop.for.condition.change" ]
730,286
730,287
u811004127
cpp
p02926
#include <bits/stdc++.h> using namespace std; #define int ll #define ll long long int #define ff first #define ss second #define u128 __int128 #define pb push_back #define N 200010 #define MOD 1000000007 int32_t main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.precision(20); int n; cin >> n; pair<int, int> po[n + 1]; for (int i = 0; i < n; ++i) { cin >> po[i].ff >> po[i].ss; } sort(po, po + n, [](auto a, auto b) { return atan2(a.ss, a.ff) < atan2(b.ss, b.ff); }); double ans = 0; for (int len = 0; len <= n; ++len) { for (int i = 0; i < n; ++i) { int ref = i; int xsum = 0, ysum = 0; for (int k = 0; k < len; ++k) { xsum += po[ref + k].ff; ysum += po[ref + k].ss; if (ref + k == n) { ref -= n; } } ans = max(ans, (double)sqrt((double)xsum * xsum + ysum * ysum)); } } cout << fixed << ans; return 0; }
#include <bits/stdc++.h> using namespace std; #define int ll #define ll long long int #define ff first #define ss second #define u128 __int128 #define pb push_back #define N 200010 #define MOD 1000000007 int32_t main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.precision(20); int n; cin >> n; pair<int, int> po[n + 1]; for (int i = 0; i < n; ++i) { cin >> po[i].ff >> po[i].ss; } sort(po, po + n, [](auto a, auto b) { return atan2(a.ss, a.ff) < atan2(b.ss, b.ff); }); double ans = 0; for (int len = 1; len <= n; ++len) { for (int i = 0; i < n; ++i) { int ref = i; int xsum = 0, ysum = 0; for (int k = 0; k < len; ++k) { xsum += po[ref + k].ff; ysum += po[ref + k].ss; if (ref + k == n - 1) { ref -= n; } } ans = max(ans, (double)sqrt((double)xsum * xsum + ysum * ysum)); } } cout << fixed << ans; return 0; }
[ "literal.number.change", "variable_declaration.value.change", "control_flow.loop.for.initializer.change", "expression.off_by_one", "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change", "misc.off_by_one" ]
730,297
730,298
u060049558
cpp
p02926
#include <algorithm> #include <cassert> #include <cmath> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string.h> #include <string> #include <unistd.h> #include <unordered_map> #include <vector> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<vl> vvl; typedef vector<vvl> vvvl; typedef vector<vi> vvi; typedef vector<vvi> vvvi; typedef vector<bool> vb; typedef vector<vector<bool>> vvb; typedef vector<vvb> vvvb; typedef vector<vvvb> vvvvb; typedef vector<string> vs; typedef vector<vs> vvs; typedef vector<vvs> vvvs; typedef vector<char> vc; typedef vector<vector<char>> vvc; typedef vector<double> vd; typedef vector<vd> vvd; typedef vector<vvd> vvvd; typedef pair<ll, ll> PL; typedef vector<PL> vpl; typedef vector<vector<PL>> vvpl; const int INF = 1001001001; const ll LINF = 1e17; const double pi = 3.1415926535897932; const string endstr = "\n"; #define FOR(i, a, b) for (ll i = (a); i < b; i++) #define RFOR(i, a, b) for (ll i = (a); i > b; i--) #define rep(i, n) for (ll i = 0; i < n; i++) #define rrep(i, n) for (ll i = n - 1; i > -1; i--) #define FORMAP(it, m) for (auto it = m.begin(); it != m.end(); it++) #define ff first #define ss second #define pb push_back #define epb emplace_back #define ALL(X) (X).begin(), (X).end() template <typename T> T gcd(T a, T b) { return (a == 0) ? b : gcd(b % a, a); } template <typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; } bool p_comp_fs(const PL p1, const PL p2) { return p1.first < p2.first; }; bool p_comp_fg(const PL p1, const PL p2) { return p1.first > p2.first; }; bool p_comp_ss(const PL p1, const PL p2) { return p1.second < p2.second; }; bool p_comp_sg(const PL p1, const PL p2) { return p1.second > p2.second; }; template <typename T> vector<T> uniquen(vector<T> vec) { sort(ALL(vec)); vec.erase(unique(vec.begin(), vec.end()), vec.end()); return vec; } inline ll popcnt(ll x) { return __builtin_popcountll((unsigned long long)x); }; template <class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } // friend bool operator<(const stc& lhs, const stc& rhs){ // return std::tie(lhs.l, lhs.r) < std::tie(rhs.l, rhs.r); //} int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); ll N; cin >> N; vd X(N), Y(N); rep(i, N) { cin >> X[i] >> Y[i]; } double ans = 0.0; ll size = 1e5; rep(i, size) { auto uc = cos(2 * pi / size * i), us = sin(2 * pi / size * i); double res = 0.0; rep(k, N) { double tmp = uc * X[k] + us * Y[k]; if (tmp > 0.0) { res += tmp; } } chmax(ans, res); } cout << fixed << setprecision(20) << ans << endstr; return 0; }
#include <algorithm> #include <cassert> #include <cmath> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string.h> #include <string> #include <unistd.h> #include <unordered_map> #include <vector> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<vl> vvl; typedef vector<vvl> vvvl; typedef vector<vi> vvi; typedef vector<vvi> vvvi; typedef vector<bool> vb; typedef vector<vector<bool>> vvb; typedef vector<vvb> vvvb; typedef vector<vvvb> vvvvb; typedef vector<string> vs; typedef vector<vs> vvs; typedef vector<vvs> vvvs; typedef vector<char> vc; typedef vector<vector<char>> vvc; typedef vector<double> vd; typedef vector<vd> vvd; typedef vector<vvd> vvvd; typedef pair<ll, ll> PL; typedef vector<PL> vpl; typedef vector<vector<PL>> vvpl; const int INF = 1001001001; const ll LINF = 1e17; const double pi = 3.1415926535897932; const string endstr = "\n"; #define FOR(i, a, b) for (ll i = (a); i < b; i++) #define RFOR(i, a, b) for (ll i = (a); i > b; i--) #define rep(i, n) for (ll i = 0; i < n; i++) #define rrep(i, n) for (ll i = n - 1; i > -1; i--) #define FORMAP(it, m) for (auto it = m.begin(); it != m.end(); it++) #define ff first #define ss second #define pb push_back #define epb emplace_back #define ALL(X) (X).begin(), (X).end() template <typename T> T gcd(T a, T b) { return (a == 0) ? b : gcd(b % a, a); } template <typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; } bool p_comp_fs(const PL p1, const PL p2) { return p1.first < p2.first; }; bool p_comp_fg(const PL p1, const PL p2) { return p1.first > p2.first; }; bool p_comp_ss(const PL p1, const PL p2) { return p1.second < p2.second; }; bool p_comp_sg(const PL p1, const PL p2) { return p1.second > p2.second; }; template <typename T> vector<T> uniquen(vector<T> vec) { sort(ALL(vec)); vec.erase(unique(vec.begin(), vec.end()), vec.end()); return vec; } inline ll popcnt(ll x) { return __builtin_popcountll((unsigned long long)x); }; template <class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; } template <class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } // friend bool operator<(const stc& lhs, const stc& rhs){ // return std::tie(lhs.l, lhs.r) < std::tie(rhs.l, rhs.r); //} int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); ll N; cin >> N; vd X(N), Y(N); rep(i, N) { cin >> X[i] >> Y[i]; } double ans = 0.0; ll size = 5 * 1e6; rep(i, size) { auto uc = cos(2 * pi / size * i), us = sin(2 * pi / size * i); double res = 0.0; rep(k, N) { double tmp = uc * X[k] + us * Y[k]; if (tmp > 0.0) { res += tmp; } } chmax(ans, res); } cout << fixed << setprecision(20) << ans << endstr; return 0; }
[ "literal.number.change" ]
730,301
730,300
u159208574
cpp
p02926
#include <bits/stdc++.h> using namespace std; #define int long long #define pi acos(-1) #define eps 1e-8 pair<int, int> a[100001]; bool cmp(pair<int, int> a, pair<int, int> b) { return atan2(1.0 * a.second, 1.0 * a.first) < atan2(1.0 * b.second, 1.0 * b.first); } signed main() { int n; scanf("%lld", &n); for (int i = 1; i <= n; i++) { scanf("%lld%lld", &a[i].first, &a[i].second); if (a[i].first == a[i].second && a[i].first == 0) n--, i--; } sort(a + 1, a + n + 1, cmp); int ans = 0; for (int i = 1; i <= n; i++) a[n + i] = a[i]; for (int i = 1; i <= n; i++) { int sumx = 0, sumy = 0; for (int j = i; j <= 2 * n; j++) { sumx += a[j].first; sumy += a[j].second; ans = max(ans, sumx * sumx + sumy * sumy); } } printf("%.20lf", sqrt(1.0 * ans)); return 0; }
#include <bits/stdc++.h> using namespace std; #define int long long #define pi acos(-1) #define eps 1e-8 pair<int, int> a[100001]; bool cmp(pair<int, int> a, pair<int, int> b) { return atan2(1.0 * a.second, 1.0 * a.first) < atan2(1.0 * b.second, 1.0 * b.first); } signed main() { int n; scanf("%lld", &n); for (int i = 1; i <= n; i++) { scanf("%lld%lld", &a[i].first, &a[i].second); if (a[i].first == a[i].second && a[i].first == 0) n--, i--; } sort(a + 1, a + n + 1, cmp); int ans = 0; for (int i = 1; i <= n; i++) a[n + i] = a[i]; for (int i = 1; i <= n; i++) { int sumx = 0, sumy = 0; for (int j = i; j < i + n; j++) { sumx += a[j].first; sumy += a[j].second; ans = max(ans, sumx * sumx + sumy * sumy); } } printf("%.20lf", sqrt(1.0 * ans)); return 0; }
[ "control_flow.loop.for.condition.change" ]
730,309
730,310
u413057858
cpp
p02926
#include <bits/stdc++.h> using namespace std; bool compare(const vector<long long> &a, const vector<long long> &b) { return atan2(a[1], a[0]) < atan2(b[1], b[0]); } int main(void) { ios::sync_with_stdio(false); cin.tie(0); int N; cin >> N; vector<vector<long long>> coords; for (int i = 0; i < N; i++) { vector<long long> coord(2); cin >> coord[0] >> coord[1]; coords.push_back(coord); } sort(coords.begin(), coords.end(), compare); long long maxDist = 0; for (int i = 0; i < N; i++) { long long x = 0, y = 0; for (int j = i; j < N; j++) { x += coords[j][0]; y += coords[j][1]; maxDist = max(maxDist, x * x + y * y); } } cout << fixed << setprecision(11) << sqrt(maxDist) << '\n'; return 0; }
#include <bits/stdc++.h> using namespace std; bool compare(const vector<long long> &a, const vector<long long> &b) { return atan2(a[1], a[0]) < atan2(b[1], b[0]); } int main(void) { ios::sync_with_stdio(false); cin.tie(0); int N; cin >> N; vector<vector<long long>> coords; for (int i = 0; i < N; i++) { vector<long long> coord(2); cin >> coord[0] >> coord[1]; coords.push_back(coord); } sort(coords.begin(), coords.end(), compare); long long maxDist = 0; for (int i = 0; i < N; i++) { long long x = 0, y = 0; for (int j = i; j < i + N; j++) { x += coords[j % N][0]; y += coords[j % N][1]; maxDist = max(maxDist, x * x + y * y); } } cout << fixed << setprecision(11) << sqrt(maxDist) << '\n'; return 0; }
[ "control_flow.loop.for.condition.change", "assignment.change" ]
730,314
730,315
u475008359
cpp
p02926
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2000, INF = 0x3f3f3f3f, M = 2e6 + 5; const ll LNF = 0x3f3f3f3f3f3f3f3f; #define rep(i, l, r) for (int i = l; i <= r; i++) #define per(i, r, l) for (int i = r; i >= l; i--) #define repe(i, u) for (int i = head[u]; i; i = nxt[i]) const double PI = M_PI; int X[N], Y[N]; int main() { ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); cout.precision(10); cout << fixed; double x, y, tx, ty; int n; cin >> n; rep(i, 1, n) cin >> X[i] >> Y[i]; double ans = 0; rep(i, 0, 99) { x = cos(2 * PI * i / 100); y = cos(2 * PI * i / 100); tx = ty = 0; rep(j, 1, n) if (x * X[j] + y * Y[j] >= 0) tx += X[j], ty += Y[j]; ans = max(ans, sqrt(tx * tx + ty * ty)); } cout << ans << '\n'; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2000, INF = 0x3f3f3f3f, M = 2e6 + 5; const ll LNF = 0x3f3f3f3f3f3f3f3f; #define rep(i, l, r) for (int i = l; i <= r; i++) #define per(i, r, l) for (int i = r; i >= l; i--) #define repe(i, u) for (int i = head[u]; i; i = nxt[i]) const double PI = M_PI; int X[N], Y[N]; int main() { ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); cout.precision(10); cout << fixed; double x, y, tx, ty; int n; cin >> n; rep(i, 1, n) cin >> X[i] >> Y[i]; double ans = 0; rep(i, 0, 99) { x = cos(2 * PI * i / 100); y = sin(2 * PI * i / 100); tx = ty = 0; rep(j, 1, n) if (x * X[j] + y * Y[j] >= 0) tx += X[j], ty += Y[j]; ans = max(ans, sqrt(tx * tx + ty * ty)); } cout << ans << '\n'; }
[ "assignment.value.change", "identifier.change", "call.function.change" ]
730,327
730,328
u667714875
cpp
p02926
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2000, INF = 0x3f3f3f3f, M = 2e6 + 5; const ll LNF = 0x3f3f3f3f3f3f3f3f; #define rep(i, l, r) for (int i = l; i <= r; i++) #define per(i, r, l) for (int i = r; i >= l; i--) #define repe(i, u) for (int i = head[u]; i; i = nxt[i]) const double PI = M_PI; int X[N], Y[N]; int main() { ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); cout.precision(12); cout << fixed; double x, y, tx, ty; int n; cin >> n; rep(i, 1, n) cin >> X[i] >> Y[i]; double ans = 0; rep(i, 0, 100) { x = cos(2 * PI * i / 100); y = cos(2 * PI * i / 100); tx = ty = 0; rep(j, 1, n) if (x * X[j] + y * Y[j] >= 0) tx += X[j], ty += Y[j]; ans = max(ans, sqrt(tx * tx + ty * ty)); } cout << ans << '\n'; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2000, INF = 0x3f3f3f3f, M = 2e6 + 5; const ll LNF = 0x3f3f3f3f3f3f3f3f; #define rep(i, l, r) for (int i = l; i <= r; i++) #define per(i, r, l) for (int i = r; i >= l; i--) #define repe(i, u) for (int i = head[u]; i; i = nxt[i]) const double PI = M_PI; int X[N], Y[N]; int main() { ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); cout.precision(10); cout << fixed; double x, y, tx, ty; int n; cin >> n; rep(i, 1, n) cin >> X[i] >> Y[i]; double ans = 0; rep(i, 0, 99) { x = cos(2 * PI * i / 100); y = sin(2 * PI * i / 100); tx = ty = 0; rep(j, 1, n) if (x * X[j] + y * Y[j] >= 0) tx += X[j], ty += Y[j]; ans = max(ans, sqrt(tx * tx + ty * ty)); } cout << ans << '\n'; }
[ "literal.number.change", "io.output.change", "call.arguments.change", "assignment.value.change", "identifier.change", "call.function.change" ]
730,329
730,328
u667714875
cpp
p02926
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2000, INF = 0x3f3f3f3f, M = 2e6 + 5; const ll LNF = 0x3f3f3f3f3f3f3f3f; #define rep(i, l, r) for (int i = l; i <= r; i++) #define per(i, r, l) for (int i = r; i >= l; i--) #define repe(i, u) for (int i = head[u]; i; i = nxt[i]) const double PI = M_PI; int X[N], Y[N]; int main() { ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); cout.precision(12); cout << fixed; double x, y, tx, ty; int n; cin >> n; rep(i, 1, n) cin >> X[i] >> Y[i]; double ans = 0; rep(i, 1, 100) { x = cos(2 * PI * i / 100); y = cos(2 * PI * i / 100); tx = ty = 0; rep(j, 1, n) if (x * X[j] + y * Y[j] >= 0) tx += X[j], ty += Y[j]; ans = max(ans, sqrt(tx * tx + ty * ty)); } cout << ans << '\n'; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2000, INF = 0x3f3f3f3f, M = 2e6 + 5; const ll LNF = 0x3f3f3f3f3f3f3f3f; #define rep(i, l, r) for (int i = l; i <= r; i++) #define per(i, r, l) for (int i = r; i >= l; i--) #define repe(i, u) for (int i = head[u]; i; i = nxt[i]) const double PI = M_PI; int X[N], Y[N]; int main() { ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); cout.precision(10); cout << fixed; double x, y, tx, ty; int n; cin >> n; rep(i, 1, n) cin >> X[i] >> Y[i]; double ans = 0; rep(i, 0, 99) { x = cos(2 * PI * i / 100); y = sin(2 * PI * i / 100); tx = ty = 0; rep(j, 1, n) if (x * X[j] + y * Y[j] >= 0) tx += X[j], ty += Y[j]; ans = max(ans, sqrt(tx * tx + ty * ty)); } cout << ans << '\n'; }
[ "literal.number.change", "io.output.change", "call.arguments.change", "assignment.value.change", "identifier.change", "call.function.change" ]
730,330
730,328
u667714875
cpp
p02926
#include <cmath> #include <iostream> using namespace std; #define df 1 const double pi = acos(-1.0); bool foword(double dx, double dy, int x, int y) { return dx * x + dy * y > 0; } long int norm(long int x, long int y) { return x * x + y * y; } int main() { if (df) printf("*debug mode*\n"); int n; cin >> n; pair<int, int> engs[n]; for (auto &eng : engs) { cin >> eng.first >> eng.second; } long int max_d = 0; for (int i = 0; i < 4000; i++) { double dx = cos(pi * i / 2000), dy = sin(pi * i / 2000); long int x = 0, y = 0, temp = 0; for (auto &eng : engs) { if (foword(dx, dy, eng.first, eng.second)) { x += eng.first; y += eng.second; temp = norm(x, y); if (max_d < temp) { max_d = temp; } } } } printf("%.15lf", sqrt(max_d)); } /// confirm df==0 ///
#include <cmath> #include <iostream> using namespace std; #define df 0 const double pi = acos(-1.0); bool foword(double dx, double dy, int x, int y) { return dx * x + dy * y > 0; } long int norm(long int x, long int y) { return x * x + y * y; } int main() { if (df) printf("*debug mode*\n"); int n; cin >> n; pair<int, int> engs[n]; for (auto &eng : engs) { cin >> eng.first >> eng.second; } long int max_d = 0; for (int i = 0; i < 4000; i++) { double dx = cos(pi * i / 2000), dy = sin(pi * i / 2000); long int x = 0, y = 0, temp = 0; for (auto &eng : engs) { if (foword(dx, dy, eng.first, eng.second)) { x += eng.first; y += eng.second; temp = norm(x, y); if (max_d < temp) { max_d = temp; } } } } printf("%.15lf", sqrt(max_d)); } /// confirm df==0 ///
[ "preprocessor.define.value.change", "literal.integer.change" ]
730,336
730,337
u014847113
cpp
p02926
#include <bits/stdc++.h> using namespace std; typedef long long ll; const double pi = 3.141592653589793238462643383279; int main() { int N; cin >> N; vector<double> x(N); vector<double> y(N); for (int i = 0; i < N; i++) { cin >> x[i] >> y[i]; } double ans = 0.0; for (int i = 0; i < 4000; i++) { double s = cos(((double)i * pi) * 0.0005); double t = sin(((double)i * pi) * 0.0005); double X = 0.0; double Y = 0.0; for (int i = 0; i < N; i++) { if (s * x[i] + t * y[i] >= 0.0) { X += x[i]; Y += y[i]; } } ans = max(ans, sqrt(X * X + Y * Y)); } cout << fixed << setprecision(15) << endl; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; const double pi = 3.141592653589793238462643383279; int main() { int N; cin >> N; vector<double> x(N); vector<double> y(N); for (int i = 0; i < N; i++) { cin >> x[i] >> y[i]; } double ans = 0.0; for (int i = 0; i < 4000; i++) { double s = cos(((double)i * pi) * 0.0005); double t = sin(((double)i * pi) * 0.0005); double X = 0.0; double Y = 0.0; for (int i = 0; i < N; i++) { if (s * x[i] + t * y[i] >= 0.0) { X += x[i]; Y += y[i]; } } ans = max(ans, sqrt(X * X + Y * Y)); } cout << fixed << setprecision(15) << ans << endl; return 0; }
[ "io.output.change" ]
730,340
730,341
u904123392
cpp
p02926
#include <bits/stdc++.h> int main() { using namespace std; unsigned long N; cin >> N; vector<pair<long, long>> eng(N); for (auto &i : eng) cin >> i.first >> i.second; auto d = static_cast<unsigned long>(partition(eng.begin(), eng.end(), [](auto i) { return i.first == 0 ? i.second > 0 : i.first > 0; }) - eng.begin()); for (unsigned long i = 0; i < N; ++i) eng.emplace_back(-eng[i].first, -eng[i].second); for (unsigned long i = 0; i < d; ++i) eng.emplace_back(eng[i].first, eng[i].second); auto cmp = [](auto i, auto j) { return i.first * j.second > i.second * j.first; }; sort(eng.begin(), eng.begin() + d, cmp); sort(eng.begin() + d, eng.begin() + d + N, cmp); sort(eng.begin() + d + N, eng.end(), cmp); long a{0}, b{0}; unsigned long ans{0}; for (unsigned long i = 0; i < N; ++i) { a += eng[i].first; b += eng[i].second; ans = max<unsigned long>(ans, a * a + b * b); } printf("%.12Lf\n", sqrt(static_cast<long double>(ans))); return 0; }
#include <bits/stdc++.h> int main() { using namespace std; unsigned long N; cin >> N; vector<pair<long, long>> eng(N); for (auto &i : eng) cin >> i.first >> i.second; auto d = static_cast<unsigned long>(partition(eng.begin(), eng.end(), [](auto i) { return i.first == 0 ? i.second > 0 : i.first > 0; }) - eng.begin()); for (unsigned long i = 0; i < N; ++i) eng.emplace_back(-eng[i].first, -eng[i].second); for (unsigned long i = 0; i < d; ++i) eng.emplace_back(eng[i].first, eng[i].second); auto cmp = [](auto i, auto j) { return i.first * j.second > i.second * j.first; }; sort(eng.begin(), eng.begin() + d, cmp); sort(eng.begin() + d, eng.begin() + d + N, cmp); sort(eng.begin() + d + N, eng.end(), cmp); long a{0}, b{0}; unsigned long ans{0}; for (unsigned long i = 0; i < 2 * N + d; ++i) { a += eng[i].first; b += eng[i].second; ans = max<unsigned long>(ans, a * a + b * b); } printf("%.12Lf\n", sqrt(static_cast<long double>(ans))); return 0; }
[ "control_flow.loop.for.condition.change" ]
730,347
730,348
u462437857
cpp
p02926
#include <bits/stdc++.h> int main() { using namespace std; unsigned long N; cin >> N; vector<pair<long, long>> eng(N); for (auto &i : eng) cin >> i.first >> i.second; auto d = static_cast<unsigned long>(partition(eng.begin(), eng.end(), [](auto i) { return i.first == 0 ? i.second > 0 : i.first > 0; }) - eng.begin()); for (unsigned long i = 0; i < N; ++i) eng.emplace_back(-eng[i].first, -eng[i].second); for (unsigned long i = 0; i < d; ++i) eng.emplace_back(eng[i].first, eng[i].second); auto cmp = [](auto i, auto j) { return i.first * j.second < i.second * j.first; }; sort(eng.begin(), eng.begin() + d, cmp); sort(eng.begin() + d, eng.begin() + d + N, cmp); sort(eng.begin() + d + N, eng.end(), cmp); long a{0}, b{0}; unsigned long ans{0}; for (unsigned long i = 0; i < N; ++i) { a += eng[i].first; b += eng[i].second; ans = max<unsigned long>(ans, a * a + b * b); } printf("%.12Lf\n", sqrt(static_cast<long double>(ans))); return 0; }
#include <bits/stdc++.h> int main() { using namespace std; unsigned long N; cin >> N; vector<pair<long, long>> eng(N); for (auto &i : eng) cin >> i.first >> i.second; auto d = static_cast<unsigned long>(partition(eng.begin(), eng.end(), [](auto i) { return i.first == 0 ? i.second > 0 : i.first > 0; }) - eng.begin()); for (unsigned long i = 0; i < N; ++i) eng.emplace_back(-eng[i].first, -eng[i].second); for (unsigned long i = 0; i < d; ++i) eng.emplace_back(eng[i].first, eng[i].second); auto cmp = [](auto i, auto j) { return i.first * j.second > i.second * j.first; }; sort(eng.begin(), eng.begin() + d, cmp); sort(eng.begin() + d, eng.begin() + d + N, cmp); sort(eng.begin() + d + N, eng.end(), cmp); long a{0}, b{0}; unsigned long ans{0}; for (unsigned long i = 0; i < 2 * N + d; ++i) { a += eng[i].first; b += eng[i].second; ans = max<unsigned long>(ans, a * a + b * b); } printf("%.12Lf\n", sqrt(static_cast<long double>(ans))); return 0; }
[ "misc.opposites", "expression.operator.compare.change", "function.return_value.change", "expression.operation.binary.change", "control_flow.loop.for.condition.change" ]
730,349
730,348
u462437857
cpp
p02926
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; tuple<double, double, double> t[2 * n]; for (int i = 0; i < n; ++i) { double x, y; cin >> x >> y; double arg = atan(y / x); t[i] = t[i + n] = make_tuple(arg, x, y); } sort(t, t + n); sort(t + n, t + 2 * n); // for(int i = 0; i < 2 * n; ++i) { // double _arg, x, y; // tie(_arg, x, y) = t[i]; // cerr << _arg << " " << x << " " << y << endl; // } double ans = 0; for (int l = 0; l < n; ++l) { for (int r = l; r <= 2 * n; ++r) { if (r - l > n) continue; double xsum = 0, ysum = 0; for (int i = l; i < r; ++i) { double _arg, x, y; tie(_arg, x, y) = t[i]; xsum += x; ysum += y; } ans = max(ans, xsum * xsum + ysum * ysum); } } printf("%.15f\n", sqrt(ans)); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; tuple<double, double, double> t[2 * n]; for (int i = 0; i < n; ++i) { double x, y; cin >> x >> y; double arg = atan2(y, x); t[i] = t[i + n] = make_tuple(arg, x, y); } sort(t, t + n); sort(t + n, t + 2 * n); // for(int i = 0; i < 2 * n; ++i) { // double _arg, x, y; // tie(_arg, x, y) = t[i]; // cerr << _arg << " " << x << " " << y << endl; // } double ans = 0; for (int l = 0; l < n; ++l) { for (int r = l; r <= 2 * n; ++r) { if (r - l > n) continue; double xsum = 0, ysum = 0; for (int i = l; i < r; ++i) { double _arg, x, y; tie(_arg, x, y) = t[i]; xsum += x; ysum += y; } ans = max(ans, xsum * xsum + ysum * ysum); } } printf("%.15f\n", sqrt(ans)); return 0; }
[ "identifier.change", "call.function.change", "call.arguments.change", "expression.operation.binary.change" ]
730,359
730,360
u918753189
cpp
p02926
#include <bits/stdc++.h> using namespace std; typedef long long ll; // #define int long long #define SZ(x) ((int)(x).size()) #define ALL(x) (x).begin(), (x).end() #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define REP(i, x) for (int i = 0; i < (int)(x); i++) #define REPS(i, x) for (int i = 1; i <= (int)(x); i++) #define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--) #define RREPS(i, x) for (int i = ((int)(x)); i > 0; i--) typedef pair<int, int> pint; #define mp make_pair #define mt make_tuple #define pb push_back #define pf push_front #define MOD (1000 * 1000 * 1000 + 7) double dot(double x1, double y1, double x2, double y2) { return x1 * x2 + y1 * y2; } #define M 1000 signed main() { int N; vector<int> xx, yy; cin >> N; REP(i, N) { int x, y; cin >> x >> y; xx.pb(x); yy.pb(y); } double ans = 0; REP(i, M) { double rad = (double)i / M * M_PI * 2; double vec_x = cos(rad); double vec_y = sin(rad); double total_x = 0; double total_y = 0; REP(i, N) { if (dot(xx[i], yy[i], vec_x, vec_y) >= 0) { total_x += xx[i]; total_y += yy[i]; } } if (pow(total_x, 2) + pow(total_y, 2) > ans) { ans = pow(total_x, 2) + pow(total_y, 2); } } ans = sqrt(ans); cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; // #define int long long #define SZ(x) ((int)(x).size()) #define ALL(x) (x).begin(), (x).end() #define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define REP(i, x) for (int i = 0; i < (int)(x); i++) #define REPS(i, x) for (int i = 1; i <= (int)(x); i++) #define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--) #define RREPS(i, x) for (int i = ((int)(x)); i > 0; i--) typedef pair<int, int> pint; #define mp make_pair #define mt make_tuple #define pb push_back #define pf push_front #define MOD (1000 * 1000 * 1000 + 7) double dot(double x1, double y1, double x2, double y2) { return x1 * x2 + y1 * y2; } #define M 1000 signed main() { int N; vector<int> xx, yy; cin >> N; REP(i, N) { int x, y; cin >> x >> y; xx.pb(x); yy.pb(y); } double ans = 0; REP(i, M) { double rad = (double)i / M * M_PI * 2; double vec_x = cos(rad); double vec_y = sin(rad); double total_x = 0; double total_y = 0; REP(i, N) { if (dot(xx[i], yy[i], vec_x, vec_y) >= 0) { total_x += xx[i]; total_y += yy[i]; } } if (pow(total_x, 2) + pow(total_y, 2) > ans) { ans = pow(total_x, 2) + pow(total_y, 2); } } ans = sqrt(ans); cout << setprecision(12) << ans << endl; return 0; }
[ "io.output.change" ]
730,365
730,366
u027861917
cpp
p02926
#include <bits/stdc++.h> using namespace std; const int OO = 1e9; const double EPS = 1e-9; #define ndl cout << '\n' #define sz(v) int(v.size()) #define pb push_back #define mp make_pair #define fs first #define sc second #define present(a, x) (a.find(x) != a.end()) #ifdef LOCAL #define db(...) \ ({ \ cout << "> Line " << __LINE__ << ": "; \ _db(#__VA_ARGS__, __VA_ARGS__); \ }) #else #define db(...) true #endif template <class T> void _db(const char *dbStr, T e) { cout << dbStr << " = " << e << endl; } template <class T, class... L> void _db(const char *dbStr, T e, L... r) { while (*dbStr != ',') cout << *dbStr++; cout << " = " << e << ','; _db(dbStr + 1, r...); } template <class S, class T> ostream &operator<<(ostream &o, const map<S, T> &v) { o << "["; int i = 0; for (const pair<S, T> &pr : v) o << (!i++ ? "" : ", ") << "{" << pr.fs << " : " << pr.sc << "}"; return o << "]"; } template <template <class, class...> class S, class T, class... L> ostream &operator<<(ostream &o, const S<T, L...> &v) { o << "["; int i = 0; for (const auto &e : v) o << (!i++ ? "" : ", ") << e; return o << "]"; } template <class S, class T> ostream &operator<<(ostream &o, const pair<S, T> &pr) { return o << "(" << pr.fs << ", " << pr.sc << ")"; } ostream &operator<<(ostream &o, const string &s) { for (const char &c : s) o << c; return o; } template <class T> using V = vector<T>; template <class T> using VV = V<V<T>>; template <class T> using VVV = VV<V<T>>; using ll = long long; using pii = pair<int, int>; using vi = V<int>; using vii = V<pii>; using vvi = VV<int>; using mii = map<int, int>; using umii = unordered_map<int, int>; using si = set<int>; using usi = unordered_set<int>; #define INF 1e9 #define EPS 1e-9 #define PI acos(-1.0) double DEG_to_RAD(double d) { return d * PI / 180.0; } double RAD_to_DEG(double r) { return r * 180.0 / PI; } template <class T> struct Point { T x, y; Point(T _x = 0, T _y = 0) : x(_x), y(_y) {} bool operator<(Point<int> oth) const { return mp(x, y) < mp(oth.x, oth.y); } bool operator<(Point<double> oth) const { if (fabs(x - oth.x) > EPS) return x < oth.x; return y < oth.y; } bool operator>(Point<T> oth) const { return oth < *this; } bool operator<=(Point<int> oth) const { return mp(x, y) <= mp(oth.x, oth.y); } bool operator>=(Point<int> oth) const { return oth <= *this; } bool operator==(Point<int> oth) const { return mp(x, y) == mp(oth.x, oth.y); } bool operator==(Point<double> oth) const { return fabs(x - oth.x) < EPS && fabs(y - oth.y) < EPS; } bool operator!=(Point<T> oth) const { return !(*this == oth); } // + and - convert to type of LHS template <class S> Point<T> operator+(Point<S> oth) const { return Point<T>(x + oth.x, y + oth.y); } template <class S> Point<T> operator-(Point<S> oth) const { return Point<T>(x - oth.x, y - oth.y); } Point<double> scale(double sc) { return Point<double>(x * sc, y * sc); } // rotate p by theta degrees CCW w.r.t origin (0, 0) Point<double> rotate(double theta) { double rad = DEG_to_RAD(theta); return Point<double>(x * cos(rad) - y * sin(rad), x * sin(rad) + y * cos(rad)); } }; template <class T> double dist(Point<T> p1, Point<T> p2) { return hypot(p1.x - p2.x, p1.y - p2.y); } template <class T> double angleSigned(Point<T> a, Point<T> o, Point<T> b) { a = a - o, b = b - o; double rot = -atan2(a.y, a.x); b.rotate(RAD_to_DEG(rot)); double ret = atan2(b.y, b.x); if (ret < 0) ret += 2 * PI; return ret; } template <class T> vector<Point<T>> radialSweep(vector<Point<T>> P) { vector<Point<T>> ret = P; Point<T> pivot = Point<int>(0, 0), pivotR = Point<T>(pivot.x + 1, pivot.y); // ret[0] = P[idx] sort(ret.begin(), ret.end(), [pivot, pivotR](Point<T> &p1, Point<T> &p2) { if (p1 == p2) return false; if (p1 == Point<int>(0, 0)) return true; if (p2 == Point<int>(0, 0)) return false; double ang1 = angleSigned(pivotR, pivot, p1); double ang2 = angleSigned(pivotR, pivot, p2); // since we're dealing with values in range [0, 2 * PI], // we use very small EPS if (fabs(ang1 - ang2) < 1e-18) return dist(pivot, p1) < dist(pivot, p2); return ang1 < ang2; }); return ret; } int N; V<Point<int>> pts; int main() { #ifdef LOCAL auto stTime = clock(); #endif // freopen("in.txt", "r", stdin); ios::sync_with_stdio(false); cout.precision(25); cin.tie(0); cin >> N; pts.resize(N); for (int i = 0; i < N; ++i) cin >> pts[i].x >> pts[i].y; pts = radialSweep(pts); for (int i = 1; i <= N; ++i) pts.pb(pts[i]); double ans = 0; for (int i = 1; i <= N; ++i) { for (int j = i; j < i + N; ++j) { Point<int> curr(0, 0); for (int k = i; k <= j; ++k) { curr = curr + pts[k]; } ans = max(ans, dist(curr, Point<int>(0, 0))); } } cout << fixed << ans << '\n'; #ifdef LOCAL cout << "\n\n\nExecution time: " << (clock() - stTime) * 1e3 / CLOCKS_PER_SEC << " ms" << endl; #endif return 0; }
#include <bits/stdc++.h> using namespace std; const int OO = 1e9; const double EPS = 1e-9; #define ndl cout << '\n' #define sz(v) int(v.size()) #define pb push_back #define mp make_pair #define fs first #define sc second #define present(a, x) (a.find(x) != a.end()) #ifdef LOCAL #define db(...) \ ({ \ cout << "> Line " << __LINE__ << ": "; \ _db(#__VA_ARGS__, __VA_ARGS__); \ }) #else #define db(...) true #endif template <class T> void _db(const char *dbStr, T e) { cout << dbStr << " = " << e << endl; } template <class T, class... L> void _db(const char *dbStr, T e, L... r) { while (*dbStr != ',') cout << *dbStr++; cout << " = " << e << ','; _db(dbStr + 1, r...); } template <class S, class T> ostream &operator<<(ostream &o, const map<S, T> &v) { o << "["; int i = 0; for (const pair<S, T> &pr : v) o << (!i++ ? "" : ", ") << "{" << pr.fs << " : " << pr.sc << "}"; return o << "]"; } template <template <class, class...> class S, class T, class... L> ostream &operator<<(ostream &o, const S<T, L...> &v) { o << "["; int i = 0; for (const auto &e : v) o << (!i++ ? "" : ", ") << e; return o << "]"; } template <class S, class T> ostream &operator<<(ostream &o, const pair<S, T> &pr) { return o << "(" << pr.fs << ", " << pr.sc << ")"; } ostream &operator<<(ostream &o, const string &s) { for (const char &c : s) o << c; return o; } template <class T> using V = vector<T>; template <class T> using VV = V<V<T>>; template <class T> using VVV = VV<V<T>>; using ll = long long; using pii = pair<int, int>; using vi = V<int>; using vii = V<pii>; using vvi = VV<int>; using mii = map<int, int>; using umii = unordered_map<int, int>; using si = set<int>; using usi = unordered_set<int>; #define INF 1e9 #define EPS 1e-9 #define PI acos(-1.0) double DEG_to_RAD(double d) { return d * PI / 180.0; } double RAD_to_DEG(double r) { return r * 180.0 / PI; } template <class T> struct Point { T x, y; Point(T _x = 0, T _y = 0) : x(_x), y(_y) {} bool operator<(Point<int> oth) const { return mp(x, y) < mp(oth.x, oth.y); } bool operator<(Point<double> oth) const { if (fabs(x - oth.x) > EPS) return x < oth.x; return y < oth.y; } bool operator>(Point<T> oth) const { return oth < *this; } bool operator<=(Point<int> oth) const { return mp(x, y) <= mp(oth.x, oth.y); } bool operator>=(Point<int> oth) const { return oth <= *this; } bool operator==(Point<int> oth) const { return mp(x, y) == mp(oth.x, oth.y); } bool operator==(Point<double> oth) const { return fabs(x - oth.x) < EPS && fabs(y - oth.y) < EPS; } bool operator!=(Point<T> oth) const { return !(*this == oth); } // + and - convert to type of LHS template <class S> Point<T> operator+(Point<S> oth) const { return Point<T>(x + oth.x, y + oth.y); } template <class S> Point<T> operator-(Point<S> oth) const { return Point<T>(x - oth.x, y - oth.y); } Point<double> scale(double sc) { return Point<double>(x * sc, y * sc); } // rotate p by theta degrees CCW w.r.t origin (0, 0) Point<double> rotate(double theta) { double rad = DEG_to_RAD(theta); return Point<double>(x * cos(rad) - y * sin(rad), x * sin(rad) + y * cos(rad)); } }; template <class T> double dist(Point<T> p1, Point<T> p2) { return hypot(p1.x - p2.x, p1.y - p2.y); } template <class T> double angleSigned(Point<T> a, Point<T> o, Point<T> b) { a = a - o, b = b - o; double rot = -atan2(a.y, a.x); b.rotate(RAD_to_DEG(rot)); double ret = atan2(b.y, b.x); if (ret < 0) ret += 2 * PI; return ret; } template <class T> vector<Point<T>> radialSweep(vector<Point<T>> P) { vector<Point<T>> ret = P; Point<T> pivot = Point<int>(0, 0), pivotR = Point<T>(pivot.x + 1, pivot.y); // ret[0] = P[idx] sort(ret.begin(), ret.end(), [pivot, pivotR](Point<T> &p1, Point<T> &p2) { if (p1 == p2) return false; if (p1 == Point<int>(0, 0)) return true; if (p2 == Point<int>(0, 0)) return false; double ang1 = angleSigned(pivotR, pivot, p1); double ang2 = angleSigned(pivotR, pivot, p2); // since we're dealing with values in range [0, 2 * PI], // we use very small EPS if (fabs(ang1 - ang2) < 1e-18) return dist(pivot, p1) < dist(pivot, p2); return ang1 < ang2; }); return ret; } int N; V<Point<int>> pts; int main() { #ifdef LOCAL auto stTime = clock(); #endif // freopen("in.txt", "r", stdin); ios::sync_with_stdio(false); cout.precision(25); cin.tie(0); cin >> N; pts.resize(N); for (int i = 0; i < N; ++i) cin >> pts[i].x >> pts[i].y; pts = radialSweep(pts); for (int i = 0; i < N; ++i) pts.pb(pts[i]); double ans = 0; for (int i = 0; i < N; ++i) { for (int j = i; j < i + N; ++j) { Point<int> curr(0, 0); for (int k = i; k <= j; ++k) { curr = curr + pts[k]; } ans = max(ans, dist(curr, Point<int>(0, 0))); } } cout << fixed << ans << '\n'; #ifdef LOCAL cout << "\n\n\nExecution time: " << (clock() - stTime) * 1e3 / CLOCKS_PER_SEC << " ms" << endl; #endif return 0; }
[ "literal.number.change", "variable_declaration.value.change", "control_flow.loop.for.initializer.change", "expression.off_by_one", "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
730,367
730,368
u935316779
cpp
p02926
#include <bits/stdc++.h> using namespace std; #define int long long typedef vector<int> vint; typedef pair<int, int> pint; const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; int gcd(int a, int b) { return b ? gcd(b, a % b) : a; } template <typename T, typename U> inline bool chmax(T &a, const U &b) { if (a < b) { a = b; return true; } return false; } template <typename T, typename U> inline bool chmin(T &a, const U &b) { if (b < a) { a = b; return true; } return false; } struct Init { Init() { cout << fixed << setprecision(20); }; } init; int N; int x[110], y[110]; signed main() { cin >> N; for (int i = 0; i < N; i++) { cin >> x[i] >> y[i]; } double pi = acos(-1); double ans = 0; for (double theta = 0; theta < 2 * pi; theta += 1e-4) { double a = cos(theta), b = sin(theta); double cur = 0; for (int i = 0; i < N; i++) { double nai = x[i] * a + y[i] * b; if (nai > 0) { cur += nai; } } chmax(ans, cur); } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; #define int long long typedef vector<int> vint; typedef pair<int, int> pint; const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; int gcd(int a, int b) { return b ? gcd(b, a % b) : a; } template <typename T, typename U> inline bool chmax(T &a, const U &b) { if (a < b) { a = b; return true; } return false; } template <typename T, typename U> inline bool chmin(T &a, const U &b) { if (b < a) { a = b; return true; } return false; } struct Init { Init() { cout << fixed << setprecision(20); }; } init; int N; int x[110], y[110]; signed main() { cin >> N; for (int i = 0; i < N; i++) { cin >> x[i] >> y[i]; } double pi = acos(-1); double ans = 0; for (double theta = 0; theta < 2 * pi; theta += 2e-5) { double a = cos(theta), b = sin(theta); double cur = 0; for (int i = 0; i < N; i++) { double nai = x[i] * a + y[i] * b; if (nai > 0) { cur += nai; } } chmax(ans, cur); } cout << ans << endl; }
[ "literal.number.change", "assignment.value.change" ]
730,380
730,381
u450832845
cpp
p02926
#include <bits/stdc++.h> using namespace std; #define int long long typedef vector<int> vint; typedef pair<int, int> pint; const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; int gcd(int a, int b) { return b ? gcd(b, a % b) : a; } template <typename T, typename U> inline bool chmax(T &a, const U &b) { if (a < b) { a = b; return true; } return false; } template <typename T, typename U> inline bool chmin(T &a, const U &b) { if (b < a) { a = b; return true; } return false; } struct Init { Init() { cout << fixed << setprecision(20); }; } init; int N; int x[110], y[110]; signed main() { cin >> N; for (int i = 0; i < N; i++) { cin >> x[i] >> y[i]; } double pi = acos(-1); double ans = 0; for (double theta = 0; theta < 2 * pi; theta += 1e-4) { double a = cos(theta), b = sin(theta); double cur = 0; for (int i = 0; i < N; i++) { double nai = x[i] * a + y[i] * b; if (nai > 0) { cur += nai; } } chmax(ans, cur); } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; #define int long long typedef vector<int> vint; typedef pair<int, int> pint; const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; int gcd(int a, int b) { return b ? gcd(b, a % b) : a; } template <typename T, typename U> inline bool chmax(T &a, const U &b) { if (a < b) { a = b; return true; } return false; } template <typename T, typename U> inline bool chmin(T &a, const U &b) { if (b < a) { a = b; return true; } return false; } struct Init { Init() { cout << fixed << setprecision(20); }; } init; int N; int x[110], y[110]; signed main() { cin >> N; for (int i = 0; i < N; i++) { cin >> x[i] >> y[i]; } double pi = acos(-1); double ans = 0; for (double theta = 0; theta < 2 * pi; theta += 1e-5) { double a = cos(theta), b = sin(theta); double cur = 0; for (int i = 0; i < N; i++) { double nai = x[i] * a + y[i] * b; if (nai > 0) { cur += nai; } } chmax(ans, cur); } cout << ans << endl; }
[ "literal.number.change", "assignment.value.change" ]
730,380
730,382
u450832845
cpp
p02926
#include <bits/stdc++.h> using namespace std; #define rep(i, N) for (int i = 0; i < N; i++) using ll = long long int; using pii = pair<int, int>; using pll = pair<ll, ll>; // Modulo.h start---------------------------------------- #pragma once #include <iostream> #include <vector> unsigned int mod; struct Modint; std::vector<Modint> fact_mod; std::vector<Modint> rev_fact_mod; using namespace std; template <typename Tint> Tint gcd(Tint a, Tint b) { // O(log max(a,b)) a = abs(a); b = abs(b); return b != 0 ? gcd(b, a % b) : a; } template <typename Tint> Tint lcm(Tint a, Tint b) { return a / gcd(a, b) * b; } // a x + b y = gcd(a, b) int extgcd(const unsigned int a, const unsigned int b, int &x, int &y) { // O(log max(a,b)) int g = a; x = 1; y = 0; if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x; return g; } void set_mod(const unsigned int m) { mod = m; } void set_mod(const int m) { if (m > 0) set_mod((unsigned int)m); else std::cout << "Error in set_mod" << std::endl; } unsigned int inv_mod(const unsigned int a) { int x, y; if (extgcd(a, mod, x, y) == 1) return (unsigned int)(((long long)x + mod) % mod); else // unsolvable return 0; } struct Modint { unsigned int value; Modint() {} Modint(unsigned int value) : value(value % mod) {} Modint(int value) : Modint((unsigned int)(value % mod + mod)) {} Modint(unsigned long long value) : Modint((unsigned int)(value % mod)) {} Modint(long long value) : Modint((unsigned int)(value % mod + mod)) {} Modint(const Modint &rhs) : Modint(rhs.value) {} bool operator==(const Modint &rhs) const; inline bool operator!=(const Modint &rhs) const { return !(*this == rhs); } Modint &operator+=(const Modint &rhs); Modint &operator+=(const unsigned int rhs); Modint &operator+=(const int rhs); Modint &operator+=(const unsigned long long rhs); Modint &operator+=(const long long rhs); Modint &operator-=(const Modint &rhs); Modint &operator-=(const unsigned int rhs); Modint &operator-=(const int rhs); Modint &operator-=(const unsigned long long rhs); Modint &operator-=(const long long rhs); Modint &operator*=(const Modint &rhs); Modint &operator*=(const unsigned int rhs); Modint &operator*=(const int rhs); Modint &operator*=(const unsigned long long rhs); Modint &operator*=(const long long rhs); Modint &operator/=(const Modint &rhs); Modint &operator/=(const unsigned int rhs); Modint &operator/=(const int rhs); Modint &operator/=(const unsigned long long rhs); Modint &operator/=(const long long rhs); }; bool Modint::operator==(const Modint &rhs) const { return value == rhs.value; } Modint &Modint::operator+=(const unsigned int rhs) { unsigned long long tmp = this->value; tmp += rhs; tmp %= mod; this->value = (unsigned int)tmp; return *this; } Modint &Modint::operator+=(const Modint &rhs) { (*this) += rhs.value; return *this; } Modint &Modint::operator+=(const int rhs) { (*this) += (unsigned int)(rhs % mod + mod); return *this; } Modint &Modint::operator+=(const unsigned long long rhs) { (*this) += (unsigned int)(rhs % mod); return *this; } Modint &Modint::operator+=(const long long rhs) { (*this) += (unsigned int)(rhs % mod + mod); return *this; } Modint &Modint::operator-=(const Modint &rhs) { (*this) -= rhs.value; return *this; } Modint &Modint::operator-=(const unsigned int rhs) { *this += mod - rhs % mod; return *this; } Modint &Modint::operator-=(const int rhs) { *this -= (unsigned int)(rhs % mod + mod); return *this; } Modint &Modint::operator-=(const unsigned long long rhs) { (*this) -= (unsigned int)(rhs % mod); return *this; } Modint &Modint::operator-=(const long long rhs) { (*this) -= (unsigned int)(rhs % mod + mod); return *this; } Modint &Modint::operator*=(const Modint &rhs) { (*this) *= rhs.value; return *this; } Modint &Modint::operator*=(const unsigned int rhs) { unsigned long long tmp = this->value; tmp *= rhs; tmp %= mod; this->value = (unsigned int)tmp; return *this; } Modint &Modint::operator*=(const int rhs) { (*this) *= (unsigned int)(rhs % mod + mod); return *this; } Modint &Modint::operator*=(const unsigned long long rhs) { (*this) *= (unsigned int)(rhs % mod); return *this; } Modint &Modint::operator*=(const long long rhs) { (*this) *= (unsigned int)(rhs % mod + mod); return *this; } Modint &Modint::operator/=(const Modint &rhs) { (*this) /= rhs.value; return *this; } Modint &Modint::operator/=(const unsigned int rhs) { *this *= inv_mod(rhs); return *this; } Modint &Modint::operator/=(const int rhs) { *this /= (unsigned int)(rhs % mod + mod); return *this; } Modint &Modint::operator/=(const unsigned long long rhs) { *this /= (unsigned int)(rhs % mod); return *this; } Modint &Modint::operator/=(const long long rhs) { *this /= (unsigned int)(rhs % mod + mod); return *this; } const Modint operator+(const Modint &lhs, const Modint &rhs) { return Modint(lhs) += rhs; } const Modint operator+(const Modint &lhs, unsigned int rhs) { return Modint(lhs) += rhs; } const Modint operator+(unsigned int lhs, const Modint &rhs) { return Modint(lhs) += rhs; } const Modint operator-(const Modint &lhs, const Modint &rhs) { return Modint(lhs) -= rhs; } const Modint operator-(const Modint &lhs, unsigned int rhs) { return Modint(lhs) -= rhs; } const Modint operator-(unsigned int lhs, const Modint &rhs) { return Modint(lhs) -= rhs; } const Modint operator*(const Modint &lhs, const Modint &rhs) { return Modint(lhs) *= rhs; } const Modint operator*(const Modint &lhs, unsigned int rhs) { return Modint(lhs) *= rhs; } const Modint operator*(unsigned int lhs, const Modint &rhs) { return Modint(lhs) *= rhs; } const Modint operator/(const Modint &lhs, const Modint &rhs) { return Modint(lhs) /= rhs; } const Modint operator/(const Modint &lhs, unsigned int rhs) { return Modint(lhs) /= rhs; } const Modint operator/(unsigned int lhs, const Modint &rhs) { return Modint(lhs) /= rhs; } ostream &operator<<(std::ostream &lhs, const Modint &rhs) { lhs << rhs.value; return lhs; } Modint pow_mod(const Modint &x, const unsigned int k) { // x^k (mod) if (k == 0) return Modint(1); if (k % 2 == 0) return pow_mod(x * x, k / 2); else return x * pow_mod(x, k - 1); } Modint pow_mod(const unsigned int x, const unsigned int k) { return pow_mod(Modint(x), k); } std::vector<Modint> set_fact_mod(unsigned int n) { fact_mod = vector<Modint>(n + 1); fact_mod[0] = 1; for (unsigned int i = 1; i <= n; i++) { fact_mod[i] = fact_mod[i - 1] * i; } return fact_mod; } std::vector<Modint> set_rev_fact_mod(unsigned int n) { rev_fact_mod = vector<Modint>(n + 1); rev_fact_mod[n] = 1 / fact_mod[n]; for (int i = n - 1; i >= 0; i--) { rev_fact_mod[i] = rev_fact_mod[i + 1] * (unsigned int)(i + 1); } return rev_fact_mod; } Modint combination_mod_precalculation(unsigned int n, unsigned int r) { // set mod, fact_mod, rev_fact_mod return fact_mod[n] * rev_fact_mod[r] * rev_fact_mod[n - r]; } Modint combination_mod_straightforward(unsigned long long n, unsigned long long r) { // mod is prime if (r * 2 > n) r = n - r; Modint numerator = 1; Modint denominator = 1; for (unsigned long long i = 1; i <= r; ++i) { numerator *= n - i + 1; denominator *= i; } return numerator / denominator; } // Modulo.h end---------------------------------------------- double dist(double x, double y) { return sqrt(x * x + y * y); } int main() { int N; cin >> N; vector<int> x(N), y(N); rep(i, N) cin >> x[i] >> y[i]; vector<int> x_irreducible(N), y_irreducible(N); rep(i, N) { int g = gcd(x[i], y[i]); if (g == 0) continue; x_irreducible[i] = x[i] / g; y_irreducible[i] = y[i] / g; } vector<int> x_modified(x), y_modified(y); rep(i, N) rep(j, i) if (x_irreducible[j] == x_irreducible[i] and y_irreducible[j] == y_irreducible[i]) { x_modified[j] += x_modified[i]; x_modified[j] += y_modified[i]; x_modified[i] = y_modified[i] = 0; } auto it_x = x_modified.begin(); auto it_y = y_modified.begin(); while (it_x != x_modified.end()) { if (*it_x == 0 and *it_y == 0) { it_x = x_modified.erase(it_x); it_y = y_modified.erase(it_y); } else { it_x++; it_y++; } } int n = x_modified.size(); vector<int> x_perp(n), y_perp(n); rep(i, n) { x_perp[i] = -y_modified[i]; y_perp[i] = +x_modified[i]; } double max_dist = 0; rep(i, n) { ll xa, ya, xb, yb; xa = ya = xb = yb = 0; rep(j, n) { if (j == i) continue; if ((ll)x_perp[i] * x_modified[j] + (ll)y_perp[i] * y_modified[j] >= 0) { xa += x_modified[j]; ya += y_modified[j]; } else { xb += x_modified[j]; yb += y_modified[j]; } } vector<double> vec_comp; vec_comp.push_back(max_dist); vec_comp.push_back(dist(xa, ya)); vec_comp.push_back(dist(xa + x_modified[i], ya + y_modified[i])); vec_comp.push_back(dist(xb, yb)); vec_comp.push_back(dist(xb + x_modified[i], yb + y_modified[i])); max_dist = *max_element(vec_comp.begin(), vec_comp.end()); } cout << fixed << setprecision(11); cout << max_dist << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, N) for (int i = 0; i < N; i++) using ll = long long int; using pii = pair<int, int>; using pll = pair<ll, ll>; // Modulo.h start---------------------------------------- #pragma once #include <iostream> #include <vector> unsigned int mod; struct Modint; std::vector<Modint> fact_mod; std::vector<Modint> rev_fact_mod; using namespace std; template <typename Tint> Tint gcd(Tint a, Tint b) { // O(log max(a,b)) a = abs(a); b = abs(b); return b != 0 ? gcd(b, a % b) : a; } template <typename Tint> Tint lcm(Tint a, Tint b) { return a / gcd(a, b) * b; } // a x + b y = gcd(a, b) int extgcd(const unsigned int a, const unsigned int b, int &x, int &y) { // O(log max(a,b)) int g = a; x = 1; y = 0; if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x; return g; } void set_mod(const unsigned int m) { mod = m; } void set_mod(const int m) { if (m > 0) set_mod((unsigned int)m); else std::cout << "Error in set_mod" << std::endl; } unsigned int inv_mod(const unsigned int a) { int x, y; if (extgcd(a, mod, x, y) == 1) return (unsigned int)(((long long)x + mod) % mod); else // unsolvable return 0; } struct Modint { unsigned int value; Modint() {} Modint(unsigned int value) : value(value % mod) {} Modint(int value) : Modint((unsigned int)(value % mod + mod)) {} Modint(unsigned long long value) : Modint((unsigned int)(value % mod)) {} Modint(long long value) : Modint((unsigned int)(value % mod + mod)) {} Modint(const Modint &rhs) : Modint(rhs.value) {} bool operator==(const Modint &rhs) const; inline bool operator!=(const Modint &rhs) const { return !(*this == rhs); } Modint &operator+=(const Modint &rhs); Modint &operator+=(const unsigned int rhs); Modint &operator+=(const int rhs); Modint &operator+=(const unsigned long long rhs); Modint &operator+=(const long long rhs); Modint &operator-=(const Modint &rhs); Modint &operator-=(const unsigned int rhs); Modint &operator-=(const int rhs); Modint &operator-=(const unsigned long long rhs); Modint &operator-=(const long long rhs); Modint &operator*=(const Modint &rhs); Modint &operator*=(const unsigned int rhs); Modint &operator*=(const int rhs); Modint &operator*=(const unsigned long long rhs); Modint &operator*=(const long long rhs); Modint &operator/=(const Modint &rhs); Modint &operator/=(const unsigned int rhs); Modint &operator/=(const int rhs); Modint &operator/=(const unsigned long long rhs); Modint &operator/=(const long long rhs); }; bool Modint::operator==(const Modint &rhs) const { return value == rhs.value; } Modint &Modint::operator+=(const unsigned int rhs) { unsigned long long tmp = this->value; tmp += rhs; tmp %= mod; this->value = (unsigned int)tmp; return *this; } Modint &Modint::operator+=(const Modint &rhs) { (*this) += rhs.value; return *this; } Modint &Modint::operator+=(const int rhs) { (*this) += (unsigned int)(rhs % mod + mod); return *this; } Modint &Modint::operator+=(const unsigned long long rhs) { (*this) += (unsigned int)(rhs % mod); return *this; } Modint &Modint::operator+=(const long long rhs) { (*this) += (unsigned int)(rhs % mod + mod); return *this; } Modint &Modint::operator-=(const Modint &rhs) { (*this) -= rhs.value; return *this; } Modint &Modint::operator-=(const unsigned int rhs) { *this += mod - rhs % mod; return *this; } Modint &Modint::operator-=(const int rhs) { *this -= (unsigned int)(rhs % mod + mod); return *this; } Modint &Modint::operator-=(const unsigned long long rhs) { (*this) -= (unsigned int)(rhs % mod); return *this; } Modint &Modint::operator-=(const long long rhs) { (*this) -= (unsigned int)(rhs % mod + mod); return *this; } Modint &Modint::operator*=(const Modint &rhs) { (*this) *= rhs.value; return *this; } Modint &Modint::operator*=(const unsigned int rhs) { unsigned long long tmp = this->value; tmp *= rhs; tmp %= mod; this->value = (unsigned int)tmp; return *this; } Modint &Modint::operator*=(const int rhs) { (*this) *= (unsigned int)(rhs % mod + mod); return *this; } Modint &Modint::operator*=(const unsigned long long rhs) { (*this) *= (unsigned int)(rhs % mod); return *this; } Modint &Modint::operator*=(const long long rhs) { (*this) *= (unsigned int)(rhs % mod + mod); return *this; } Modint &Modint::operator/=(const Modint &rhs) { (*this) /= rhs.value; return *this; } Modint &Modint::operator/=(const unsigned int rhs) { *this *= inv_mod(rhs); return *this; } Modint &Modint::operator/=(const int rhs) { *this /= (unsigned int)(rhs % mod + mod); return *this; } Modint &Modint::operator/=(const unsigned long long rhs) { *this /= (unsigned int)(rhs % mod); return *this; } Modint &Modint::operator/=(const long long rhs) { *this /= (unsigned int)(rhs % mod + mod); return *this; } const Modint operator+(const Modint &lhs, const Modint &rhs) { return Modint(lhs) += rhs; } const Modint operator+(const Modint &lhs, unsigned int rhs) { return Modint(lhs) += rhs; } const Modint operator+(unsigned int lhs, const Modint &rhs) { return Modint(lhs) += rhs; } const Modint operator-(const Modint &lhs, const Modint &rhs) { return Modint(lhs) -= rhs; } const Modint operator-(const Modint &lhs, unsigned int rhs) { return Modint(lhs) -= rhs; } const Modint operator-(unsigned int lhs, const Modint &rhs) { return Modint(lhs) -= rhs; } const Modint operator*(const Modint &lhs, const Modint &rhs) { return Modint(lhs) *= rhs; } const Modint operator*(const Modint &lhs, unsigned int rhs) { return Modint(lhs) *= rhs; } const Modint operator*(unsigned int lhs, const Modint &rhs) { return Modint(lhs) *= rhs; } const Modint operator/(const Modint &lhs, const Modint &rhs) { return Modint(lhs) /= rhs; } const Modint operator/(const Modint &lhs, unsigned int rhs) { return Modint(lhs) /= rhs; } const Modint operator/(unsigned int lhs, const Modint &rhs) { return Modint(lhs) /= rhs; } ostream &operator<<(std::ostream &lhs, const Modint &rhs) { lhs << rhs.value; return lhs; } Modint pow_mod(const Modint &x, const unsigned int k) { // x^k (mod) if (k == 0) return Modint(1); if (k % 2 == 0) return pow_mod(x * x, k / 2); else return x * pow_mod(x, k - 1); } Modint pow_mod(const unsigned int x, const unsigned int k) { return pow_mod(Modint(x), k); } std::vector<Modint> set_fact_mod(unsigned int n) { fact_mod = vector<Modint>(n + 1); fact_mod[0] = 1; for (unsigned int i = 1; i <= n; i++) { fact_mod[i] = fact_mod[i - 1] * i; } return fact_mod; } std::vector<Modint> set_rev_fact_mod(unsigned int n) { rev_fact_mod = vector<Modint>(n + 1); rev_fact_mod[n] = 1 / fact_mod[n]; for (int i = n - 1; i >= 0; i--) { rev_fact_mod[i] = rev_fact_mod[i + 1] * (unsigned int)(i + 1); } return rev_fact_mod; } Modint combination_mod_precalculation(unsigned int n, unsigned int r) { // set mod, fact_mod, rev_fact_mod return fact_mod[n] * rev_fact_mod[r] * rev_fact_mod[n - r]; } Modint combination_mod_straightforward(unsigned long long n, unsigned long long r) { // mod is prime if (r * 2 > n) r = n - r; Modint numerator = 1; Modint denominator = 1; for (unsigned long long i = 1; i <= r; ++i) { numerator *= n - i + 1; denominator *= i; } return numerator / denominator; } // Modulo.h end---------------------------------------------- double dist(double x, double y) { return sqrt(x * x + y * y); } int main() { int N; cin >> N; vector<int> x(N), y(N); rep(i, N) cin >> x[i] >> y[i]; vector<int> x_irreducible(N), y_irreducible(N); rep(i, N) { int g = gcd(x[i], y[i]); if (g == 0) continue; x_irreducible[i] = x[i] / g; y_irreducible[i] = y[i] / g; } vector<int> x_modified(x), y_modified(y); rep(i, N) rep(j, i) if (x_irreducible[j] == x_irreducible[i] and y_irreducible[j] == y_irreducible[i]) { x_modified[j] += x_modified[i]; y_modified[j] += y_modified[i]; x_modified[i] = y_modified[i] = 0; } auto it_x = x_modified.begin(); auto it_y = y_modified.begin(); while (it_x != x_modified.end()) { if (*it_x == 0 and *it_y == 0) { it_x = x_modified.erase(it_x); it_y = y_modified.erase(it_y); } else { it_x++; it_y++; } } int n = x_modified.size(); vector<int> x_perp(n), y_perp(n); rep(i, n) { x_perp[i] = -y_modified[i]; y_perp[i] = +x_modified[i]; } double max_dist = 0; rep(i, n) { ll xa, ya, xb, yb; xa = ya = xb = yb = 0; rep(j, n) { if (j == i) continue; if ((ll)x_perp[i] * x_modified[j] + (ll)y_perp[i] * y_modified[j] >= 0) { xa += x_modified[j]; ya += y_modified[j]; } else { xb += x_modified[j]; yb += y_modified[j]; } } vector<double> vec_comp; vec_comp.push_back(max_dist); vec_comp.push_back(dist(xa, ya)); vec_comp.push_back(dist(xa + x_modified[i], ya + y_modified[i])); vec_comp.push_back(dist(xb, yb)); vec_comp.push_back(dist(xb + x_modified[i], yb + y_modified[i])); max_dist = *max_element(vec_comp.begin(), vec_comp.end()); } cout << fixed << setprecision(11); cout << max_dist << endl; }
[ "assignment.variable.change", "identifier.change" ]
730,390
730,391
u378945900
cpp
p02926
#include <bits/stdc++.h> using std::make_pair; using std::pair; typedef pair<int, int> Pair; #define update_max(a, b) \ if ((a) < (b)) \ (a) = (b) #define update_min(a, b) \ if ((a) > (b)) \ (a) = (b) const int N = 100 + 10; struct Point { long long x, y; Point(long long x = 0, long long y = 0) : x(x), y(y) {} void input() { std::cin >> x >> y; } } points[N]; int n; bool cmp(const Point &a, const Point &b) { return atan2(a.y, a.x) < atan2(b.y, b.x); } void run(int case_id = 0) { std::cin >> n; for (int i = 0; i < n; ++i) { points[i].input(); } std::sort(points + 1, points + n + 1, cmp); long long answer = 0; for (int i = 0; i < n; ++i) { Point p; for (int length = 0; length < n; ++length) { int j = (i + length) % n; p.x += points[j].x; p.y += points[j].y; update_max(answer, p.x * p.x + p.y * p.y); } } std::cout << std::setprecision(12) << std::fixed; std::cout << sqrt(answer * 1.0) << "\n"; } void multi_cases_main() { int num_tests; std::cin >> num_tests; for (int t = 1; t <= num_tests; ++t) { run(t); } } int main() { std::ios::sync_with_stdio(false); run(); return 0; }
#include <bits/stdc++.h> using std::make_pair; using std::pair; typedef pair<int, int> Pair; #define update_max(a, b) \ if ((a) < (b)) \ (a) = (b) #define update_min(a, b) \ if ((a) > (b)) \ (a) = (b) const int N = 100 + 10; struct Point { long long x, y; Point(long long x = 0, long long y = 0) : x(x), y(y) {} void input() { std::cin >> x >> y; } } points[N]; int n; bool cmp(const Point &a, const Point &b) { return atan2(a.y, a.x) < atan2(b.y, b.x); } void run(int case_id = 0) { std::cin >> n; for (int i = 0; i < n; ++i) { points[i].input(); } std::sort(points, points + n, cmp); long long answer = 0; for (int i = 0; i < n; ++i) { Point p; for (int length = 0; length < n; ++length) { int j = (i + length) % n; p.x += points[j].x; p.y += points[j].y; update_max(answer, p.x * p.x + p.y * p.y); } } std::cout << std::setprecision(12) << std::fixed; std::cout << sqrt(answer * 1.0) << "\n"; } void multi_cases_main() { int num_tests; std::cin >> num_tests; for (int t = 1; t <= num_tests; ++t) { run(t); } } int main() { std::ios::sync_with_stdio(false); run(); return 0; }
[ "expression.operation.binary.remove" ]
730,396
730,397
u685085662
cpp
p02926
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <vector> using namespace std; typedef long long ll; const long double PI = 3.141592653589793; const long double eps = 1e-9; struct point { long double theta, x, y; bool operator<(const point &r) const { return theta < r.theta - eps; } }; int main() { int N; cin >> N; vector<point> v; for (int i = 0; i < N; i++) { int x, y; cin >> x >> y; if (x == 0 && y == 0) continue; if (x > 0 && y >= 0) { long double theta = (x != 0 ? atan2(y, x) : PI / 2); v.push_back({theta, x, y}); } else if (x <= 0 && y > 0) { long double theta = (y != 0 ? atan2(-x, y) : PI / 2); v.push_back({PI / 2 + theta, x, y}); } else if (x < 0 && y <= 0) { long double theta = (x != 0 ? atan2(-y, -x) : PI / 2); v.push_back({PI + theta, x, y}); } else { long double theta = (y != 0 ? atan2(x, -y) : PI / 2); v.push_back({3 * PI / 2 + theta, x, y}); } } sort(v.begin(), v.end()); long double ans = 0; for (int i = 0; i < v.size(); i++) { long double nx = 0, ny = 0, upper_theta = v[i].theta + PI; for (int j = 0; j < v.size(); j++) { int t = (i + j) % v.size(); if ((i <= t && v[t].theta <= upper_theta - eps) || (t < i && 2 * PI + v[j].theta <= upper_theta - eps)) { nx += v[t].x, ny += v[t].y; ans = max(ans, sqrtl(nx * nx + ny * ny)); } } ans = max(ans, sqrtl(nx * nx + ny * ny)); } cout << fixed; cout << setprecision(12) << ans << endl; }
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <vector> using namespace std; typedef long long ll; const long double PI = 3.141592653589793; const long double eps = 1e-9; struct point { long double theta, x, y; bool operator<(const point &r) const { return theta < r.theta - eps; } }; int main() { int N; cin >> N; vector<point> v; for (int i = 0; i < N; i++) { int x, y; cin >> x >> y; if (x == 0 && y == 0) continue; if (x > 0 && y >= 0) { long double theta = (x != 0 ? atan2(y, x) : PI / 2); v.push_back({theta, x, y}); } else if (x <= 0 && y > 0) { long double theta = (y != 0 ? atan2(-x, y) : PI / 2); v.push_back({PI / 2 + theta, x, y}); } else if (x < 0 && y <= 0) { long double theta = (x != 0 ? atan2(-y, -x) : PI / 2); v.push_back({PI + theta, x, y}); } else { long double theta = (y != 0 ? atan2(x, -y) : PI / 2); v.push_back({3 * PI / 2 + theta, x, y}); } } sort(v.begin(), v.end()); long double ans = 0; for (int i = 0; i < v.size(); i++) { long double nx = 0, ny = 0, upper_theta = v[i].theta + PI; for (int j = 0; j < v.size(); j++) { int t = (i + j) % v.size(); if ((i <= t && v[t].theta <= upper_theta - eps) || (t < i && 2 * PI + v[t].theta <= upper_theta - eps)) { nx += v[t].x, ny += v[t].y; ans = max(ans, sqrtl(nx * nx + ny * ny)); } } ans = max(ans, sqrtl(nx * nx + ny * ny)); } cout << fixed; cout << setprecision(12) << ans << endl; }
[ "control_flow.branch.if.condition.change" ]
730,398
730,399
u623954643
cpp
p02926
#include <bits/stdc++.h> // #include <boost/multiprecision/cpp_int.hpp> #define int long long #define inf 1000000007 #define pa pair<int, int> #define ll long long #define pal pair<double, double> #define ppap pair<pa, int> #define PI 3.14159265358979323846 #define paa pair<int, char> #define mp make_pair #define pb push_back #define EPS (1e-8) int dx[8] = {0, 1, 0, -1, 1, 1, -1, -1}; int dy[8] = {1, 0, -1, 0, -1, 1, 1, -1}; using namespace std; class pa3 { public: int x; int y, z; pa3(int x = 0, int y = 0, int z = 0) : x(x), y(y), z(z) {} bool operator<(const pa3 &p) const { if (x != p.x) return x < p.x; if (y != p.y) return y < p.y; return z < p.z; // return x != p.x ? x<p.x: y<p.y; } bool operator>(const pa3 &p) const { if (x != p.x) return x > p.x; if (y != p.y) return y > p.y; return z > p.z; // return x != p.x ? x<p.x: y<p.y; } bool operator==(const pa3 &p) const { return x == p.x && y == p.y && z == p.z; } bool operator!=(const pa3 &p) const { return !(x == p.x && y == p.y && z == p.z); } }; class pa4 { public: int x; int y, z, w; pa4(int x = 0, int y = 0, int z = 0, int w = 0) : x(x), y(y), z(z), w(w) {} bool operator<(const pa4 &p) const { if (x != p.x) return x < p.x; if (y != p.y) return y < p.y; if (z != p.z) return z < p.z; return w < p.w; // return x != p.x ? x<p.x: y<p.y; } bool operator>(const pa4 &p) const { if (x != p.x) return x > p.x; if (y != p.y) return y > p.y; if (z != p.z) return z > p.z; return w > p.w; // return x != p.x ? x<p.x: y<p.y; } bool operator==(const pa4 &p) const { return x == p.x && y == p.y && z == p.z && w == p.w; } }; class pa2 { public: int x, y; pa2(int x = 0, int y = 0) : x(x), y(y) {} pa2 operator+(pa2 p) { return pa2(x + p.x, y + p.y); } pa2 operator-(pa2 p) { return pa2(x - p.x, y - p.y); } bool operator<(const pa2 &p) const { return y != p.y ? y < p.y : x < p.x; } bool operator>(const pa2 &p) const { return x != p.x ? x < p.x : y < p.y; } bool operator==(const pa2 &p) const { return abs(x - p.x) == 0 && abs(y - p.y) == 0; } bool operator!=(const pa2 &p) const { return !(abs(x - p.x) == 0 && abs(y - p.y) == 0); } }; string itos(int i) { ostringstream s; s << i; return s.str(); } int gcd(int v, int b) { if (v > b) return gcd(b, v); if (v == b) return b; if (b % v == 0) return v; return gcd(v, b % v); } int mod; int extgcd(int a, int b, int &x, int &y) { if (b == 0) { x = 1; y = 0; return a; } int d = extgcd(b, a % b, y, x); y -= a / b * x; return d; } pa operator+(const pa &l, const pa &r) { return {l.first + r.first, l.second + r.second}; } pa operator-(const pa &l, const pa &r) { return {l.first - r.first, l.second - r.second}; } int pr[1000010]; int inv[1000010]; int beki(int wa, int rr, int warukazu) { if (rr == 0) return 1 % warukazu; if (rr == 1) return wa % warukazu; wa %= warukazu; if (rr % 2 == 1) return ((ll)beki(wa, rr - 1, warukazu) * (ll)wa) % warukazu; ll zx = beki(wa, rr / 2, warukazu); return (zx * zx) % warukazu; } int comb(int nn, int rr) { if (rr < 0 || rr > nn || nn < 0) return 0; int r = pr[nn] * inv[rr]; r %= mod; r *= inv[nn - rr]; r %= mod; return r; } void gya(int ert) { pr[0] = 1; for (int i = 1; i <= ert; i++) { pr[i] = (pr[i - 1] * i) % mod; } inv[ert] = beki(pr[ert], mod - 2, mod); for (int i = ert - 1; i >= 0; i--) { inv[i] = inv[i + 1] * (i + 1) % mod; } } // cin.tie(0); // ios::sync_with_stdio(false); // priority_queue<pa3,vector<pa3>,greater<pa3>> pq; // sort(ve.begin(),ve.end(),greater<int>()); // mt19937(clock_per_sec); // mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()) ; //----------------kokomade tenpure------------ double d(double x, double y) { return sqrt(x * x + y * y); } signed main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector<pair<double, pair<double, double>>> ve; for (int i = 0; i < n; i++) { double x, y; cin >> x >> y; if (abs(x) < 0.5 && abs(y < 0.5)) continue; ve.pb(mp(atan2(x, y), mp(x, y))); ve.pb(mp(atan2(x, y) + 2.0 * PI, mp(x, y))); } sort(ve.begin(), ve.end()); n = ve.size(); n /= 2; double ans = 0; for (int i = 0; i < n; i++) { double x = 0, y = 0; for (int j = i; j < i + n; j++) { x += ve[j].second.first; y += ve[j].second.second; ans = max(ans, d(x, y)); } } printf("%.10lf\n", ans); return 0; }
#include <bits/stdc++.h> // #include <boost/multiprecision/cpp_int.hpp> #define int long long #define inf 1000000007 #define pa pair<int, int> #define ll long long #define pal pair<double, double> #define ppap pair<pa, int> #define PI 3.14159265358979323846 #define paa pair<int, char> #define mp make_pair #define pb push_back #define EPS (1e-8) int dx[8] = {0, 1, 0, -1, 1, 1, -1, -1}; int dy[8] = {1, 0, -1, 0, -1, 1, 1, -1}; using namespace std; class pa3 { public: int x; int y, z; pa3(int x = 0, int y = 0, int z = 0) : x(x), y(y), z(z) {} bool operator<(const pa3 &p) const { if (x != p.x) return x < p.x; if (y != p.y) return y < p.y; return z < p.z; // return x != p.x ? x<p.x: y<p.y; } bool operator>(const pa3 &p) const { if (x != p.x) return x > p.x; if (y != p.y) return y > p.y; return z > p.z; // return x != p.x ? x<p.x: y<p.y; } bool operator==(const pa3 &p) const { return x == p.x && y == p.y && z == p.z; } bool operator!=(const pa3 &p) const { return !(x == p.x && y == p.y && z == p.z); } }; class pa4 { public: int x; int y, z, w; pa4(int x = 0, int y = 0, int z = 0, int w = 0) : x(x), y(y), z(z), w(w) {} bool operator<(const pa4 &p) const { if (x != p.x) return x < p.x; if (y != p.y) return y < p.y; if (z != p.z) return z < p.z; return w < p.w; // return x != p.x ? x<p.x: y<p.y; } bool operator>(const pa4 &p) const { if (x != p.x) return x > p.x; if (y != p.y) return y > p.y; if (z != p.z) return z > p.z; return w > p.w; // return x != p.x ? x<p.x: y<p.y; } bool operator==(const pa4 &p) const { return x == p.x && y == p.y && z == p.z && w == p.w; } }; class pa2 { public: int x, y; pa2(int x = 0, int y = 0) : x(x), y(y) {} pa2 operator+(pa2 p) { return pa2(x + p.x, y + p.y); } pa2 operator-(pa2 p) { return pa2(x - p.x, y - p.y); } bool operator<(const pa2 &p) const { return y != p.y ? y < p.y : x < p.x; } bool operator>(const pa2 &p) const { return x != p.x ? x < p.x : y < p.y; } bool operator==(const pa2 &p) const { return abs(x - p.x) == 0 && abs(y - p.y) == 0; } bool operator!=(const pa2 &p) const { return !(abs(x - p.x) == 0 && abs(y - p.y) == 0); } }; string itos(int i) { ostringstream s; s << i; return s.str(); } int gcd(int v, int b) { if (v > b) return gcd(b, v); if (v == b) return b; if (b % v == 0) return v; return gcd(v, b % v); } int mod; int extgcd(int a, int b, int &x, int &y) { if (b == 0) { x = 1; y = 0; return a; } int d = extgcd(b, a % b, y, x); y -= a / b * x; return d; } pa operator+(const pa &l, const pa &r) { return {l.first + r.first, l.second + r.second}; } pa operator-(const pa &l, const pa &r) { return {l.first - r.first, l.second - r.second}; } int pr[1000010]; int inv[1000010]; int beki(int wa, int rr, int warukazu) { if (rr == 0) return 1 % warukazu; if (rr == 1) return wa % warukazu; wa %= warukazu; if (rr % 2 == 1) return ((ll)beki(wa, rr - 1, warukazu) * (ll)wa) % warukazu; ll zx = beki(wa, rr / 2, warukazu); return (zx * zx) % warukazu; } int comb(int nn, int rr) { if (rr < 0 || rr > nn || nn < 0) return 0; int r = pr[nn] * inv[rr]; r %= mod; r *= inv[nn - rr]; r %= mod; return r; } void gya(int ert) { pr[0] = 1; for (int i = 1; i <= ert; i++) { pr[i] = (pr[i - 1] * i) % mod; } inv[ert] = beki(pr[ert], mod - 2, mod); for (int i = ert - 1; i >= 0; i--) { inv[i] = inv[i + 1] * (i + 1) % mod; } } // cin.tie(0); // ios::sync_with_stdio(false); // priority_queue<pa3,vector<pa3>,greater<pa3>> pq; // sort(ve.begin(),ve.end(),greater<int>()); // mt19937(clock_per_sec); // mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()) ; //----------------kokomade tenpure------------ double d(double x, double y) { return sqrt(x * x + y * y); } signed main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector<pair<double, pair<double, double>>> ve; for (int i = 0; i < n; i++) { double x, y; cin >> x >> y; if (abs(x) < 0.5 && abs(y) < 0.5) continue; ve.pb(mp(atan2(x, y), mp(x, y))); ve.pb(mp(atan2(x, y) + 2.0 * PI, mp(x, y))); } sort(ve.begin(), ve.end()); n = ve.size(); n /= 2; double ans = 0; for (int i = 0; i < n; i++) { double x = 0, y = 0; for (int j = i; j < i + n; j++) { x += ve[j].second.first; y += ve[j].second.second; ans = max(ans, d(x, y)); } } printf("%.10lf\n", ans); return 0; }
[ "control_flow.branch.if.condition.change" ]
730,400
730,401
u834777932
cpp
p02926
#include <bits/stdc++.h> // #include <boost/multiprecision/cpp_int.hpp> #define int long long #define inf 1000000007 #define pa pair<int, int> #define ll long long #define pal pair<double, double> #define ppap pair<pa, int> #define PI 3.14159265358979323846 #define paa pair<int, char> #define mp make_pair #define pb push_back #define EPS (1e-8) int dx[8] = {0, 1, 0, -1, 1, 1, -1, -1}; int dy[8] = {1, 0, -1, 0, -1, 1, 1, -1}; using namespace std; class pa3 { public: int x; int y, z; pa3(int x = 0, int y = 0, int z = 0) : x(x), y(y), z(z) {} bool operator<(const pa3 &p) const { if (x != p.x) return x < p.x; if (y != p.y) return y < p.y; return z < p.z; // return x != p.x ? x<p.x: y<p.y; } bool operator>(const pa3 &p) const { if (x != p.x) return x > p.x; if (y != p.y) return y > p.y; return z > p.z; // return x != p.x ? x<p.x: y<p.y; } bool operator==(const pa3 &p) const { return x == p.x && y == p.y && z == p.z; } bool operator!=(const pa3 &p) const { return !(x == p.x && y == p.y && z == p.z); } }; class pa4 { public: int x; int y, z, w; pa4(int x = 0, int y = 0, int z = 0, int w = 0) : x(x), y(y), z(z), w(w) {} bool operator<(const pa4 &p) const { if (x != p.x) return x < p.x; if (y != p.y) return y < p.y; if (z != p.z) return z < p.z; return w < p.w; // return x != p.x ? x<p.x: y<p.y; } bool operator>(const pa4 &p) const { if (x != p.x) return x > p.x; if (y != p.y) return y > p.y; if (z != p.z) return z > p.z; return w > p.w; // return x != p.x ? x<p.x: y<p.y; } bool operator==(const pa4 &p) const { return x == p.x && y == p.y && z == p.z && w == p.w; } }; class pa2 { public: int x, y; pa2(int x = 0, int y = 0) : x(x), y(y) {} pa2 operator+(pa2 p) { return pa2(x + p.x, y + p.y); } pa2 operator-(pa2 p) { return pa2(x - p.x, y - p.y); } bool operator<(const pa2 &p) const { return y != p.y ? y < p.y : x < p.x; } bool operator>(const pa2 &p) const { return x != p.x ? x < p.x : y < p.y; } bool operator==(const pa2 &p) const { return abs(x - p.x) == 0 && abs(y - p.y) == 0; } bool operator!=(const pa2 &p) const { return !(abs(x - p.x) == 0 && abs(y - p.y) == 0); } }; string itos(int i) { ostringstream s; s << i; return s.str(); } int gcd(int v, int b) { if (v > b) return gcd(b, v); if (v == b) return b; if (b % v == 0) return v; return gcd(v, b % v); } int mod; int extgcd(int a, int b, int &x, int &y) { if (b == 0) { x = 1; y = 0; return a; } int d = extgcd(b, a % b, y, x); y -= a / b * x; return d; } pa operator+(const pa &l, const pa &r) { return {l.first + r.first, l.second + r.second}; } pa operator-(const pa &l, const pa &r) { return {l.first - r.first, l.second - r.second}; } int pr[1000010]; int inv[1000010]; int beki(int wa, int rr, int warukazu) { if (rr == 0) return 1 % warukazu; if (rr == 1) return wa % warukazu; wa %= warukazu; if (rr % 2 == 1) return ((ll)beki(wa, rr - 1, warukazu) * (ll)wa) % warukazu; ll zx = beki(wa, rr / 2, warukazu); return (zx * zx) % warukazu; } int comb(int nn, int rr) { if (rr < 0 || rr > nn || nn < 0) return 0; int r = pr[nn] * inv[rr]; r %= mod; r *= inv[nn - rr]; r %= mod; return r; } void gya(int ert) { pr[0] = 1; for (int i = 1; i <= ert; i++) { pr[i] = (pr[i - 1] * i) % mod; } inv[ert] = beki(pr[ert], mod - 2, mod); for (int i = ert - 1; i >= 0; i--) { inv[i] = inv[i + 1] * (i + 1) % mod; } } // cin.tie(0); // ios::sync_with_stdio(false); // priority_queue<pa3,vector<pa3>,greater<pa3>> pq; // sort(ve.begin(),ve.end(),greater<int>()); // mt19937(clock_per_sec); // mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()) ; //----------------kokomade tenpure------------ double d(double x, double y) { return sqrt(x * x + y * y); } signed main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector<pair<double, pair<double, double>>> ve; for (int i = 0; i < n; i++) { double x, y; cin >> x >> y; if (abs(x) < 0.5 && abs(y < 0.5)) continue; ve.pb(mp(atan2(x, y), mp(x, y))); ve.pb(mp(atan2(x, y) + 2.0 * PI, mp(x, y))); } sort(ve.begin(), ve.end()); n = ve.size(); n /= 2; double ans = -1; for (int i = 0; i < n; i++) { double x = 0, y = 0; for (int j = i; j < i + n; j++) { x += ve[j].second.first; y += ve[j].second.second; ans = max(ans, d(x, y)); } } printf("%.10lf\n", ans); return 0; }
#include <bits/stdc++.h> // #include <boost/multiprecision/cpp_int.hpp> #define int long long #define inf 1000000007 #define pa pair<int, int> #define ll long long #define pal pair<double, double> #define ppap pair<pa, int> #define PI 3.14159265358979323846 #define paa pair<int, char> #define mp make_pair #define pb push_back #define EPS (1e-8) int dx[8] = {0, 1, 0, -1, 1, 1, -1, -1}; int dy[8] = {1, 0, -1, 0, -1, 1, 1, -1}; using namespace std; class pa3 { public: int x; int y, z; pa3(int x = 0, int y = 0, int z = 0) : x(x), y(y), z(z) {} bool operator<(const pa3 &p) const { if (x != p.x) return x < p.x; if (y != p.y) return y < p.y; return z < p.z; // return x != p.x ? x<p.x: y<p.y; } bool operator>(const pa3 &p) const { if (x != p.x) return x > p.x; if (y != p.y) return y > p.y; return z > p.z; // return x != p.x ? x<p.x: y<p.y; } bool operator==(const pa3 &p) const { return x == p.x && y == p.y && z == p.z; } bool operator!=(const pa3 &p) const { return !(x == p.x && y == p.y && z == p.z); } }; class pa4 { public: int x; int y, z, w; pa4(int x = 0, int y = 0, int z = 0, int w = 0) : x(x), y(y), z(z), w(w) {} bool operator<(const pa4 &p) const { if (x != p.x) return x < p.x; if (y != p.y) return y < p.y; if (z != p.z) return z < p.z; return w < p.w; // return x != p.x ? x<p.x: y<p.y; } bool operator>(const pa4 &p) const { if (x != p.x) return x > p.x; if (y != p.y) return y > p.y; if (z != p.z) return z > p.z; return w > p.w; // return x != p.x ? x<p.x: y<p.y; } bool operator==(const pa4 &p) const { return x == p.x && y == p.y && z == p.z && w == p.w; } }; class pa2 { public: int x, y; pa2(int x = 0, int y = 0) : x(x), y(y) {} pa2 operator+(pa2 p) { return pa2(x + p.x, y + p.y); } pa2 operator-(pa2 p) { return pa2(x - p.x, y - p.y); } bool operator<(const pa2 &p) const { return y != p.y ? y < p.y : x < p.x; } bool operator>(const pa2 &p) const { return x != p.x ? x < p.x : y < p.y; } bool operator==(const pa2 &p) const { return abs(x - p.x) == 0 && abs(y - p.y) == 0; } bool operator!=(const pa2 &p) const { return !(abs(x - p.x) == 0 && abs(y - p.y) == 0); } }; string itos(int i) { ostringstream s; s << i; return s.str(); } int gcd(int v, int b) { if (v > b) return gcd(b, v); if (v == b) return b; if (b % v == 0) return v; return gcd(v, b % v); } int mod; int extgcd(int a, int b, int &x, int &y) { if (b == 0) { x = 1; y = 0; return a; } int d = extgcd(b, a % b, y, x); y -= a / b * x; return d; } pa operator+(const pa &l, const pa &r) { return {l.first + r.first, l.second + r.second}; } pa operator-(const pa &l, const pa &r) { return {l.first - r.first, l.second - r.second}; } int pr[1000010]; int inv[1000010]; int beki(int wa, int rr, int warukazu) { if (rr == 0) return 1 % warukazu; if (rr == 1) return wa % warukazu; wa %= warukazu; if (rr % 2 == 1) return ((ll)beki(wa, rr - 1, warukazu) * (ll)wa) % warukazu; ll zx = beki(wa, rr / 2, warukazu); return (zx * zx) % warukazu; } int comb(int nn, int rr) { if (rr < 0 || rr > nn || nn < 0) return 0; int r = pr[nn] * inv[rr]; r %= mod; r *= inv[nn - rr]; r %= mod; return r; } void gya(int ert) { pr[0] = 1; for (int i = 1; i <= ert; i++) { pr[i] = (pr[i - 1] * i) % mod; } inv[ert] = beki(pr[ert], mod - 2, mod); for (int i = ert - 1; i >= 0; i--) { inv[i] = inv[i + 1] * (i + 1) % mod; } } // cin.tie(0); // ios::sync_with_stdio(false); // priority_queue<pa3,vector<pa3>,greater<pa3>> pq; // sort(ve.begin(),ve.end(),greater<int>()); // mt19937(clock_per_sec); // mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count()) ; //----------------kokomade tenpure------------ double d(double x, double y) { return sqrt(x * x + y * y); } signed main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector<pair<double, pair<double, double>>> ve; for (int i = 0; i < n; i++) { double x, y; cin >> x >> y; if (abs(x) < 0.5 && abs(y) < 0.5) continue; ve.pb(mp(atan2(x, y), mp(x, y))); ve.pb(mp(atan2(x, y) + 2.0 * PI, mp(x, y))); } sort(ve.begin(), ve.end()); n = ve.size(); n /= 2; double ans = 0; for (int i = 0; i < n; i++) { double x = 0, y = 0; for (int j = i; j < i + n; j++) { x += ve[j].second.first; y += ve[j].second.second; ans = max(ans, d(x, y)); } } printf("%.10lf\n", ans); return 0; }
[ "control_flow.branch.if.condition.change", "literal.number.change", "variable_declaration.value.change" ]
730,402
730,401
u834777932
cpp
p02926
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; using uint = unsigned int; using pcc = pair<char, char>; using pii = pair<int, int>; using pll = pair<ll, ll>; using pdd = pair<double, double>; using tuplis = pair<ll, pll>; using tuplis2 = pair<pll, ll>; template <class T> using pq = priority_queue<T, vector<T>, greater<T>>; const ll LINF = 0x1fffffffffffffff; const ll MINF = 0x7fffffffffff; const int INF = 0x3fffffff; const ll MOD = 1000000007; const ll MODD = 998244353; const ld DINF = numeric_limits<ld>::infinity(); const ld EPS = 1e-9; const vector<ll> four{0, 1, 0, -1, 0}; #define _overload4(_1, _2, _3, _4, name, ...) name #define _overload3(_1, _2, _3, name, ...) name #define _rep1(n) for (ll i = 0; i < n; ++i) #define _rep2(i, n) for (ll i = 0; i < n; ++i) #define _rep3(i, a, b) for (ll i = a; i < b; ++i) #define _rep4(i, a, b, c) for (ll i = a; i < b; i += c) #define rep(...) \ _overload4(__VA_ARGS__, _rep4, _rep3, _rep2, _rep1)(__VA_ARGS__) #define _rrep1(n) for (ll i = (n)-1; i >= 0; i--) #define _rrep2(i, n) for (ll i = (n)-1; i >= 0; i--) #define _rrep3(i, a, b) for (ll i = (b)-1; i >= a; i--) #define _rrep4(i, a, b, c) for (ll i = a + (b - a - 1) / c * c; i >= a; i -= c) #define rrep(...) \ _overload4(__VA_ARGS__, _rrep4, _rrep3, _rrep2, _rrep1)(__VA_ARGS__) #define each(i, a) for (auto &i : a) #define sum(...) accumulate(range(__VA_ARGS__), 0LL) #define dsum(...) accumulate(range(__VA_ARGS__), double(0)) #define _range(i) (i).begin(), (i).end() #define _range2(i, k) (i).begin(), (i).begin() + k #define _range3(i, a, b) (i).begin() + a, (i).begin() + b #define range(...) \ _overload3(__VA_ARGS__, _range3, _range2, _range)(__VA_ARGS__) #define _rrange(i) (i).rbegin(), (i).rend() #define _rrange2(i, k) (i).rbegin(), (i).rbegin() + k #define _rrange3(i, a, b) (i).rbegin() + a, (i).rbegin() + b #define rrange(...) \ _overload3(__VA_ARGS__, _rrange3, _rrange2, _rrange)(__VA_ARGS__) #define elif else if #define unless(a) if (!(a)) #define mp make_pair #define mt make_tuple #define INT(...) \ int __VA_ARGS__; \ in(__VA_ARGS__) #define LL(...) \ ll __VA_ARGS__; \ in(__VA_ARGS__) #define ULL(...) \ ull __VA_ARGS__; \ in(__VA_ARGS__) #define STR(...) \ string __VA_ARGS__; \ in(__VA_ARGS__) #define CHR(...) \ char __VA_ARGS__; \ in(__VA_ARGS__) #define DBL(...) \ double __VA_ARGS__; \ in(__VA_ARGS__) #define vec(type, name, ...) vector<type> name(__VA_ARGS__) #define VEC(type, name, size) \ vector<type> name(size); \ in(name) #define vv(type, name, h, ...) \ vector<vector<type>> name(h, vector<type>(__VA_ARGS__)) #define VV(type, name, h, ...) \ vector<vector<type>> name(h, vector<type>(__VA_ARGS__)); \ in(name) #define vvv(type, name, h, w, ...) \ vector<vector<vector<type>>> name( \ h, vector<vector<type>>(w, vector<type>(__VA_ARGS__))) inline constexpr ll gcd(ll a, ll b) { if (!a || !b) return 0; while (b) { ll c = b; b = a % b; a = c; } return a; } inline constexpr ll lcm(ll a, ll b) { if (!a || !b) return 0; return a * b / gcd(a, b); } template <class T> inline constexpr T min(vector<T> &v) { return *min_element(range(v)); } inline char min(string &v) { return *min_element(range(v)); } template <class T> inline constexpr T max(vector<T> &v) { return *max_element(range(v)); } inline char max(string &v) { return *max_element(range(v)); } inline constexpr ll intpow(ll a, ll b) { ll ans = 1; for (ll i = 1; b; i *= 2) { if (b & i) { b ^= i; ans *= a; } a *= a; } return ans; } template <typename T> inline constexpr bool chmin(T &mn, const T &cnt) { if (mn > cnt) { mn = cnt; return 1; } else return 0; } template <typename T> inline constexpr bool chmax(T &mx, const T &cnt) { if (mx < cnt) { mx = cnt; return 1; } else return 0; } template <class T> unordered_map<T, ll> press(vector<T> &a) { auto b = a; sort(range(b)); b.erase(unique(range(b)), b.end()); unordered_map<T, ll> ans; rep(b.size()) ans[b[i]] = i; each(i, a) i = ans[i]; return ans; } template <class T> map<T, ll> press_map(vector<T> &a) { auto b = a; sort(range(b)); b.erase(unique(range(b)), b.end()); map<T, ll> ans; rep(b.size()) ans[b[i]] = i; each(i, a) i = ans[i]; return ans; } inline int scan() { return getchar(); } inline void scan(int &a) { scanf("%d", &a); } inline void scan(unsigned &a) { scanf("%u", &a); } inline void scan(long &a) { scanf("%ld", &a); } inline void scan(long long &a) { scanf("%lld", &a); } inline void scan(unsigned long long &a) { scanf("%llu", &a); } inline void scan(char &a) { cin >> a; } inline void scan(float &a) { scanf("%f", &a); } inline void scan(double &a) { scanf("%lf", &a); } inline void scan(long double &a) { scanf("%Lf", &a); } inline void scan(vector<bool> &vec) { for (unsigned i = 0; i < vec.size(); i++) { int a; scan(a); vec[i] = a; } } inline void scan(string &a) { cin >> a; } template <class T> inline void scan(vector<T> &vec); template <class T, size_t size> inline void scan(array<T, size> &vec); template <class T, class L> inline void scan(pair<T, L> &p); template <class T, size_t size> inline void scan(T (&vec)[size]); template <class T> inline void scan(vector<T> &vec) { for (auto &i : vec) scan(i); } template <class T, size_t size> inline void scan(array<T, size> &vec) { for (auto &i : vec) scan(i); } template <class T, class L> inline void scan(pair<T, L> &p) { scan(p.first); scan(p.second); } template <class T, size_t size> inline void scan(T (&vec)[size]) { for (auto &i : vec) scan(i); } template <class T> inline void scan(T &a) { cin >> a; } inline void in() {} template <class Head, class... Tail> inline void in(Head &head, Tail &...tail) { scan(head); in(tail...); } inline void print() { putchar(' '); } inline void print(const bool &a) { printf("%d", a); } inline void print(const int &a) { printf("%d", a); } inline void print(const unsigned &a) { printf("%u", a); } inline void print(const long &a) { printf("%ld", a); } inline void print(const long long &a) { printf("%lld", a); } inline void print(const unsigned long long &a) { printf("%llu", a); } inline void print(const char &a) { printf("%c", a); } inline void print(const char a[]) { printf("%s", a); } inline void print(const float &a) { printf("%.15f", a); } inline void print(const double &a) { printf("%.15f", a); } inline void print(const long double &a) { printf("%.15Lf", a); } template <class T> void print(const vector<T> &vec); template <class T, size_t size> void print(const array<T, size> &vec); template <class T, class L> void print(const pair<T, L> &p); template <class T, size_t size> inline void print(const T (&vec)[size]); template <class T> void print(const vector<T> &vec) { if (vec.empty()) return; print(vec[0]); for (auto i = vec.begin(); ++i != vec.end();) { putchar(' '); print(*i); } } template <class T, size_t size> void print(const array<T, size> &vec) { print(vec[0]); for (auto i = vec.begin(); ++i != vec.end();) { putchar(' '); print(*i); } } template <class T, class L> void print(const pair<T, L> &p) { print(p.first); putchar(' '); print(p.second); } template <class T, size_t size> inline void print(const T (&vec)[size]) { print(vec[0]); for (auto i = vec; ++i != end(vec);) { putchar(' '); print(*i); } } template <class T> inline void print(const T &a) { cout << a; } inline int out() { putchar('\n'); return 0; } template <class T> inline int out(const T &t) { print(t); putchar('\n'); return 0; } template <class Head, class... Tail> inline int out(const Head &head, const Tail &...tail) { print(head); putchar(' '); out(tail...); return 0; } template <class T> inline void err(T t) { cerr << t << '\n'; } inline void err() { cerr << '\n'; } inline int first(const bool &i) { return out(i ? "first" : "second"); } inline int yes(const bool &i) { return out(i ? "yes" : "no"); } inline int Yes(const bool &i) { return out(i ? "Yes" : "No"); } inline int YES(const bool &i) { return out(i ? "YES" : "NO"); } inline int Yay(const bool &i) { return out(i ? "Yay!" : ":("); } inline int Possible(const bool &i) { return out(i ? "Possible" : "Impossible"); } inline int POSSIBLE(const bool &i) { return out(i ? "POSSIBLE" : "IMPOSSIBLE"); } inline void Case(ll i) { printf("Case #%lld: ", i); } signed main() { LL(n); VEC(pll, a, n); vector<pair<ld, pll>> r; each(i, a) { ld at = atan2(ld(i.first), ld(i.second)); r.push_back({at, i}); r.push_back({at + 3.14159265358979 * 2, i}); } sort(range(r)); ld ans = 0; rep(n) { ll x = 0, y = 0; rep(j, i, n * 2) { x += r[j].second.first; y += r[j].second.second; chmax(ans, sqrt(ld(x * x + y * y))); } } out(ans); }
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; using uint = unsigned int; using pcc = pair<char, char>; using pii = pair<int, int>; using pll = pair<ll, ll>; using pdd = pair<double, double>; using tuplis = pair<ll, pll>; using tuplis2 = pair<pll, ll>; template <class T> using pq = priority_queue<T, vector<T>, greater<T>>; const ll LINF = 0x1fffffffffffffff; const ll MINF = 0x7fffffffffff; const int INF = 0x3fffffff; const ll MOD = 1000000007; const ll MODD = 998244353; const ld DINF = numeric_limits<ld>::infinity(); const ld EPS = 1e-9; const vector<ll> four{0, 1, 0, -1, 0}; #define _overload4(_1, _2, _3, _4, name, ...) name #define _overload3(_1, _2, _3, name, ...) name #define _rep1(n) for (ll i = 0; i < n; ++i) #define _rep2(i, n) for (ll i = 0; i < n; ++i) #define _rep3(i, a, b) for (ll i = a; i < b; ++i) #define _rep4(i, a, b, c) for (ll i = a; i < b; i += c) #define rep(...) \ _overload4(__VA_ARGS__, _rep4, _rep3, _rep2, _rep1)(__VA_ARGS__) #define _rrep1(n) for (ll i = (n)-1; i >= 0; i--) #define _rrep2(i, n) for (ll i = (n)-1; i >= 0; i--) #define _rrep3(i, a, b) for (ll i = (b)-1; i >= a; i--) #define _rrep4(i, a, b, c) for (ll i = a + (b - a - 1) / c * c; i >= a; i -= c) #define rrep(...) \ _overload4(__VA_ARGS__, _rrep4, _rrep3, _rrep2, _rrep1)(__VA_ARGS__) #define each(i, a) for (auto &i : a) #define sum(...) accumulate(range(__VA_ARGS__), 0LL) #define dsum(...) accumulate(range(__VA_ARGS__), double(0)) #define _range(i) (i).begin(), (i).end() #define _range2(i, k) (i).begin(), (i).begin() + k #define _range3(i, a, b) (i).begin() + a, (i).begin() + b #define range(...) \ _overload3(__VA_ARGS__, _range3, _range2, _range)(__VA_ARGS__) #define _rrange(i) (i).rbegin(), (i).rend() #define _rrange2(i, k) (i).rbegin(), (i).rbegin() + k #define _rrange3(i, a, b) (i).rbegin() + a, (i).rbegin() + b #define rrange(...) \ _overload3(__VA_ARGS__, _rrange3, _rrange2, _rrange)(__VA_ARGS__) #define elif else if #define unless(a) if (!(a)) #define mp make_pair #define mt make_tuple #define INT(...) \ int __VA_ARGS__; \ in(__VA_ARGS__) #define LL(...) \ ll __VA_ARGS__; \ in(__VA_ARGS__) #define ULL(...) \ ull __VA_ARGS__; \ in(__VA_ARGS__) #define STR(...) \ string __VA_ARGS__; \ in(__VA_ARGS__) #define CHR(...) \ char __VA_ARGS__; \ in(__VA_ARGS__) #define DBL(...) \ double __VA_ARGS__; \ in(__VA_ARGS__) #define vec(type, name, ...) vector<type> name(__VA_ARGS__) #define VEC(type, name, size) \ vector<type> name(size); \ in(name) #define vv(type, name, h, ...) \ vector<vector<type>> name(h, vector<type>(__VA_ARGS__)) #define VV(type, name, h, ...) \ vector<vector<type>> name(h, vector<type>(__VA_ARGS__)); \ in(name) #define vvv(type, name, h, w, ...) \ vector<vector<vector<type>>> name( \ h, vector<vector<type>>(w, vector<type>(__VA_ARGS__))) inline constexpr ll gcd(ll a, ll b) { if (!a || !b) return 0; while (b) { ll c = b; b = a % b; a = c; } return a; } inline constexpr ll lcm(ll a, ll b) { if (!a || !b) return 0; return a * b / gcd(a, b); } template <class T> inline constexpr T min(vector<T> &v) { return *min_element(range(v)); } inline char min(string &v) { return *min_element(range(v)); } template <class T> inline constexpr T max(vector<T> &v) { return *max_element(range(v)); } inline char max(string &v) { return *max_element(range(v)); } inline constexpr ll intpow(ll a, ll b) { ll ans = 1; for (ll i = 1; b; i *= 2) { if (b & i) { b ^= i; ans *= a; } a *= a; } return ans; } template <typename T> inline constexpr bool chmin(T &mn, const T &cnt) { if (mn > cnt) { mn = cnt; return 1; } else return 0; } template <typename T> inline constexpr bool chmax(T &mx, const T &cnt) { if (mx < cnt) { mx = cnt; return 1; } else return 0; } template <class T> unordered_map<T, ll> press(vector<T> &a) { auto b = a; sort(range(b)); b.erase(unique(range(b)), b.end()); unordered_map<T, ll> ans; rep(b.size()) ans[b[i]] = i; each(i, a) i = ans[i]; return ans; } template <class T> map<T, ll> press_map(vector<T> &a) { auto b = a; sort(range(b)); b.erase(unique(range(b)), b.end()); map<T, ll> ans; rep(b.size()) ans[b[i]] = i; each(i, a) i = ans[i]; return ans; } inline int scan() { return getchar(); } inline void scan(int &a) { scanf("%d", &a); } inline void scan(unsigned &a) { scanf("%u", &a); } inline void scan(long &a) { scanf("%ld", &a); } inline void scan(long long &a) { scanf("%lld", &a); } inline void scan(unsigned long long &a) { scanf("%llu", &a); } inline void scan(char &a) { cin >> a; } inline void scan(float &a) { scanf("%f", &a); } inline void scan(double &a) { scanf("%lf", &a); } inline void scan(long double &a) { scanf("%Lf", &a); } inline void scan(vector<bool> &vec) { for (unsigned i = 0; i < vec.size(); i++) { int a; scan(a); vec[i] = a; } } inline void scan(string &a) { cin >> a; } template <class T> inline void scan(vector<T> &vec); template <class T, size_t size> inline void scan(array<T, size> &vec); template <class T, class L> inline void scan(pair<T, L> &p); template <class T, size_t size> inline void scan(T (&vec)[size]); template <class T> inline void scan(vector<T> &vec) { for (auto &i : vec) scan(i); } template <class T, size_t size> inline void scan(array<T, size> &vec) { for (auto &i : vec) scan(i); } template <class T, class L> inline void scan(pair<T, L> &p) { scan(p.first); scan(p.second); } template <class T, size_t size> inline void scan(T (&vec)[size]) { for (auto &i : vec) scan(i); } template <class T> inline void scan(T &a) { cin >> a; } inline void in() {} template <class Head, class... Tail> inline void in(Head &head, Tail &...tail) { scan(head); in(tail...); } inline void print() { putchar(' '); } inline void print(const bool &a) { printf("%d", a); } inline void print(const int &a) { printf("%d", a); } inline void print(const unsigned &a) { printf("%u", a); } inline void print(const long &a) { printf("%ld", a); } inline void print(const long long &a) { printf("%lld", a); } inline void print(const unsigned long long &a) { printf("%llu", a); } inline void print(const char &a) { printf("%c", a); } inline void print(const char a[]) { printf("%s", a); } inline void print(const float &a) { printf("%.15f", a); } inline void print(const double &a) { printf("%.15f", a); } inline void print(const long double &a) { printf("%.15Lf", a); } template <class T> void print(const vector<T> &vec); template <class T, size_t size> void print(const array<T, size> &vec); template <class T, class L> void print(const pair<T, L> &p); template <class T, size_t size> inline void print(const T (&vec)[size]); template <class T> void print(const vector<T> &vec) { if (vec.empty()) return; print(vec[0]); for (auto i = vec.begin(); ++i != vec.end();) { putchar(' '); print(*i); } } template <class T, size_t size> void print(const array<T, size> &vec) { print(vec[0]); for (auto i = vec.begin(); ++i != vec.end();) { putchar(' '); print(*i); } } template <class T, class L> void print(const pair<T, L> &p) { print(p.first); putchar(' '); print(p.second); } template <class T, size_t size> inline void print(const T (&vec)[size]) { print(vec[0]); for (auto i = vec; ++i != end(vec);) { putchar(' '); print(*i); } } template <class T> inline void print(const T &a) { cout << a; } inline int out() { putchar('\n'); return 0; } template <class T> inline int out(const T &t) { print(t); putchar('\n'); return 0; } template <class Head, class... Tail> inline int out(const Head &head, const Tail &...tail) { print(head); putchar(' '); out(tail...); return 0; } template <class T> inline void err(T t) { cerr << t << '\n'; } inline void err() { cerr << '\n'; } inline int first(const bool &i) { return out(i ? "first" : "second"); } inline int yes(const bool &i) { return out(i ? "yes" : "no"); } inline int Yes(const bool &i) { return out(i ? "Yes" : "No"); } inline int YES(const bool &i) { return out(i ? "YES" : "NO"); } inline int Yay(const bool &i) { return out(i ? "Yay!" : ":("); } inline int Possible(const bool &i) { return out(i ? "Possible" : "Impossible"); } inline int POSSIBLE(const bool &i) { return out(i ? "POSSIBLE" : "IMPOSSIBLE"); } inline void Case(ll i) { printf("Case #%lld: ", i); } signed main() { LL(n); VEC(pll, a, n); vector<pair<ld, pll>> r; each(i, a) { ld at = atan2(ld(i.first), ld(i.second)); r.push_back({at, i}); r.push_back({at + 3.14159265358979 * 2, i}); } sort(range(r)); ld ans = 0; rep(n) { ll x = 0, y = 0; rep(j, i, i + n) { x += r[j].second.first; y += r[j].second.second; chmax(ans, sqrt(ld(x * x + y * y))); } } out(ans); }
[ "expression.operation.binary.remove" ]
730,403
730,404
u874644572
cpp
p02926
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; using uint = unsigned int; using pcc = pair<char, char>; using pii = pair<int, int>; using pll = pair<ll, ll>; using pdd = pair<double, double>; using tuplis = pair<ll, pll>; using tuplis2 = pair<pll, ll>; template <class T> using pq = priority_queue<T, vector<T>, greater<T>>; const ll LINF = 0x1fffffffffffffff; const ll MINF = 0x7fffffffffff; const int INF = 0x3fffffff; const ll MOD = 1000000007; const ll MODD = 998244353; const ld DINF = numeric_limits<ld>::infinity(); const ld EPS = 1e-9; const vector<ll> four{0, 1, 0, -1, 0}; #define _overload4(_1, _2, _3, _4, name, ...) name #define _overload3(_1, _2, _3, name, ...) name #define _rep1(n) for (ll i = 0; i < n; ++i) #define _rep2(i, n) for (ll i = 0; i < n; ++i) #define _rep3(i, a, b) for (ll i = a; i < b; ++i) #define _rep4(i, a, b, c) for (ll i = a; i < b; i += c) #define rep(...) \ _overload4(__VA_ARGS__, _rep4, _rep3, _rep2, _rep1)(__VA_ARGS__) #define _rrep1(n) for (ll i = (n)-1; i >= 0; i--) #define _rrep2(i, n) for (ll i = (n)-1; i >= 0; i--) #define _rrep3(i, a, b) for (ll i = (b)-1; i >= a; i--) #define _rrep4(i, a, b, c) for (ll i = a + (b - a - 1) / c * c; i >= a; i -= c) #define rrep(...) \ _overload4(__VA_ARGS__, _rrep4, _rrep3, _rrep2, _rrep1)(__VA_ARGS__) #define each(i, a) for (auto &i : a) #define sum(...) accumulate(range(__VA_ARGS__), 0LL) #define dsum(...) accumulate(range(__VA_ARGS__), double(0)) #define _range(i) (i).begin(), (i).end() #define _range2(i, k) (i).begin(), (i).begin() + k #define _range3(i, a, b) (i).begin() + a, (i).begin() + b #define range(...) \ _overload3(__VA_ARGS__, _range3, _range2, _range)(__VA_ARGS__) #define _rrange(i) (i).rbegin(), (i).rend() #define _rrange2(i, k) (i).rbegin(), (i).rbegin() + k #define _rrange3(i, a, b) (i).rbegin() + a, (i).rbegin() + b #define rrange(...) \ _overload3(__VA_ARGS__, _rrange3, _rrange2, _rrange)(__VA_ARGS__) #define elif else if #define unless(a) if (!(a)) #define mp make_pair #define mt make_tuple #define INT(...) \ int __VA_ARGS__; \ in(__VA_ARGS__) #define LL(...) \ ll __VA_ARGS__; \ in(__VA_ARGS__) #define ULL(...) \ ull __VA_ARGS__; \ in(__VA_ARGS__) #define STR(...) \ string __VA_ARGS__; \ in(__VA_ARGS__) #define CHR(...) \ char __VA_ARGS__; \ in(__VA_ARGS__) #define DBL(...) \ double __VA_ARGS__; \ in(__VA_ARGS__) #define vec(type, name, ...) vector<type> name(__VA_ARGS__) #define VEC(type, name, size) \ vector<type> name(size); \ in(name) #define vv(type, name, h, ...) \ vector<vector<type>> name(h, vector<type>(__VA_ARGS__)) #define VV(type, name, h, ...) \ vector<vector<type>> name(h, vector<type>(__VA_ARGS__)); \ in(name) #define vvv(type, name, h, w, ...) \ vector<vector<vector<type>>> name( \ h, vector<vector<type>>(w, vector<type>(__VA_ARGS__))) inline constexpr ll gcd(ll a, ll b) { if (!a || !b) return 0; while (b) { ll c = b; b = a % b; a = c; } return a; } inline constexpr ll lcm(ll a, ll b) { if (!a || !b) return 0; return a * b / gcd(a, b); } template <class T> inline constexpr T min(vector<T> &v) { return *min_element(range(v)); } inline char min(string &v) { return *min_element(range(v)); } template <class T> inline constexpr T max(vector<T> &v) { return *max_element(range(v)); } inline char max(string &v) { return *max_element(range(v)); } inline constexpr ll intpow(ll a, ll b) { ll ans = 1; for (ll i = 1; b; i *= 2) { if (b & i) { b ^= i; ans *= a; } a *= a; } return ans; } template <typename T> inline constexpr bool chmin(T &mn, const T &cnt) { if (mn > cnt) { mn = cnt; return 1; } else return 0; } template <typename T> inline constexpr bool chmax(T &mx, const T &cnt) { if (mx < cnt) { mx = cnt; return 1; } else return 0; } template <class T> unordered_map<T, ll> press(vector<T> &a) { auto b = a; sort(range(b)); b.erase(unique(range(b)), b.end()); unordered_map<T, ll> ans; rep(b.size()) ans[b[i]] = i; each(i, a) i = ans[i]; return ans; } template <class T> map<T, ll> press_map(vector<T> &a) { auto b = a; sort(range(b)); b.erase(unique(range(b)), b.end()); map<T, ll> ans; rep(b.size()) ans[b[i]] = i; each(i, a) i = ans[i]; return ans; } inline int scan() { return getchar(); } inline void scan(int &a) { scanf("%d", &a); } inline void scan(unsigned &a) { scanf("%u", &a); } inline void scan(long &a) { scanf("%ld", &a); } inline void scan(long long &a) { scanf("%lld", &a); } inline void scan(unsigned long long &a) { scanf("%llu", &a); } inline void scan(char &a) { cin >> a; } inline void scan(float &a) { scanf("%f", &a); } inline void scan(double &a) { scanf("%lf", &a); } inline void scan(long double &a) { scanf("%Lf", &a); } inline void scan(vector<bool> &vec) { for (unsigned i = 0; i < vec.size(); i++) { int a; scan(a); vec[i] = a; } } inline void scan(string &a) { cin >> a; } template <class T> inline void scan(vector<T> &vec); template <class T, size_t size> inline void scan(array<T, size> &vec); template <class T, class L> inline void scan(pair<T, L> &p); template <class T, size_t size> inline void scan(T (&vec)[size]); template <class T> inline void scan(vector<T> &vec) { for (auto &i : vec) scan(i); } template <class T, size_t size> inline void scan(array<T, size> &vec) { for (auto &i : vec) scan(i); } template <class T, class L> inline void scan(pair<T, L> &p) { scan(p.first); scan(p.second); } template <class T, size_t size> inline void scan(T (&vec)[size]) { for (auto &i : vec) scan(i); } template <class T> inline void scan(T &a) { cin >> a; } inline void in() {} template <class Head, class... Tail> inline void in(Head &head, Tail &...tail) { scan(head); in(tail...); } inline void print() { putchar(' '); } inline void print(const bool &a) { printf("%d", a); } inline void print(const int &a) { printf("%d", a); } inline void print(const unsigned &a) { printf("%u", a); } inline void print(const long &a) { printf("%ld", a); } inline void print(const long long &a) { printf("%lld", a); } inline void print(const unsigned long long &a) { printf("%llu", a); } inline void print(const char &a) { printf("%c", a); } inline void print(const char a[]) { printf("%s", a); } inline void print(const float &a) { printf("%.15f", a); } inline void print(const double &a) { printf("%.15f", a); } inline void print(const long double &a) { printf("%.15Lf", a); } template <class T> void print(const vector<T> &vec); template <class T, size_t size> void print(const array<T, size> &vec); template <class T, class L> void print(const pair<T, L> &p); template <class T, size_t size> inline void print(const T (&vec)[size]); template <class T> void print(const vector<T> &vec) { if (vec.empty()) return; print(vec[0]); for (auto i = vec.begin(); ++i != vec.end();) { putchar(' '); print(*i); } } template <class T, size_t size> void print(const array<T, size> &vec) { print(vec[0]); for (auto i = vec.begin(); ++i != vec.end();) { putchar(' '); print(*i); } } template <class T, class L> void print(const pair<T, L> &p) { print(p.first); putchar(' '); print(p.second); } template <class T, size_t size> inline void print(const T (&vec)[size]) { print(vec[0]); for (auto i = vec; ++i != end(vec);) { putchar(' '); print(*i); } } template <class T> inline void print(const T &a) { cout << a; } inline int out() { putchar('\n'); return 0; } template <class T> inline int out(const T &t) { print(t); putchar('\n'); return 0; } template <class Head, class... Tail> inline int out(const Head &head, const Tail &...tail) { print(head); putchar(' '); out(tail...); return 0; } template <class T> inline void err(T t) { cerr << t << '\n'; } inline void err() { cerr << '\n'; } inline int first(const bool &i) { return out(i ? "first" : "second"); } inline int yes(const bool &i) { return out(i ? "yes" : "no"); } inline int Yes(const bool &i) { return out(i ? "Yes" : "No"); } inline int YES(const bool &i) { return out(i ? "YES" : "NO"); } inline int Yay(const bool &i) { return out(i ? "Yay!" : ":("); } inline int Possible(const bool &i) { return out(i ? "Possible" : "Impossible"); } inline int POSSIBLE(const bool &i) { return out(i ? "POSSIBLE" : "IMPOSSIBLE"); } inline void Case(ll i) { printf("Case #%lld: ", i); } signed main() { LL(n); VEC(pll, a, n); vector<pair<ld, pll>> r; each(i, a) { ld at = atan2(ld(i.first), ld(i.second)); r.push_back({at, i}); r.push_back({at + 3.14159265358979 * 2, i}); } sort(range(r)); ld ans = 0; rep(n) { ll x = 0, y = 0; rep(j, i, n * 2) { x += r[j].second.first; y += r[j].second.second; chmax(ans, sqrt(ld(x * x + y + y))); } } out(ans); }
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; using uint = unsigned int; using pcc = pair<char, char>; using pii = pair<int, int>; using pll = pair<ll, ll>; using pdd = pair<double, double>; using tuplis = pair<ll, pll>; using tuplis2 = pair<pll, ll>; template <class T> using pq = priority_queue<T, vector<T>, greater<T>>; const ll LINF = 0x1fffffffffffffff; const ll MINF = 0x7fffffffffff; const int INF = 0x3fffffff; const ll MOD = 1000000007; const ll MODD = 998244353; const ld DINF = numeric_limits<ld>::infinity(); const ld EPS = 1e-9; const vector<ll> four{0, 1, 0, -1, 0}; #define _overload4(_1, _2, _3, _4, name, ...) name #define _overload3(_1, _2, _3, name, ...) name #define _rep1(n) for (ll i = 0; i < n; ++i) #define _rep2(i, n) for (ll i = 0; i < n; ++i) #define _rep3(i, a, b) for (ll i = a; i < b; ++i) #define _rep4(i, a, b, c) for (ll i = a; i < b; i += c) #define rep(...) \ _overload4(__VA_ARGS__, _rep4, _rep3, _rep2, _rep1)(__VA_ARGS__) #define _rrep1(n) for (ll i = (n)-1; i >= 0; i--) #define _rrep2(i, n) for (ll i = (n)-1; i >= 0; i--) #define _rrep3(i, a, b) for (ll i = (b)-1; i >= a; i--) #define _rrep4(i, a, b, c) for (ll i = a + (b - a - 1) / c * c; i >= a; i -= c) #define rrep(...) \ _overload4(__VA_ARGS__, _rrep4, _rrep3, _rrep2, _rrep1)(__VA_ARGS__) #define each(i, a) for (auto &i : a) #define sum(...) accumulate(range(__VA_ARGS__), 0LL) #define dsum(...) accumulate(range(__VA_ARGS__), double(0)) #define _range(i) (i).begin(), (i).end() #define _range2(i, k) (i).begin(), (i).begin() + k #define _range3(i, a, b) (i).begin() + a, (i).begin() + b #define range(...) \ _overload3(__VA_ARGS__, _range3, _range2, _range)(__VA_ARGS__) #define _rrange(i) (i).rbegin(), (i).rend() #define _rrange2(i, k) (i).rbegin(), (i).rbegin() + k #define _rrange3(i, a, b) (i).rbegin() + a, (i).rbegin() + b #define rrange(...) \ _overload3(__VA_ARGS__, _rrange3, _rrange2, _rrange)(__VA_ARGS__) #define elif else if #define unless(a) if (!(a)) #define mp make_pair #define mt make_tuple #define INT(...) \ int __VA_ARGS__; \ in(__VA_ARGS__) #define LL(...) \ ll __VA_ARGS__; \ in(__VA_ARGS__) #define ULL(...) \ ull __VA_ARGS__; \ in(__VA_ARGS__) #define STR(...) \ string __VA_ARGS__; \ in(__VA_ARGS__) #define CHR(...) \ char __VA_ARGS__; \ in(__VA_ARGS__) #define DBL(...) \ double __VA_ARGS__; \ in(__VA_ARGS__) #define vec(type, name, ...) vector<type> name(__VA_ARGS__) #define VEC(type, name, size) \ vector<type> name(size); \ in(name) #define vv(type, name, h, ...) \ vector<vector<type>> name(h, vector<type>(__VA_ARGS__)) #define VV(type, name, h, ...) \ vector<vector<type>> name(h, vector<type>(__VA_ARGS__)); \ in(name) #define vvv(type, name, h, w, ...) \ vector<vector<vector<type>>> name( \ h, vector<vector<type>>(w, vector<type>(__VA_ARGS__))) inline constexpr ll gcd(ll a, ll b) { if (!a || !b) return 0; while (b) { ll c = b; b = a % b; a = c; } return a; } inline constexpr ll lcm(ll a, ll b) { if (!a || !b) return 0; return a * b / gcd(a, b); } template <class T> inline constexpr T min(vector<T> &v) { return *min_element(range(v)); } inline char min(string &v) { return *min_element(range(v)); } template <class T> inline constexpr T max(vector<T> &v) { return *max_element(range(v)); } inline char max(string &v) { return *max_element(range(v)); } inline constexpr ll intpow(ll a, ll b) { ll ans = 1; for (ll i = 1; b; i *= 2) { if (b & i) { b ^= i; ans *= a; } a *= a; } return ans; } template <typename T> inline constexpr bool chmin(T &mn, const T &cnt) { if (mn > cnt) { mn = cnt; return 1; } else return 0; } template <typename T> inline constexpr bool chmax(T &mx, const T &cnt) { if (mx < cnt) { mx = cnt; return 1; } else return 0; } template <class T> unordered_map<T, ll> press(vector<T> &a) { auto b = a; sort(range(b)); b.erase(unique(range(b)), b.end()); unordered_map<T, ll> ans; rep(b.size()) ans[b[i]] = i; each(i, a) i = ans[i]; return ans; } template <class T> map<T, ll> press_map(vector<T> &a) { auto b = a; sort(range(b)); b.erase(unique(range(b)), b.end()); map<T, ll> ans; rep(b.size()) ans[b[i]] = i; each(i, a) i = ans[i]; return ans; } inline int scan() { return getchar(); } inline void scan(int &a) { scanf("%d", &a); } inline void scan(unsigned &a) { scanf("%u", &a); } inline void scan(long &a) { scanf("%ld", &a); } inline void scan(long long &a) { scanf("%lld", &a); } inline void scan(unsigned long long &a) { scanf("%llu", &a); } inline void scan(char &a) { cin >> a; } inline void scan(float &a) { scanf("%f", &a); } inline void scan(double &a) { scanf("%lf", &a); } inline void scan(long double &a) { scanf("%Lf", &a); } inline void scan(vector<bool> &vec) { for (unsigned i = 0; i < vec.size(); i++) { int a; scan(a); vec[i] = a; } } inline void scan(string &a) { cin >> a; } template <class T> inline void scan(vector<T> &vec); template <class T, size_t size> inline void scan(array<T, size> &vec); template <class T, class L> inline void scan(pair<T, L> &p); template <class T, size_t size> inline void scan(T (&vec)[size]); template <class T> inline void scan(vector<T> &vec) { for (auto &i : vec) scan(i); } template <class T, size_t size> inline void scan(array<T, size> &vec) { for (auto &i : vec) scan(i); } template <class T, class L> inline void scan(pair<T, L> &p) { scan(p.first); scan(p.second); } template <class T, size_t size> inline void scan(T (&vec)[size]) { for (auto &i : vec) scan(i); } template <class T> inline void scan(T &a) { cin >> a; } inline void in() {} template <class Head, class... Tail> inline void in(Head &head, Tail &...tail) { scan(head); in(tail...); } inline void print() { putchar(' '); } inline void print(const bool &a) { printf("%d", a); } inline void print(const int &a) { printf("%d", a); } inline void print(const unsigned &a) { printf("%u", a); } inline void print(const long &a) { printf("%ld", a); } inline void print(const long long &a) { printf("%lld", a); } inline void print(const unsigned long long &a) { printf("%llu", a); } inline void print(const char &a) { printf("%c", a); } inline void print(const char a[]) { printf("%s", a); } inline void print(const float &a) { printf("%.15f", a); } inline void print(const double &a) { printf("%.15f", a); } inline void print(const long double &a) { printf("%.15Lf", a); } template <class T> void print(const vector<T> &vec); template <class T, size_t size> void print(const array<T, size> &vec); template <class T, class L> void print(const pair<T, L> &p); template <class T, size_t size> inline void print(const T (&vec)[size]); template <class T> void print(const vector<T> &vec) { if (vec.empty()) return; print(vec[0]); for (auto i = vec.begin(); ++i != vec.end();) { putchar(' '); print(*i); } } template <class T, size_t size> void print(const array<T, size> &vec) { print(vec[0]); for (auto i = vec.begin(); ++i != vec.end();) { putchar(' '); print(*i); } } template <class T, class L> void print(const pair<T, L> &p) { print(p.first); putchar(' '); print(p.second); } template <class T, size_t size> inline void print(const T (&vec)[size]) { print(vec[0]); for (auto i = vec; ++i != end(vec);) { putchar(' '); print(*i); } } template <class T> inline void print(const T &a) { cout << a; } inline int out() { putchar('\n'); return 0; } template <class T> inline int out(const T &t) { print(t); putchar('\n'); return 0; } template <class Head, class... Tail> inline int out(const Head &head, const Tail &...tail) { print(head); putchar(' '); out(tail...); return 0; } template <class T> inline void err(T t) { cerr << t << '\n'; } inline void err() { cerr << '\n'; } inline int first(const bool &i) { return out(i ? "first" : "second"); } inline int yes(const bool &i) { return out(i ? "yes" : "no"); } inline int Yes(const bool &i) { return out(i ? "Yes" : "No"); } inline int YES(const bool &i) { return out(i ? "YES" : "NO"); } inline int Yay(const bool &i) { return out(i ? "Yay!" : ":("); } inline int Possible(const bool &i) { return out(i ? "Possible" : "Impossible"); } inline int POSSIBLE(const bool &i) { return out(i ? "POSSIBLE" : "IMPOSSIBLE"); } inline void Case(ll i) { printf("Case #%lld: ", i); } signed main() { LL(n); VEC(pll, a, n); vector<pair<ld, pll>> r; each(i, a) { ld at = atan2(ld(i.first), ld(i.second)); r.push_back({at, i}); r.push_back({at + 3.14159265358979 * 2, i}); } sort(range(r)); ld ans = 0; rep(n) { ll x = 0, y = 0; rep(j, i, i + n) { x += r[j].second.first; y += r[j].second.second; chmax(ans, sqrt(ld(x * x + y * y))); } } out(ans); }
[ "expression.operation.binary.remove", "expression.operator.arithmetic.change", "call.arguments.change", "expression.operation.binary.change" ]
730,405
730,404
u874644572
cpp
p02926
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define fast_io \ ios::sync_with_stdio(0); \ cin.tie(0) #define infl 1e18L + 9 #define inf 1e9L + 9 #define sz(a) ((int)a.size()) #define all(a) a.begin(), a.end() const int mod = 1e9L + 7; struct S { ld x, y; }; long double dist(S a) { return sqrt(a.x * a.x + a.y * a.y); } void solve() { int n; cin >> n; vector<S> e; for (int i = 0; i < n; i++) { ld x, y; cin >> x >> y; e.push_back({x, y}); } sort(all(e), [](S a, S b) { return atan2(a.y, a.x) < atan2(b.y, b.x); }); for (int i = 0; i < n; i++) { e.push_back(e[i]); } long double ans = 0; for (int i = 0; i < n; i++) { ld x = 0, y = 0; for (int j = 0; j < n; j++) { x += e[j].x, y += e[j].y; ans = max(ans, dist({x, y})); } } cout << fixed << setprecision(20); cout << ans << endl; } int main() { fast_io; clock_t beg = clock(); solve(); clock_t end = clock(); fprintf(stderr, "%.2lf sec\n", (double)(end - beg) / CLOCKS_PER_SEC); return 0; }
#include <bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define fast_io \ ios::sync_with_stdio(0); \ cin.tie(0) #define infl 1e18L + 9 #define inf 1e9L + 9 #define sz(a) ((int)a.size()) #define all(a) a.begin(), a.end() const int mod = 1e9L + 7; struct S { ld x, y; }; long double dist(S a) { return sqrt(a.x * a.x + a.y * a.y); } void solve() { int n; cin >> n; vector<S> e; for (int i = 0; i < n; i++) { ld x, y; cin >> x >> y; e.push_back({x, y}); } sort(all(e), [](S a, S b) { return atan2(a.y, a.x) < atan2(b.y, b.x); }); for (int i = 0; i < n; i++) { e.push_back(e[i]); } long double ans = 0; for (int i = 0; i < n; i++) { ld x = 0, y = 0; for (int j = 0; j < n; j++) { x += e[i + j].x, y += e[i + j].y; ans = max(ans, dist({x, y})); } } cout << fixed << setprecision(20); cout << ans << endl; } int main() { fast_io; clock_t beg = clock(); solve(); clock_t end = clock(); fprintf(stderr, "%.2lf sec\n", (double)(end - beg) / CLOCKS_PER_SEC); return 0; }
[ "assignment.change" ]
730,418
730,419
u586524249
cpp
p02926
#include <bits/stdc++.h> #define FI first #define SE second #define EPS 1e-9 #define ALL(a) a.begin(), a.end() #define SZ(a) int((a).size()) #define MS(s, n) memset(s, n, sizeof(s)) #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define FORE(i, a, b) for (int i = (a); i >= (b); i--) #define FORALL(it, a) \ for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++) #define WHATIS(x) cout << #x << " is " << x << endl; #define ERROR(args...) \ { \ string _s = #args; \ replace(_s.begin(), _s.end(), ',', ' '); \ stringstream _ss(_s); \ istream_iterator<string> _it(_ss); \ err(_it, args); \ } //__builtin_ffs(x) return 1 + index of least significant 1-bit of x //__builtin_clz(x) return number of leading zeros of x //__builtin_ctz(x) return number of trailing zeros of x using namespace std; using ll = long long; using ld = double; typedef pair<int, int> II; typedef pair<II, int> III; typedef complex<ld> cd; typedef vector<cd> vcd; void err(istream_iterator<string> it) {} template <typename T, typename... Args> void err(istream_iterator<string> it, T a, Args... args) { cout << *it << " = " << a << endl; err(++it, args...); } const ll MODBASE = 1000000007LL; const int MAXN = 110; const int MAXM = 200010; const int MAXK = 110; const int MAXQ = 200010; int n; struct Line { int x, y; Line(int x = 0, int y = 0) : x(x), y(y) {} }; bool operator<(Line a, Line b) { return atan2(a.y, a.x) < atan2(b.y, b.x); } Line a[MAXN]; int main() { ios::sync_with_stdio(0); cin.tie(nullptr); cin >> n; FOR(i, 0, n - 1) cin >> a[i].x >> a[i].y; sort(a, a + n); ld res = 0; FOR(i, 0, n - 1) { II now = II(0, 0); FOR(j, i, n + i - 1) { now.FI += a[j].x; now.SE += a[j].y; res = max(res, sqrt((ld)now.FI * now.FI + (ld)now.SE * now.SE)); } } cout << fixed << setprecision(15) << res; return 0; }
#include <bits/stdc++.h> #define FI first #define SE second #define EPS 1e-9 #define ALL(a) a.begin(), a.end() #define SZ(a) int((a).size()) #define MS(s, n) memset(s, n, sizeof(s)) #define FOR(i, a, b) for (int i = (a); i <= (b); i++) #define FORE(i, a, b) for (int i = (a); i >= (b); i--) #define FORALL(it, a) \ for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++) #define WHATIS(x) cout << #x << " is " << x << endl; #define ERROR(args...) \ { \ string _s = #args; \ replace(_s.begin(), _s.end(), ',', ' '); \ stringstream _ss(_s); \ istream_iterator<string> _it(_ss); \ err(_it, args); \ } //__builtin_ffs(x) return 1 + index of least significant 1-bit of x //__builtin_clz(x) return number of leading zeros of x //__builtin_ctz(x) return number of trailing zeros of x using namespace std; using ll = long long; using ld = double; typedef pair<int, int> II; typedef pair<II, int> III; typedef complex<ld> cd; typedef vector<cd> vcd; void err(istream_iterator<string> it) {} template <typename T, typename... Args> void err(istream_iterator<string> it, T a, Args... args) { cout << *it << " = " << a << endl; err(++it, args...); } const ll MODBASE = 1000000007LL; const int MAXN = 110; const int MAXM = 200010; const int MAXK = 110; const int MAXQ = 200010; int n; struct Line { int x, y; Line(int x = 0, int y = 0) : x(x), y(y) {} }; bool operator<(Line a, Line b) { return atan2(a.y, a.x) < atan2(b.y, b.x); } Line a[MAXN]; int main() { ios::sync_with_stdio(0); cin.tie(nullptr); cin >> n; FOR(i, 0, n - 1) cin >> a[i].x >> a[i].y; sort(a, a + n); ld res = 0; FOR(i, 0, n - 1) { II now = II(0, 0); FOR(j, i, n + i - 1) { now.FI += a[j % n].x; now.SE += a[j % n].y; res = max(res, sqrt((ld)now.FI * now.FI + (ld)now.SE * now.SE)); } } cout << fixed << setprecision(15) << res; return 0; }
[ "assignment.change" ]
730,426
730,427
u131020584
cpp
p02926
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <queue> #include <string> #include <vector> using ll = long long; using namespace std; using P = pair<double, double>; int main() { int n; cin >> n; P en[n]; for (auto &ei : en) cin >> ei.first >> ei.second; double best = 0; for (int i = 0; i < 1000; i++) { double theta = 2 * M_PI * i / 1000000; double x = cos(theta), y = sin(theta); P sum = {0, 0}; for (auto &ei : en) if (x * ei.first + y * ei.second > 0) { sum.first += ei.first; sum.second += ei.second; } best = max(best, hypot(sum.first, sum.second)); } cout << setprecision(15) << best << '\n'; return 0; }
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <queue> #include <string> #include <vector> using ll = long long; using namespace std; using P = pair<double, double>; int main() { int n; cin >> n; P en[n]; for (auto &ei : en) cin >> ei.first >> ei.second; double best = 0; for (int i = 0; i < 100; i++) { double theta = 2 * M_PI * i / 100; double x = cos(theta), y = sin(theta); P sum = {0, 0}; for (auto &ei : en) if (x * ei.first + y * ei.second > 0) { sum.first += ei.first; sum.second += ei.second; } best = max(best, hypot(sum.first, sum.second)); } cout << setprecision(15) << best << '\n'; return 0; }
[ "literal.number.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
730,428
730,429
u956758464
cpp
p02926
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <queue> #include <string> #include <vector> using ll = long long; using namespace std; using P = pair<double, double>; int main() { int n; cin >> n; P en[n]; for (auto &ei : en) cin >> ei.first >> ei.second; double best = 0; for (int i = 0; i < 100000; i++) { double theta = 2 * M_PI * i / 100000; double x = cos(theta), y = sin(theta), sum = 0; for (auto &ei : en) sum += max(0., x * ei.first + y * ei.second); best = max(best, sum); } cout << setprecision(15) << best << '\n'; return 0; }
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <queue> #include <string> #include <vector> using ll = long long; using namespace std; using P = pair<double, double>; int main() { int n; cin >> n; P en[n]; for (auto &ei : en) cin >> ei.first >> ei.second; double best = 0; for (int i = 0; i < 10000000; i++) { double theta = 2 * M_PI * i / 10000000; double x = cos(theta), y = sin(theta), sum = 0; for (auto &ei : en) sum += max(0., x * ei.first + y * ei.second); best = max(best, sum); } cout << setprecision(15) << best << '\n'; return 0; }
[ "literal.number.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
730,430
730,431
u956758464
cpp
p02926
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <queue> #include <string> #include <vector> using ll = long long; using namespace std; using P = pair<double, double>; int main() { int n; cin >> n; P en[n]; for (auto &ei : en) cin >> ei.first >> ei.second; double best = 0; for (int i = 0; i < 10000; i++) { double theta = 2 * M_PI * i / 10000; double x = cos(theta), y = sin(theta), sum = 0; for (auto &ei : en) sum += max(0., x * ei.first + y * ei.second); best = max(best, sum); } cout << setprecision(15) << best << '\n'; return 0; }
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <queue> #include <string> #include <vector> using ll = long long; using namespace std; using P = pair<double, double>; int main() { int n; cin >> n; P en[n]; for (auto &ei : en) cin >> ei.first >> ei.second; double best = 0; for (int i = 0; i < 10000000; i++) { double theta = 2 * M_PI * i / 10000000; double x = cos(theta), y = sin(theta), sum = 0; for (auto &ei : en) sum += max(0., x * ei.first + y * ei.second); best = max(best, sum); } cout << setprecision(15) << best << '\n'; return 0; }
[ "literal.number.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
730,432
730,431
u956758464
cpp
p02926
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <queue> #include <string> #include <vector> using ll = long long; using namespace std; using P = pair<double, double>; int main() { int n; cin >> n; P en[n]; for (auto &ei : en) cin >> ei.first >> ei.second; double best = 0; for (int i = 0; i < 100000; i++) { double theta = 2 * M_PI * i / 100000; double x = cos(theta), y = sin(theta), sum = 0; for (auto &ei : en) sum += max(0., x * ei.first + y * ei.second); best = max(best, sum); } cout << setprecision(15) << best << '\n'; return 0; }
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <queue> #include <string> #include <vector> using ll = long long; using namespace std; using P = pair<double, double>; int main() { int n; cin >> n; P en[n]; for (auto &ei : en) cin >> ei.first >> ei.second; double best = 0; for (int i = 0; i < 1000000; i++) { double theta = 2 * M_PI * i / 1000000; double x = cos(theta), y = sin(theta), sum = 0; for (auto &ei : en) sum += max(0., x * ei.first + y * ei.second); best = max(best, sum); } cout << setprecision(15) << best << '\n'; return 0; }
[ "literal.number.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
730,430
730,433
u956758464
cpp
p02926
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <queue> #include <string> #include <vector> using ll = long long; using namespace std; using P = pair<double, double>; int main() { int n; cin >> n; P en[n]; for (auto &ei : en) cin >> ei.first >> ei.second; double best = 0; for (int i = 0; i < 10000; i++) { double theta = 2 * M_PI * i / 10000; double x = cos(theta), y = sin(theta), sum = 0; for (auto &ei : en) sum += max(0., x * ei.first + y * ei.second); best = max(best, sum); } cout << setprecision(15) << best << '\n'; return 0; }
#include <algorithm> #include <cmath> #include <iomanip> #include <iostream> #include <queue> #include <string> #include <vector> using ll = long long; using namespace std; using P = pair<double, double>; int main() { int n; cin >> n; P en[n]; for (auto &ei : en) cin >> ei.first >> ei.second; double best = 0; for (int i = 0; i < 1000000; i++) { double theta = 2 * M_PI * i / 1000000; double x = cos(theta), y = sin(theta), sum = 0; for (auto &ei : en) sum += max(0., x * ei.first + y * ei.second); best = max(best, sum); } cout << setprecision(15) << best << '\n'; return 0; }
[ "literal.number.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
730,432
730,433
u956758464
cpp
p02926
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> P; typedef pair<ll, P> P3; typedef pair<P, P> PP; constexpr ll MOD = ll(1e9 + 7); constexpr int IINF = INT_MAX; constexpr ll LLINF = LLONG_MAX; constexpr int MAX_N = int(1e5) + 5; constexpr double EPS = 1e-9; constexpr int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0}; #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define SORT(v) sort((v).begin(), (v).end()) #define SORTR(v) sort((v).rbegin(), (v).rend()) #define ALL(v) (v).begin(), (v).end() ll n, x[105], y[105]; vector<pair<double, P>> ls, tmp; int main() { cin >> n; REP(i, n) { cin >> x[i] >> y[i]; ls.push_back({double(y[i]) / x[i], {x[i], y[i]}}); } double ans = 0.0; SORT(ls); for (int i = 0; i < n; i++) { ls.push_back(ls[i]); } for (int i = 0; i < n; i++) { for (int j = 1; j <= n; j++) { ll xs = 0, ys = 0; for (int k = 0; k < j; k++) { xs += ls[i + k].second.first; ys += ls[i + k].second.second; } ans = max(ans, pow(pow(xs, 2) + pow(ys, 2), 0.5)); } } printf("%.12lf\n", ans); return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int, int> P; typedef pair<ll, P> P3; typedef pair<P, P> PP; constexpr ll MOD = ll(1e9 + 7); constexpr int IINF = INT_MAX; constexpr ll LLINF = LLONG_MAX; constexpr int MAX_N = int(1e5) + 5; constexpr double EPS = 1e-9; constexpr int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0}; #define REP(i, n) for (int i = 0; i < n; i++) #define REPR(i, n) for (int i = n; i >= 0; i--) #define SORT(v) sort((v).begin(), (v).end()) #define SORTR(v) sort((v).rbegin(), (v).rend()) #define ALL(v) (v).begin(), (v).end() ll n, x[105], y[105]; vector<pair<double, P>> ls, tmp; int main() { cin >> n; REP(i, n) { cin >> x[i] >> y[i]; ls.push_back({atan2(y[i], x[i]), {x[i], y[i]}}); } double ans = 0.0; SORT(ls); for (int i = 0; i < n; i++) { ls.push_back(ls[i]); } for (int i = 0; i < n; i++) { for (int j = 1; j <= n; j++) { ll xs = 0, ys = 0; for (int k = 0; k < j; k++) { xs += ls[i + k].second.first; ys += ls[i + k].second.second; } ans = max(ans, pow(pow(xs, 2) + pow(ys, 2), 0.5)); } } printf("%.12lf\n", ans); return 0; }
[ "call.function.change", "call.arguments.change", "expression.operation.binary.change" ]
730,448
730,449
u271063202
cpp
p02927
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define rep(i, b, n) for (int(i) = (b); (i) < (n); (i)++) #define anin(ans) printf("%d\n", ans); int main(void) { int i, I, M, D, ans(0); scanf("%d %d", &M, &D); for (I = 2; I <= M; I++) { for (i = 2; i <= D / 10; i++) { if (I % i == 0 && I / i + i * 10 <= D && I / i > 1) { ans++; } } } printf("%d\n", ans); return 0; }
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define rep(i, b, n) for (int(i) = (b); (i) < (n); (i)++) #define anin(ans) printf("%d\n", ans); int main(void) { int i, I, M, D, ans(0); scanf("%d %d", &M, &D); for (I = 2; I <= M; I++) { for (i = 2; i <= D / 10; i++) { if (I % i == 0 && I / i + i * 10 <= D && I / i > 1 && I / i < 10) { ans++; } } } printf("%d\n", ans); return 0; }
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
730,452
730,453
u456658814
cpp
p02927
#include <bits/stdc++.h> using namespace std; int main() { int m, d; int result = 0; scanf("%d%d", &m, &d); for (int dd = 22; dd < d; dd++) { int d1 = dd % 10; int d10 = dd / 10; if (d1 * d10 >= 4) { for (int mm = 4; mm <= m; mm++) { if (d1 * d10 == mm) { // printf("%d %d%d\n",mm,d10,d1); result++; } } } } printf("%d\n", result); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int m, d; int result = 0; scanf("%d%d", &m, &d); for (int dd = 22; dd <= d; dd++) { int d1 = dd % 10; int d10 = dd / 10; if (d1 >= 2 && d10 >= 2) { for (int mm = 4; mm <= m; mm++) { if (d1 * d10 == mm) { // printf("%d %d%d\n",mm,d10,d1); result++; } } } } printf("%d\n", result); return 0; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change", "control_flow.branch.if.condition.change", "literal.number.change" ]
730,456
730,455
u283907492
cpp
p02927
#include <bits/stdc++.h> using namespace std; #define int long long #define float double #define INF 1ll << 60 int32_t main() { ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); int M, D, count = 0; cin >> M >> D; for (int i = 0; i < D; i++) { if (i >= 10 && (i % 10) >= 2 && (i / 10) >= 2) { if ((i % 10) * (i / 10) <= M) count++; } } cout << count << "\n"; }
#include <bits/stdc++.h> using namespace std; #define int long long #define float double #define INF 1ll << 60 int32_t main() { ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); int M, D, count = 0; cin >> M >> D; for (int i = 1; i <= D; i++) { if (i >= 10 && (i % 10) >= 2 && (i / 10) >= 2) { if ((i % 10) * (i / 10) <= M) { count++; } } } cout << count << "\n"; }
[ "literal.number.change", "variable_declaration.value.change", "control_flow.loop.for.initializer.change", "expression.off_by_one", "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
730,457
730,458
u128065625
cpp
p02927
#include <bits/stdc++.h> using namespace std; #define int long long #define float double #define INF 1ll << 60 int32_t main() { ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); int M, D, count = 0; cin >> M >> D; for (int j = 1; j <= M; j++) { for (int i = 1; i < D; i++) { if (i >= 10 && (i % 10) >= 2 && (i / 10) >= 2) { if ((i % 10) * (i / 10) == j) { count++; } } } } cout << count << "\n"; }
#include <bits/stdc++.h> using namespace std; #define int long long #define float double #define INF 1ll << 60 int32_t main() { ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); int M, D, count = 0; cin >> M >> D; for (int j = 1; j <= M; j++) { for (int i = 1; i <= D; i++) { if (i >= 10 && (i % 10) >= 2 && (i / 10) >= 2) { if ((i % 10) * (i / 10) == j) { count++; } } } } cout << count << "\n"; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
730,459
730,460
u128065625
cpp
p02927
#include <bits/stdc++.h> using namespace std; int main() { int M, D; cin >> M >> D; int loop, loop2; int ans = 0; for (loop = 4; loop <= M; loop++) { if (loop > 18 || D < 22) break; for (loop2 = 2; loop2 < 10; loop2++) { if (loop % loop2) { if (loop / loop2) { continue; } else { break; } } else if (loop / loop2 >= 2) { if (loop2 + (loop / loop2 * 10) <= D) { ans++; } } } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int M, D; cin >> M >> D; int loop, loop2; int ans = 0; for (loop = 4; loop <= M; loop++) { if (loop > 81 || D < 22) break; for (loop2 = 2; loop2 < 10; loop2++) { if (loop % loop2) { if (loop / loop2) { continue; } else { break; } } else if (loop / loop2 >= 2) { if (loop2 + (loop / loop2 * 10) <= D) { ans++; } } } } cout << ans << endl; return 0; }
[ "literal.number.change", "control_flow.branch.if.condition.change" ]
730,481
730,482
u541263126
cpp
p02927
#include <algorithm> #include <iomanip> #include <iostream> #include <vector> using namespace std; int main() { int M, D; cin >> M >> D; int cou = 0; for (int i = 22; i < D; i++) { int d10 = i / 10; int d1 = i - (d10 * 10); int sum = d10 * d1; if (sum <= M && d10 >= 2 && d1 >= 2) { cou++; } } cout << cou << endl; return 0; }
#include <algorithm> #include <iomanip> #include <iostream> #include <vector> using namespace std; int main() { int M, D; cin >> M >> D; int cou = 0; for (int i = 22; i < D + 1; i++) { int d10 = i / 10; int d1 = i - (d10 * 10); int sum = d10 * d1; if (sum <= M && d10 >= 2 && d1 >= 2) { cou++; } } cout << cou << endl; return 0; }
[ "control_flow.loop.for.condition.change", "misc.off_by_one" ]
730,487
730,488
u927933718
cpp
p02927
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <unordered_map> #include <vector> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define reps(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i) #define rrep(i, n) for (int i = ((int)((n)-1)); i >= 0; --i) #define rreps(i, n) for (int i = ((int)(n)); i > 0; --i) #define rept(n) \ for (int ___i___ = 0, i##_len = (n); ___i___ < i##_len; ++___i___) #define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++) #define ALL(x) (x).begin(), (x).end() #define SZ(x) ((int)(x).size()) #define ZERO(a) memset(a, 0, sizeof(a)) #define BIT(n) (1LL << (n)) #define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()); #define CEIL(x, y) (((x) + (y)-1) / (y)) // vector template <typename T> istream &operator>>(istream &is, vector<T> &vec) { for (T &x : vec) is >> x; return is; } // pair template <typename T, typename U> ostream &operator<<(ostream &os, pair<T, U> &pair_var) { os << "(" << pair_var.first << ", " << pair_var.second << ")"; return os; } // vector template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) { os << "{"; for (int i = 0; i < vec.size(); i++) { os << vec[i] << (i + 1 == vec.size() ? "" : ", "); } os << "}"; return os; } // map template <typename T, typename U> ostream &operator<<(ostream &os, map<T, U> &map_var) { os << "{"; repi(itr, map_var) { os << *itr; itr++; if (itr != map_var.end()) os << ", "; itr--; } os << "}"; return os; } // set template <typename T> ostream &operator<<(ostream &os, set<T> &set_var) { os << "{"; repi(itr, set_var) { os << *itr; itr++; if (itr != set_var.end()) os << ", "; itr--; } os << "}"; return os; } #define DUMPOUT cout void dump_func() { DUMPOUT << endl; } template <class Head, class... Tail> void dump_func(Head &&head, Tail &&...tail) { DUMPOUT << head; if (sizeof...(Tail) > 0) { DUMPOUT << ", "; } dump_func(std::move(tail)...); } #ifdef LOCAL_ #define dump(...) \ DUMPOUT << " " << string(#__VA_ARGS__) << ": " \ << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]" << endl \ << " ", \ dump_func(__VA_ARGS__) #else #define dump(...) #endif typedef long long int lli; typedef pair<int, int> ii; typedef priority_queue<int, vector<int>, greater<int>> heapq; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(20); }; } aaaaaaa; // #define int long long int // struct S{ // bool operator<(const S& x) const { // return ; // } // }; signed main() { int M, D; cin >> M >> D; int cnt = 0; rep(d, D) { int d1 = d % 10; int d2 = d / 10; if (d1 >= 2 && d2 >= 2) { int m = d1 * d2; if (m <= M) cnt++; } } cout << cnt << endl; return 0; }
#include <algorithm> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <unordered_map> #include <vector> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> using namespace std; #define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) #define reps(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i) #define rrep(i, n) for (int i = ((int)((n)-1)); i >= 0; --i) #define rreps(i, n) for (int i = ((int)(n)); i > 0; --i) #define rept(n) \ for (int ___i___ = 0, i##_len = (n); ___i___ < i##_len; ++___i___) #define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++) #define ALL(x) (x).begin(), (x).end() #define SZ(x) ((int)(x).size()) #define ZERO(a) memset(a, 0, sizeof(a)) #define BIT(n) (1LL << (n)) #define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()); #define CEIL(x, y) (((x) + (y)-1) / (y)) // vector template <typename T> istream &operator>>(istream &is, vector<T> &vec) { for (T &x : vec) is >> x; return is; } // pair template <typename T, typename U> ostream &operator<<(ostream &os, pair<T, U> &pair_var) { os << "(" << pair_var.first << ", " << pair_var.second << ")"; return os; } // vector template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) { os << "{"; for (int i = 0; i < vec.size(); i++) { os << vec[i] << (i + 1 == vec.size() ? "" : ", "); } os << "}"; return os; } // map template <typename T, typename U> ostream &operator<<(ostream &os, map<T, U> &map_var) { os << "{"; repi(itr, map_var) { os << *itr; itr++; if (itr != map_var.end()) os << ", "; itr--; } os << "}"; return os; } // set template <typename T> ostream &operator<<(ostream &os, set<T> &set_var) { os << "{"; repi(itr, set_var) { os << *itr; itr++; if (itr != set_var.end()) os << ", "; itr--; } os << "}"; return os; } #define DUMPOUT cout void dump_func() { DUMPOUT << endl; } template <class Head, class... Tail> void dump_func(Head &&head, Tail &&...tail) { DUMPOUT << head; if (sizeof...(Tail) > 0) { DUMPOUT << ", "; } dump_func(std::move(tail)...); } #ifdef LOCAL_ #define dump(...) \ DUMPOUT << " " << string(#__VA_ARGS__) << ": " \ << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]" << endl \ << " ", \ dump_func(__VA_ARGS__) #else #define dump(...) #endif typedef long long int lli; typedef pair<int, int> ii; typedef priority_queue<int, vector<int>, greater<int>> heapq; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(20); }; } aaaaaaa; // #define int long long int // struct S{ // bool operator<(const S& x) const { // return ; // } // }; signed main() { int M, D; cin >> M >> D; int cnt = 0; reps(d, D) { int d1 = d % 10; int d2 = d / 10; if (d1 >= 2 && d2 >= 2) { int m = d1 * d2; if (m <= M) cnt++; } } cout << cnt << endl; return 0; }
[ "identifier.change" ]
730,500
730,501
u576106056
cpp
p02927
#include <bits/stdc++.h> using namespace std; int main() { int m, d, a = 0; cin >> m >> d; if (d == 1 || m < 4) cout << 0 << endl; else { for (int i = 1; i <= m; i++) { for (int j = 2; j <= d; j++) { int k = j % 10, l = j / 10; if (k * l == m && k != 1 && l != 1) a++; } } cout << a << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int m, d, a = 0; cin >> m >> d; if (d == 1 || m < 4) cout << 0 << endl; else { for (int i = 1; i <= m; i++) { for (int j = 2; j <= d; j++) { int k = j % 10, l = j / 10; if (k * l == i && k != 1 && l != 1) a++; } } cout << a << endl; } }
[ "identifier.change", "control_flow.branch.if.condition.change" ]
730,502
730,503
u072080927
cpp
p02927
#include <bits/stdc++.h> using namespace std; int main() { int M, D, count = 0; cin >> M >> D; for (int i = 1; i < M + 1; i++) { for (int j = 1; j < D + 1; j++) { if (j / 10 >= 2 && j % 10 >= 2) { if ((j / 10) * (j % 10) == i) { count++; } } } } cout << count - 1 << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int M, D, count = 0; cin >> M >> D; for (int i = 1; i < M + 1; i++) { for (int j = 1; j < D + 1; j++) { if (j / 10 >= 2 && j % 10 >= 2) { if ((j / 10) * (j % 10) == i) { count++; } } } } cout << count << endl; }
[ "expression.operation.binary.remove" ]
730,514
730,515
u361557064
cpp
p02927
#include <bits/stdc++.h> using namespace std; int main() { int M, D, count = 0; cin >> M >> D; for (int i = 1; i < M + 1; i++) { for (int j = 1; j < D + 1; j++) { if (j >= 22 && j % 10 >= 2) { if ((j / 10) * (j % 10) == i) { count++; } } } } cout << count - 1 << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int M, D, count = 0; cin >> M >> D; for (int i = 1; i < M + 1; i++) { for (int j = 1; j < D + 1; j++) { if (j / 10 >= 2 && j % 10 >= 2) { if ((j / 10) * (j % 10) == i) { count++; } } } } cout << count << endl; }
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change", "literal.number.change", "expression.operation.binary.remove" ]
730,516
730,515
u361557064
cpp
p02927
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int m, d; cin >> m >> d; vector<int> a; for (int i = 22; i <= d; i++) { int j_10 = i / 10; int j = i % 10; if (j * j_10 <= 100) a.push_back(j_10 * j); } int count = 0; for (int i = 0; i < a.size(); i++) { if (a[i] >= 4 && a[i] <= m) count++; } cout << count << endl; }
#include <algorithm> #include <cmath> #include <iostream> #include <string> #include <vector> using namespace std; int main() { int m, d; cin >> m >> d; vector<int> a; for (int i = 22; i <= d; i++) { int j_10 = i / 10; int j = i % 10; if (j > 1 && j_10 > 1) a.push_back(j_10 * j); } int count = 0; for (int i = 0; i < a.size(); i++) { if (a[i] >= 4 && a[i] <= m) count++; } cout << count << endl; }
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
730,517
730,518
u115819033
cpp
p02927
#include <algorithm> #include <iostream> using namespace std; int main() { int M, D; cin >> M >> D; int max_d10 = D / 10; int max_d1 = D % 10; if (D < 22 || M < 4) cout << 0 << endl; else { int c = 0; for (int i = 2; i < max_d10; i++) { c += min(8, min(M / i - 1, 0)); } for (int i = 2; i <= max_d1; i++) { if (M >= max_d10 * i) c++; } cout << c << endl; } return 0; }
#include <algorithm> #include <iostream> using namespace std; int main() { int M, D; cin >> M >> D; int max_d10 = D / 10; int max_d1 = D % 10; if (D < 22 || M < 4) cout << 0 << endl; else { int c = 0; for (int i = 2; i < max_d10; i++) { c += min(8, max(M / i - 1, 0)); } for (int i = 2; i <= max_d1; i++) { if (M >= max_d10 * i) c++; } cout << c << endl; } return 0; }
[ "misc.opposites", "assignment.value.change", "identifier.change", "call.function.change", "call.arguments.change" ]
730,519
730,520
u552137999
cpp
p02927
#include <iostream> #include <vector> using namespace std; int main() { int M, D; cin >> M >> D; int count = 0; for (int i = 1; i <= M; i++) { for (int j = 0; j <= D / 10; j++) { for (int k = 0; k <= 10; k++) { if (10 * j + k > D) break; if (j * k == M) { count++; } } } } cout << count << endl; return 0; }
#include <iostream> #include <vector> using namespace std; int main() { int M, D; cin >> M >> D; int count = 0; for (int i = 1; i <= M; i++) { for (int j = 2; j <= D / 10; j++) { for (int k = 2; k <= 9; k++) { if (10 * j + k > D) break; if (j * k == i) { count++; } } } } cout << count << endl; return 0; }
[ "literal.number.change", "variable_declaration.value.change", "control_flow.loop.for.initializer.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change", "identifier.change", "control_flow.branch.if.condition.change" ]
730,521
730,522
u022890424
cpp
p02927
#include <bits/stdc++.h> using namespace std; int main() { int M, D, cnt = 0, i, j, k, l; cin >> M >> D; for (l = 1; l <= M; l++) for (k = 22; k <= D; k++) { i = k / 10; j = k % 10; if (i >= 2 && j >= 2) { if (i * j == M) cnt++; } } cout << cnt; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int M, D, cnt = 0, i, j, k, l; cin >> M >> D; for (l = 4; l <= M; l++) { for (k = 22; k <= D; k++) { i = k / 10; j = k % 10; if (i >= 2 && j >= 2) { if (i * j == l) cnt++; } } } cout << cnt; return 0; }
[ "literal.number.change", "assignment.value.change", "control_flow.loop.for.initializer.change", "identifier.change", "control_flow.branch.if.condition.change" ]
730,530
730,531
u228943017
cpp
p02927
#include <algorithm> #include <iostream> #include <string> #define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0])) using namespace std; #include <fstream> #include <iostream> using namespace std; int main() { int m, n; cin >> m >> n; int count = 0; int hairetu[n] = {0}; for (int i = 0; i < n; i++) { hairetu[i] = i; } for (int i = 0; i < n; i++) { if (hairetu[i] >= 22) { int iti = 0; int zyuu; iti = hairetu[i] % 10; zyuu = hairetu[i] / 10; if (iti >= 2 && zyuu >= 2) { for (int i = 1; i < m + 1; i++) { if (i == iti * zyuu) { count++; } } } } } cout << count << endl; return 0; }
#include <algorithm> #include <iostream> #include <string> #define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0])) using namespace std; #include <fstream> #include <iostream> using namespace std; int main() { int m, n; cin >> m >> n; int count = 0; int hairetu[n] = {0}; for (int i = 0; i < n; i++) { hairetu[i] = i + 1; } for (int i = 0; i < n; i++) { if (hairetu[i] >= 22) { int iti = 0; int zyuu; iti = hairetu[i] % 10; zyuu = hairetu[i] / 10; if (iti >= 2 && zyuu >= 2) { for (int i = 1; i < m + 1; i++) { if (i == iti * zyuu) { count++; } } } } } cout << count << endl; return 0; }
[ "assignment.change" ]
730,536
730,537
u259590403
cpp
p02927
#include <bits/stdc++.h> using namespace std; int main() { int M, D, ans = 0, dt, dd; cin >> M >> D; for (int m = 4; m <= M; m++) { for (int d = 22; d <= D; d++) { dt = d / 10; dd = d - dt * 10; if (dd < 3) continue; if (dt * dd == m) ans++; } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int M, D, ans = 0, dt, dd; cin >> M >> D; for (int m = 4; m <= M; m++) { for (int d = 22; d <= D; d++) { dt = d / 10; dd = d - dt * 10; if (dd < 2) continue; if (dt * dd == m) ans++; } } cout << ans << endl; }
[ "literal.number.change", "control_flow.branch.if.condition.change" ]
730,540
730,541
u158628538
cpp
p02927
#include <bits/stdc++.h> using namespace std; #define rep2(i, a, b) for (int i = (a); i < (b); i++) int main() { int m, d; cin >> m >> d; int count = 0; int D = 0; rep2(i, 1, d) { if ((i / 10) >= 2 && (i % 10) >= 2) { D = (i / 10) * (i % 10); } else { D = -1; } if (1 <= D && D <= m) { count++; } } cout << count << endl; }
#include <bits/stdc++.h> using namespace std; #define rep2(i, a, b) for (int i = (a); i < (b); i++) int main() { int m, d; cin >> m >> d; int count = 0; int D = 0; rep2(i, 1, d + 1) { if ((i / 10) >= 2 && (i % 10) >= 2) { D = (i / 10) * (i % 10); } else { D = -1; } if (1 <= D && D <= m) { count++; } } cout << count << endl; }
[ "expression.operation.binary.add" ]
730,544
730,545
u010806195
cpp
p02927
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <string> using namespace std; int main() { int M, D, d1, d10, S = 0; string day; cin >> M; cin >> D; for (int i = 4; i <= M; i++) { for (int j = 22; j <= D; j++) { d1 = j / 10; d10 = j - d1 * 10; if (i == d1 * d10) { S++; } } } cout << S << endl; return 0; }
#include <algorithm> #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <string> using namespace std; int main() { int M, D, d1, d10, S = 0; string day; cin >> M; cin >> D; for (int i = 4; i <= M; i++) { for (int j = 22; j <= D; j++) { d1 = j / 10; d10 = j - d1 * 10; if (i == d1 * d10 && d10 != 1) { S++; } } } cout << S << endl; return 0; }
[ "control_flow.branch.if.condition.change", "control_flow.loop.for.condition.change" ]
730,546
730,547
u480117549
cpp
p02927
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> #define MOD 1000000007 using namespace std; typedef pair<int, int> P; typedef pair<long long, long long> LLP; int main() { int M, D; cin >> M >> D; int count = 0; for (int i = 1; i <= M; i++) { for (int j = 2; j * 10 + 2 <= D; j++) { for (int k = 2; j * 10 + k <= D; k++) { if (j * k == i) count++; } } } cout << count << endl; return 0; }
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> #define MOD 1000000007 using namespace std; typedef pair<int, int> P; typedef pair<long long, long long> LLP; int main() { int M, D; cin >> M >> D; int count = 0; for (int i = 1; i <= M; i++) { for (int j = 2; j * 10 + 2 <= D; j++) { for (int k = 2; k <= 9 && j * 10 + k <= D; k++) { if (j * k == i) count++; } } } cout << count << endl; return 0; }
[ "control_flow.loop.for.condition.change" ]
730,560
730,561
u997325490
cpp
p02927
#include <bits/stdc++.h> #define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) using namespace std; typedef long long ll; const ll mod = 1e9 + 7; #define all(x) (x).begin(), (x).end() template <class T> inline void chmin(T &a, T b) { if (a > b) { a = b; } } template <class T> inline void chmax(T &a, T b) { if (a < b) { a = b; } } int main() { cin.tie(0); ios::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(10); int M, D; cin >> M >> D; if (D < 21) { cout << 0 << "\n"; } else { vector<int> A(0); REP(i, D / 10 - 2) { REP(l, 8) A.push_back((i + 2) * (l + 2)); } if (D % 10 - 1 < 1) REP(l, D % 10 - 1) A.push_back((D / 10) * (l + 2)); sort(all(A)); int count = 0; REP(i, A.size()) { if (A[i] <= M) { count++; } } cout << count << "\n"; } }
#include <bits/stdc++.h> #define REP(i, n) for (int(i) = 0; (i) < (n); (i)++) using namespace std; typedef long long ll; const ll mod = 1e9 + 7; #define all(x) (x).begin(), (x).end() template <class T> inline void chmin(T &a, T b) { if (a > b) { a = b; } } template <class T> inline void chmax(T &a, T b) { if (a < b) { a = b; } } int main() { cin.tie(0); ios::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(10); int M, D; cin >> M >> D; if (D < 21) { cout << 0 << "\n"; } else { vector<int> A(0); REP(i, D / 10 - 2) { REP(l, 8) A.push_back((i + 2) * (l + 2)); } if (D % 10 - 1 > 0) REP(l, D % 10 - 1) A.push_back((D / 10) * (l + 2)); sort(all(A)); int count = 0; REP(i, A.size()) { if (A[i] <= M) { count++; } } cout << count << "\n"; } }
[]
730,562
730,563
u017078415
cpp
p02927
#include <bits/stdc++.h> #define fi first #define se second #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i <= (n); ++i) #define drep(i, n) for (int i = (n)-1; i >= 0; --i) #define srep(i, s, t) for (int i = s; i < t; ++i) #define rng(a) a.begin(), a.end() #define rrng(a) a.rbegin(), a.rend() #define maxs(x, y) (x = max(x, y)) #define mins(x, y) (x = min(x, y)) #define limit(x, l, r) max(l, min(x, r)) #define lims(x, l, r) (x = max(l, min(x, r))) #define isin(x, l, r) ((l) <= (x) && (x) < (r)) #define pb push_back #define eb emplace_back #define sz(x) (int)(x).size() #define pcnt __builtin_popcountll #define uni(x) x.erase(unique(rng(x)), x.end()) #define snuke srand((unsigned)clock() + (unsigned)time(NULL)); #define show(x) cout << #x << " = " << x << endl; #define PQ(T) priority_queue<T, v(T), greater<T>> #define bn(x) ((1 << x) - 1) #define dup(x, y) (((x) + (y)-1) / (y)) #define newline puts("") #define v(T) vector<T> #define vv(T) v(v(T)) using namespace std; typedef long long int ll; typedef unsigned uint; typedef unsigned long long ull; typedef pair<int, int> P; typedef tuple<int, int, int> T; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<ll> vl; typedef vector<P> vp; typedef vector<T> vt; int main() { int M, D; int count = 0; cin >> M >> D; int m; for (int i = 22; i < D; i++) { int num1 = i / 10; int num2 = i % 10; if (num1 == 1 || num2 == 1) continue; m = num1 * num2; if (m <= M && m > 0) { count++; } } cout << count << endl; }
#include <bits/stdc++.h> #define fi first #define se second #define rep(i, n) for (int i = 0; i < (n); ++i) #define rrep(i, n) for (int i = 1; i <= (n); ++i) #define drep(i, n) for (int i = (n)-1; i >= 0; --i) #define srep(i, s, t) for (int i = s; i < t; ++i) #define rng(a) a.begin(), a.end() #define rrng(a) a.rbegin(), a.rend() #define maxs(x, y) (x = max(x, y)) #define mins(x, y) (x = min(x, y)) #define limit(x, l, r) max(l, min(x, r)) #define lims(x, l, r) (x = max(l, min(x, r))) #define isin(x, l, r) ((l) <= (x) && (x) < (r)) #define pb push_back #define eb emplace_back #define sz(x) (int)(x).size() #define pcnt __builtin_popcountll #define uni(x) x.erase(unique(rng(x)), x.end()) #define snuke srand((unsigned)clock() + (unsigned)time(NULL)); #define show(x) cout << #x << " = " << x << endl; #define PQ(T) priority_queue<T, v(T), greater<T>> #define bn(x) ((1 << x) - 1) #define dup(x, y) (((x) + (y)-1) / (y)) #define newline puts("") #define v(T) vector<T> #define vv(T) v(v(T)) using namespace std; typedef long long int ll; typedef unsigned uint; typedef unsigned long long ull; typedef pair<int, int> P; typedef tuple<int, int, int> T; typedef vector<int> vi; typedef vector<vi> vvi; typedef vector<ll> vl; typedef vector<P> vp; typedef vector<T> vt; int main() { int M, D; int count = 0; cin >> M >> D; int m; for (int i = 22; i < D + 1; i++) { int num1 = i / 10; int num2 = i % 10; if (num1 == 1 || num2 == 1) continue; m = num1 * num2; if (m <= M && m > 0) { count++; } } cout << count << endl; }
[ "control_flow.loop.for.condition.change", "misc.off_by_one" ]
730,564
730,565
u520791604
cpp
p02927
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <sstream> #include <string> #include <vector> using namespace std; int main() { int M, D; cin >> M >> D; int result = 0; for (int i = 0; i < D; i++) { int d1 = i % 10; int d2 = i / 10; if (d1 >= 2 && d2 >= 2 && (d1 * d2) <= M) { ++result; } } cout << result << endl; return 0; }
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <queue> #include <sstream> #include <string> #include <vector> using namespace std; int main() { int M, D; cin >> M >> D; int result = 0; for (int i = 0; i <= D; i++) { int d1 = i % 10; int d2 = i / 10; if (d1 >= 2 && d2 >= 2 && (d1 * d2) <= M) { ++result; } } cout << result << endl; return 0; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
730,566
730,567
u376998218
cpp
p02927
#include <algorithm> #include <deque> #include <iostream> #include <sstream> #include <string> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> #define endl "\n" using namespace std; template <typename T> void printArray(T a) { for (auto i : a) cout << i << " "; cout << endl; } template <typename T> void print2DArray(T a) { for (auto i : a) { for (auto j : i) cout << j << " "; cout << endl; } cout << endl; } int main(int argc, char *argv[]) { std::ios::sync_with_stdio(false); cin.tie(NULL); int m = 1; int d = 1; cin >> m >> d; if (d < 22) { cout << 0 << endl; return 0; } unsigned long long acc = 0; for (int i = 22; i < d; i++) { int d_1 = i % 10; int d_10 = (i / 10) % 10; if (d_1 < 2 || d_10 < 2) { continue; } if (d_1 * d_10 <= m) { /* cout << d_1 * d_10 << "-" << i << endl; */ acc++; } } cout << acc << endl; return 0; }
#include <algorithm> #include <deque> #include <iostream> #include <sstream> #include <string> #include <unordered_map> #include <unordered_set> #include <utility> #include <vector> #define endl "\n" using namespace std; template <typename T> void printArray(T a) { for (auto i : a) cout << i << " "; cout << endl; } template <typename T> void print2DArray(T a) { for (auto i : a) { for (auto j : i) cout << j << " "; cout << endl; } cout << endl; } int main(int argc, char *argv[]) { std::ios::sync_with_stdio(false); cin.tie(NULL); int m = 1; int d = 1; cin >> m >> d; if (d < 22) { cout << 0 << endl; return 0; } unsigned long long acc = 0; for (int i = 22; i <= d; i++) { int d_1 = i % 10; int d_10 = (i / 10) % 10; if (d_1 < 2 || d_10 < 2) { continue; } if (d_1 * d_10 <= m) { /* cout << d_1 * d_10 << "-" << i << endl; */ acc++; } } cout << acc << endl; return 0; }
[ "expression.operator.compare.change", "control_flow.loop.for.condition.change", "expression.off_by_one", "expression.operation.binary.change" ]
730,575
730,576
u282549895
cpp
p02927
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define vi vector<int> #define ll long long #define vl vector<ll> #define vll vector<vl> const int INF = 1e9; int main() { int m, d; cin >> m >> d; int ans = 0; rep(i, m) rep(j, d) { int a = i + 1; int b = j + 1; if (a == (j % 10) * (j / 10) && (j % 10) > 1 && (j / 10) > 1) ans++; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define vi vector<int> #define ll long long #define vl vector<ll> #define vll vector<vl> const int INF = 1e9; int main() { int m, d; cin >> m >> d; int ans = 0; rep(i, m) rep(j, d) { int a = i + 1; int b = j + 1; if (a == (b % 10) * (b / 10) && (b % 10) > 1 && (b / 10) > 1) ans++; } cout << ans << endl; return 0; }
[ "identifier.change", "control_flow.branch.if.condition.change" ]
730,580
730,581
u517935400
cpp
p02927
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define FOR(i, a, b) for (int i = a; i < (int)b; ++i) typedef long long ll; const int Inf = 1e9; const double EPS = 1e-9; int gcd(int a, int b) { if (b == 0) { return a; } else { return gcd(b, a % b); } } int lcm(int a, int b) { return a * b / gcd(a, b); } int bitCount(long bits) { bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555); bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333); bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f); bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff); return (bits & 0x0000ffff) + (bits >> 16 & 0x0000ffff); } int main() { cin.tie(0); ios::sync_with_stdio(false); int m, d; cin >> m >> d; int ans = 0; FOR(i, 1, m) { FOR(j, 22, d + 1) { if (j % 10 < 1) continue; int tmp = j; int d1 = tmp % 10; int d10 = tmp / 10; if (d1 * d10 == i) { ans++; } } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; ++i) #define FOR(i, a, b) for (int i = a; i < (int)b; ++i) typedef long long ll; const int Inf = 1e9; const double EPS = 1e-9; int gcd(int a, int b) { if (b == 0) { return a; } else { return gcd(b, a % b); } } int lcm(int a, int b) { return a * b / gcd(a, b); } int bitCount(long bits) { bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555); bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333); bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f); bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff); return (bits & 0x0000ffff) + (bits >> 16 & 0x0000ffff); } int main() { cin.tie(0); ios::sync_with_stdio(false); int m, d; cin >> m >> d; int ans = 0; FOR(i, 1, m + 1) { FOR(j, 22, d + 1) { if (j % 10 <= 1) continue; int tmp = j; int d1 = tmp % 10; int d10 = tmp / 10; if (d1 * d10 == i) { ans++; } } } cout << ans << endl; return 0; }
[ "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
730,592
730,593
u940569542
cpp
p02927
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, m, n) for (int i = m; i < n; i++) int main() { // ここに処理を記述 int M, D; cin >> M >> D; int ans = 0; FOR(i, 1, M + 1) { FOR(j, 1, D) { int d1 = j % 10; int d2 = j / 10; if (d1 < 2 || d2 < 2) continue; if (i == d1 * d2) ans++; } } cout << ans << "\n"; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define REP(i, n) for (int i = 0; i < (int)(n); i++) #define FOR(i, m, n) for (int i = m; i < n; i++) int main() { // ここに処理を記述 int M, D; cin >> M >> D; int ans = 0; FOR(i, 1, M + 1) { FOR(j, 1, D + 1) { int d1 = j % 10; int d2 = j / 10; if (d1 < 2 || d2 < 2) continue; if (i == d1 * d2) ans++; } } cout << ans << "\n"; return 0; }
[ "expression.operation.binary.add" ]
730,594
730,595
u633451629
cpp
p02927
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define pii pair<int, int> #define fi first #define sc second #define ALL(x) x.begin(), x.end() #define RALL(X) x.begin(), x.end() #define FOR(i, n, k) for (i = 0; i < n; i += k) #define FO(i, n, k) for (i = 1; i <= n; i += k) #define CLEAR(a, b) memset(a, b, sizeof(a)) #define N 100005 #define mid ((l + r) / 2) #define dbg(x) (cerr << #x << " : " << x << endl) #define endl "\n" #define MOD 100000009 using namespace std; typedef long long int lli; /*bool ok(int x){ vector <int> digits; while(x > 1){ int digit = x%10; x -= digit; x /= 10; digits.pb(digit); } if(digits.size() != 2) return false; }*/ int main() { ios_base::sync_with_stdio(false); int m, d; cin >> m >> d; int res = 0; for (int j = 1; j <= m; j++) { for (int i = 2; i <= j; i++) { if (j % i == 0) { if (i / 10 > 1 or (j / i) / 10 > 1) continue; if (i * 10 + (j / i) > d) continue; if (i >= 2 and j / i >= 2) res++; } } } cout << res; return 0; }
#include <bits/stdc++.h> #define pb push_back #define mp make_pair #define pii pair<int, int> #define fi first #define sc second #define ALL(x) x.begin(), x.end() #define RALL(X) x.begin(), x.end() #define FOR(i, n, k) for (i = 0; i < n; i += k) #define FO(i, n, k) for (i = 1; i <= n; i += k) #define CLEAR(a, b) memset(a, b, sizeof(a)) #define N 100005 #define mid ((l + r) / 2) #define dbg(x) (cerr << #x << " : " << x << endl) #define endl "\n" #define MOD 100000009 using namespace std; typedef long long int lli; /*bool ok(int x){ vector <int> digits; while(x > 1){ int digit = x%10; x -= digit; x /= 10; digits.pb(digit); } if(digits.size() != 2) return false; }*/ int main() { ios_base::sync_with_stdio(false); int m, d; cin >> m >> d; int res = 0; for (int j = 1; j <= m; j++) { for (int i = 1; i <= j; i++) { if (j % i == 0) { if (i / 10 >= 1 or (j / i) / 10 >= 1) continue; if (i * 10 + (j / i) > d) continue; if (i >= 2 and j / i >= 2) res++; } } } cout << res; return 0; }
[ "literal.number.change", "variable_declaration.value.change", "control_flow.loop.for.initializer.change", "expression.off_by_one", "expression.operator.compare.change", "control_flow.branch.if.condition.change" ]
730,600
730,601
u724515098
cpp
p02927
#include <bits/stdc++.h> using namespace std; int main() { long long m, d, ans = 0; cin >> m >> d; for (int i = 2; i <= d; i++) { for (int j = 2; j <= d; j++) { long long z = i * j; if (i * 10 + j <= d && z <= m) { ans++; } } } cout << ans; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long m, d, ans = 0; cin >> m >> d; for (int i = 2; i <= 9; i++) { for (int j = 2; j <= 9; j++) { long long z = i * j; if (i * 10 + j <= d && z <= m) { ans++; } } } cout << ans; return 0; }
[ "identifier.replace.remove", "literal.replace.add", "control_flow.loop.for.condition.change", "expression.operation.binary.change" ]
730,602
730,603
u206580411
cpp
p02927
#include <bits/stdc++.h> using namespace std; #define INF 2147483647 #define INFF 9223372036854775807 #define ll long long #define REP(i, n) for (long long i = 0; i < n; i++) #define REPP(i, m, n) for (long long i = m; i < n; i++) #define ALL(N) (N.begin(), N.end()) #define de cout << "line : " << __LINE__ << " debug" << endl; #define pb push_back #define pq priority_queue #define Dcout(N) cout << setprecision(20) << N << endl; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } int main() { cin.tie(0); ios::sync_with_stdio(false); int M, D; cin >> M >> D; int ans = 0; REPP(i, 1, M + 1) { REPP(j, 22, D) { if ((j / 10) * (j % 10) == i && j / 10 >= 2 && j % 10 >= 2) { ans++; // cout << i << ' ' << j/10 << ' ' << j%10 << endl; } } } cout << ans << endl; }
#include <bits/stdc++.h> using namespace std; #define INF 2147483647 #define INFF 9223372036854775807 #define ll long long #define REP(i, n) for (long long i = 0; i < n; i++) #define REPP(i, m, n) for (long long i = m; i < n; i++) #define ALL(N) (N.begin(), N.end()) #define de cout << "line : " << __LINE__ << " debug" << endl; #define pb push_back #define pq priority_queue #define Dcout(N) cout << setprecision(20) << N << endl; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } int main() { cin.tie(0); ios::sync_with_stdio(false); int M, D; cin >> M >> D; int ans = 0; REPP(i, 1, M + 1) { REPP(j, 22, D + 1) { if ((j / 10) * (j % 10) == i && (j / 10) >= 2 && (j % 10) >= 2) { ans++; // cout << i << ' ' << j/10 << ' ' << j%10 << endl; } } } cout << ans << endl; }
[ "control_flow.branch.if.condition.change" ]
730,604
730,605
u901397311
cpp