buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define debug(val) "[ " << #val " : " << (val) #define space " " #define vi vector<int> #define vl vector<ll> #define vll vector<vector<ll>> #define vii vector<vector<int>> #define PI (double)(atan(1) * 4) #define pb push_back #define pi pair<int,...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define debug(val) "[ " << #val " : " << (val) #define space " " #define vi vector<int> #define vl vector<ll> #define vll vector<vector<ll>> #define vii vector<vector<int>> #define PI (double)(atan(1) * 4) #define pb push_back #define pi pair<int,...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 47], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 18]]
1
378
import math def dist(x, y): math.sqrt(x ^ 2 + y ^ 2) (n, d) = map(int, input().split()) res = 0 for _ in range(n): (x, y) = map(int, input().split()) res += 1 if dist(x, y) <= d else 0 print(res)
import math def dist(x, y): return math.sqrt(x ** 2 + y ** 2) (n, d) = map(int, input().split()) res = 0 for _ in range(n): (x, y) = map(int, input().split()) res += 1 if dist(x, y) <= d else 0 print(res)
[["+", 0, 656, 0, 14, 8, 196, 0, 37, 0, 38], ["-", 0, 652, 3, 4, 0, 657, 31, 657, 17, 140], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 17, 578], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 140], ["+", 0, 652, 3, 4, 0, 657, 12, 657, 17, 578]]
5
87
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { int n, d; cin >> n >> d; int ans = 0; while (n--) { int x, y; cin >> x >> y; if (x * x + y * y <= d * d) ans++; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { long long n, d; cin >> n >> d; int ans = 0; while (n--) { long long x, y; cin >> x >> y; if (x * x + y * y <= d * d) ans++; } cout << ans << endl; return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 52, 8, 9, 0, 43, 39, 40], ["+", 0, 52, 8, 9, 0, 43, 39, 86, 0, 96]]
1
78
#include <bits/stdc++.h> using namespace std; #define int long long #define endl '\n' #define maxn 100010 const int MOD = 1000000007; void solve() { int n, d; cin >> n >> d; int ans = 0; for (int i = 0; i < n; ++i) { int a, b; cin >> a >> b; double x = sqrt(a * a + b * b); if (x >= d) ...
#include <bits/stdc++.h> using namespace std; #define int long long #define endl '\n' #define maxn 100010 const int MOD = 1000000007; void solve() { int n, d; cin >> n >> d; int ans = 0; for (int i = 0; i < n; ++i) { int a, b; cin >> a >> b; double x = sqrt(a * a + b * b); if (x <= d) ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
137
#include <bits/stdc++.h> #define rep(i, n) for (long long i = 0; i < (long long)(n); ++i) #define all(a) a.begin(), a.end() using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll, ll> P; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } ...
#include <bits/stdc++.h> #define rep(i, n) for (long long i = 0; i < (long long)(n); ++i) #define all(a) a.begin(), a.end() using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll, ll> P; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } ...
[["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 48], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]]
1
269
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define pb push_back #define f(i, n) for (int i = 0; i < n; ++i) #define fi(i, st, n) for (int i = st; i <= n; ++i) #define veci vector<int> #define vecp vector<pair<int, int>> #define vecl vector<ll> int prime[100000 + ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define pb push_back #define f(i, n) for (int i = 0; i < n; ++i) #define fi(i, st, n) for (int i = st; i <= n; ++i) #define veci vector<int> #define vecp vector<pair<int, int>> #define vecl vector<ll> int prime[100000 + ...
[["-", 8, 9, 0, 52, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 52, 8, 9, 0, 43, 39, 78]]
1
366
#include <bits/stdc++.h> #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define codefor \ int test; \ scanf("...
#include <bits/stdc++.h> #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define codefor \ int test; \ scanf("...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
644
#include <algorithm> #include <assert.h> #include <bitset> #include <cassert> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdint> #include <cstdio> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> ...
#include <algorithm> #include <assert.h> #include <bitset> #include <cassert> #include <cctype> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdint> #include <cstdio> #include <ctime> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> ...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78], ["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 7, 8, ...
1
515
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long int n, d; cin >> n >> d; long long int res = 0; while (n--) { long long int p, q; cin >> p >> q; if (((p * p) + (q * q)) == (d * d)) { res++; } } cout << res; r...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long int n, d; cin >> n >> d; long long int res = 0; while (n--) { long long int p, q; cin >> p >> q; if (((p * p) + (q * q)) <= (d * d)) { res++; } } cout << res; r...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
100
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; struct edge { int to; ll cost; }; int dx[] = {-1, 1, 0, 0}; int dy[] = {0, 0, 1, -1}; ll GCD(ll a, ll b) { if (b == 0) return a; else return GCD(b, a % b); } ll LCM(ll a, ll b) { if (a < b) swap(a, b...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> P; struct edge { int to; ll cost; }; int dx[] = {-1, 1, 0, 0}; int dy[] = {0, 0, 1, -1}; ll GCD(ll a, ll b) { if (b == 0) return a; else return GCD(b, a % b); } ll LCM(ll a, ll b) { if (a < b) swap(a, b...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 7, 8, 9, 0, 43, 39, 78]]
1
209
x,y=map(int,input().split()) res=0 for n in range(x): a,b=map(int,input().split()) d=(a*a +b*b)**.5 if d>=y:res+=1 print(res)
x,y=map(int,input().split()) res=0 for n in range(x): a,b=map(int,input().split()) d=(a*a +b*b)**.5 if d<=y:res+=1 print(res)
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]]
5
68
N,D=list(map(int,input().split())) count=0 for i in range(N): x,y=list(map(int,input().split())) if((x**2 + y**2)<=D): count+=1 print(count)
N,D=list(map(int,input().split())) count=0 for i in range(N): x,y=list(map(int,input().split())) if((x**2 + y**2)<=D**2): count+=1 print(count)
[["+", 0, 57, 15, 23, 0, 666, 0, 657, 17, 578], ["+", 0, 57, 15, 23, 0, 666, 0, 657, 12, 612]]
5
71
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> ii; int n, d; int ans; int main() { scanf("%d%d", &n, &d); for (int i = 0; i < n; i++) { int x, y; scanf("%d%d", &x, &y); double cur = sqrt(x * x + y * y); if (cur <= d) ans++; } printf("%d\n", ans); return 0; }
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> ii; int n, d; int ans; int main() { scanf("%d%d", &n, &d); for (int i = 0; i < n; i++) { long long x, y; scanf("%lld%lld", &x, &y); double cur = sqrt(x * x + y * y); if (cur <= d) ans++; } printf("%d\n", ans); return...
[["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 0, 7, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
112
#include <algorithm> //next_permutation #include <cctype> //文字の判定 #include <cmath> //min,max #include <complex> #include <iomanip> #include <iostream> //swap(#inc<utility>より) #include <locale> #include <map> //map #include <math.h> //要ります? #include <queue> #include <random> #include <set> #include <sstream> #...
#include <algorithm> //next_permutation #include <cctype> //文字の判定 #include <cmath> //min,max #include <complex> #include <iomanip> #include <iostream> //swap(#inc<utility>より) #include <locale> #include <map> //map #include <math.h> //要ります? #include <queue> #include <random> #include <set> #include <sstream> #...
[["-", 8, 9, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 14, 8, 9, 0, 43, 39, 78]]
1
871
#include "bits/stdc++.h" using namespace std; template <class... Args> void gin(Args &&...args) { (cin >> ... >> args); } #define dbg(var) cout << #var << "=" << var << " " #define nl cout << "\n" #define fr(i, n) for (int i = 0; i < n; i++) #define rep(i, a, n) for (int i = a; i <= n; i++) #define vi vector<int> #def...
#include "bits/stdc++.h" using namespace std; template <class... Args> void gin(Args &&...args) { (cin >> ... >> args); } #define dbg(var) cout << #var << "=" << var << " " #define nl cout << "\n" #define fr(i, n) for (int i = 0; i < n; i++) #define rep(i, a, n) for (int i = a; i <= n; i++) #define vi vector<int> #def...
[["+", 36, 36, 36, 36, 0, 30, 0, 58, 0, 148], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 141, 22], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59]]
1
181
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; using ll = long long; int main() { int n; int d; cin >> n >> d; int x, y; int cnt = 0; for (int i = 0; i < n; i++) { cin >> x >> y; if (d * d >= (x * x + y * y)) cnt++; } cout << cnt; }
#include <algorithm> #include <cmath> #include <iostream> #include <vector> using namespace std; using ll = long long; int main() { int n; ll d; cin >> n >> d; ll x, y; int cnt = 0; for (int i = 0; i < n; i++) { cin >> x >> y; if (d * d >= (x * x + y * y)) cnt++; } cout << cnt; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
91
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; // datatypes #define ll long long #define vi vector<int> #define vll vector<ll> #define si set<int> #define vii vector<ii> #define ii pair<int, int> #define vpll vector...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; using namespace __gnu_pbds; // datatypes #define ll long long #define vi vector<int> #define vll vector<ll> #define si set<int> #define vii vector<ii> #define ii pair<int, int> #define vpll vector...
[["+", 36, 36, 36, 36, 0, 30, 0, 58, 0, 148], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 141, 22], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59]]
1
499
import itertools from collections import deque,defaultdict,Counter from itertools import accumulate import bisect from heapq import heappop,heappush,heapify import math from copy import deepcopy import queue import numpy as np # sympy as syp(素因数分解とか) Mod = 1000000007 fact = [1, 1] factinv = [1, 1] inv = [0, 1] for i i...
import itertools from collections import deque,defaultdict,Counter from itertools import accumulate import bisect from heapq import heappop,heappush,heapify import math from copy import deepcopy import queue import numpy as np # sympy as syp(素因数分解とか) Mod = 1000000007 fact = [1, 1] factinv = [1, 1] inv = [0, 1] for i i...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]]
5
628
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, d; cin >> n >> d; d *= d; int sum = 0; while (n--) { long long x, y; cin >> x >> y; if (x * x + y * y <= d) sum++; } cout << sum; }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long n, d; cin >> n >> d; d *= d; int sum = 0; while (n--) { long long x, y; cin >> x >> y; if (x * x + y * y <= d) sum++; } cout << sum; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
84
#include <bits/stdc++.h> using namespace std; using ll = long long; using pll = pair<ll, ll>; using vl = vector<ll>; using vvl = vector<vector<ll>>; /* short */ #define pb push_back #define eb emplace_back #define mp make_pair #define Fi first #define Se second #define ALL(v) begin(v), end(v) #define RALL(v) rbegin(v)...
#include <bits/stdc++.h> using namespace std; using ll = long long; using pll = pair<ll, ll>; using vl = vector<ll>; using vvl = vector<vector<ll>>; /* short */ #define pb push_back #define eb emplace_back #define mp make_pair #define Fi first #define Se second #define ALL(v) begin(v), end(v) #define RALL(v) rbegin(v)...
[["-", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78], ["+", 0, 14, 49, 53, 54, 55, 0, 56, 39, 78]]
1
246
#include <stdio.h> typedef long long ll; int main(void) { ll n, d, i, ans = 0; scanf("%lld %lld", &n, &d); while (n--) { ll p, q; scanf("%lld %lld", &p, &q); if (p * p + q * q >= d * d) ans++; } printf("%lld", ans); return 0; }
#include <stdio.h> typedef long long ll; int main(void) { ll n, d, i, ans = 0; scanf("%lld %lld", &n, &d); while (n--) { ll p, q; scanf("%lld %lld", &p, &q); if (p * p + q * q <= d * d) ans++; } printf("%lld", ans); return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
92
# ------------------- fast io -------------------- import os import sys from io import BytesIO, IOBase BUFSIZE = 8192 class FastIO(IOBase): newlines = 0 def __init__(self, file): self._fd = file.fileno() self.buffer = BytesIO() self.writable = "x" in file.mode or "r" not in file.mode...
# ------------------- fast io -------------------- import os import sys from io import BytesIO, IOBase BUFSIZE = 8192 class FastIO(IOBase): newlines = 0 def __init__(self, file): self._fd = file.fileno() self.buffer = BytesIO() self.writable = "x" in file.mode or "r" not in file.mode...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]]
5
732
/** * The man who codes no bugs * McCheng is the man studying Maths in CUHK with IQ200 * @author McCheng */ #include <bits/stdc++.h> using namespace std; #define int long long class BDistance { public: static constexpr int kStressCount = 0; static void generateTest(ostream &test) {} void solve(istream &cin, ...
/** * The man who codes no bugs * McCheng is the man studying Maths in CUHK with IQ200 * @author McCheng */ #include <bits/stdc++.h> using namespace std; #define int long long class BDistance { public: static constexpr int kStressCount = 0; static void generateTest(ostream &test) {} void solve(istream &cin, ...
[["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 48], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]]
1
166
#include <algorithm> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i <= n; i++) const int INF = 1e6; using namespace std; using ll = long long...
#include <algorithm> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <queue> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define rep1(i, n) for (int i = 1; i <= n; i++) const int INF = 1e6; using namespace std; using ll = long long...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 8, 9, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 14, 8, 9, 0, 43, 39, 78]]
1
262
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, s, n) for (int i = s; i < (n); i++) #define ALL(a) a.begin(), a.end() #define RALL(a) a.rbegin(), a.rend() template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class ...
#include <bits/stdc++.h> #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, s, n) for (int i = s; i < (n); i++) #define ALL(a) a.begin(), a.end() #define RALL(a) a.rbegin(), a.rend() template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
265
#include <bits/stdc++.h> using namespace std; /* useful defines with short names */ #define st first #define nd second #define pb push_back #define pp pop_back #define all(x) (x).begin(), (x).end() #define lb(a, b, c) lower_bound(a, b, c) #define ub(a, b, c) upper_bound(a, b, c) #define forn(i, n) for (int i = 0; i < ...
#include <bits/stdc++.h> using namespace std; /* useful defines with short names */ #define st first #define nd second #define pb push_back #define pp pop_back #define all(x) (x).begin(), (x).end() #define lb(a, b, c) lower_bound(a, b, c) #define ub(a, b, c) upper_bound(a, b, c) #define forn(i, n) for (int i = 0; i < ...
[["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 48], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]]
1
5,059
#include <bits/stdc++.h> using namespace std; int main() { int n, k, a, b, sum = 0; cin >> n >> k; for (int i = 0; i < n; i++) { cin >> a >> b; if (sqrt(a * a + b * b) <= k) sum++; } cout << sum << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { double n, k, a, b, sum = 0; cin >> n >> k; for (int i = 0; i < n; i++) { cin >> a >> b; if (sqrt(a * a + b * b) <= k) sum++; } cout << sum << endl; return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
80
#include <iostream> #include <string> using namespace std; int main() { int c, distance, count = 0, x, y; cin >> c >> distance; distance *= distance; for (int i = 0; i < c; i++) { cin >> x >> y; x *= x; y *= y; if (distance >= (x + y)) { count++; } } cout << count; }
#include <iostream> #include <string> using namespace std; int main() { double c, distance, count = 0, x, y; cin >> c >> distance; distance *= distance; for (int i = 0; i < c; i++) { cin >> x >> y; x *= x; y *= y; if (distance >= (x + y)) { count++; } } cout << count; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
86
#include <bits/stdc++.h> #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") using namespace std; typedef long long ll; typedef long double ld; const double E = 1e-7; const ll INF = 1e17; #define forn(i, s, f) for (int i = s; i < f; ++i) #define ft first #define sec second #define fora(i, n) for (auto i ...
#include <bits/stdc++.h> #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") using namespace std; typedef long long ll; typedef long double ld; const double E = 1e-7; const ll INF = 1e17; #define forn(i, s, f) for (int i = s; i < f; ++i) #define ft first #define sec second #define fora(i, n) for (auto i ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 14, 8, 9, 0, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 9, 0, 43, 39, 78]]
1
162
#include <iostream> #include <vector> using namespace std; int main() { int n, d, cnt = 0; cin >> n >> d; d *= d; vector<int> x(n); vector<int> y(n); for (int i = 0; i < n; i++) { cin >> x.at(i); cin >> y.at(i); } for (int i = 0; i < n; i++) { if (x.at(i) * x.at(i) + y.at(i) * y.at(i) <= d) ...
#include <iostream> #include <vector> using namespace std; int main() { long long n, d, cnt = 0; cin >> n >> d; d *= d; vector<long long> x(n); vector<long long> y(n); for (int i = 0; i < n; i++) { cin >> x.at(i); cin >> y.at(i); } for (int i = 0; i < n; i++) { if (x.at(i) * x.at(i) + y.at(i...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 39, 344, 3, 347, 0, 77, 39, 86, 0, 96]]
1
142
#include <iostream> #include <vector> using namespace std; int main() { int n, d; int counter = 0; cin >> n >> d; long long d2 = d * d; for (int i = 0; i < n; i++) { int tmpx, tmpy; cin >> tmpx >> tmpy; long long tmpd = tmpx * tmpx + tmpy * tmpy; if (d2 >= tmpd) { counter++; } } ...
#include <iostream> #include <vector> using namespace std; int main() { long long n, d; long long counter = 0; cin >> n >> d; long long d2 = d * d; for (int i = 0; i < n; i++) { long long tmpx, tmpy; cin >> tmpx >> tmpy; long long tmpd = tmpx * tmpx + tmpy * tmpy; if (d2 >= tmpd) { // co...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 7, 8, 9, 0, 43, 39, 40], ["+", 0, 7, 8, 9, 0, 43, 39, 86, 0, 96]]
1
97
from collections import Counter import copy from itertools import combinations def A(x): return 'Yes' if x >= 30 else 'No' def B(N, D, X, Y): ans = 0 for i in range(N): Di = X[i]**2 + Y[i]**2 if Di < D**2: ans += 1 return ans def main(): N, D = map(int, input().split()) X = [] Y = [] ...
from collections import Counter import copy from itertools import combinations def A(x): return 'Yes' if x >= 30 else 'No' def B(N, D, X, Y): ans = 0 for i in range(N): Di = X[i]**2 + Y[i]**2 if Di <= D**2: ans += 1 return ans def main(): N, D = map(int, input().split()) X = [] Y = [] ...
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]]
5
166
#include <bits/stdc++.h> using namespace std; int main() { int n, d; cin >> n >> d; long long x[n], y[n]; for (int i = 0; i < n; i++) { cin >> x[i] >> y[i]; } double ans; int cnt = 0; for (int i = 0; i < n; i++) { ans = sqrt(x[i] * x[i] + y[i] * y[i]); if (ans < d) cnt++; } cout <...
#include <bits/stdc++.h> using namespace std; int main() { int n, d; cin >> n >> d; long long x[n], y[n]; for (int i = 0; i < n; i++) { cin >> x[i] >> y[i]; } double ans; int cnt = 0; for (int i = 0; i < n; i++) { ans = sqrt(x[i] * x[i] + y[i] * y[i]); if (ans <= d) cnt++; } cout ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
127
#include <iostream> #include <string> int main() { // input int N, D; std::cin >> N >> D; int X[N]; int Y[N]; int dSquare = D * D; int result = 0; for (int i = 0; i < N; i++) { std::cin >> X[i] >> Y[i]; if (X[i] * X[i] + Y[i] * Y[i] <= dSquare) { result++; } } std::cout << resu...
#include <iostream> #include <string> int main() { // input long N, D; std::cin >> N >> D; long X[N]; long Y[N]; long dSquare = D * D; long result = 0; for (int i = 0; i < N; i++) { std::cin >> X[i] >> Y[i]; if (X[i] * X[i] + Y[i] * Y[i] <= dSquare) { result++; } } std::cout <<...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
117
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; #define all(x) x.begin(), x.end() signed main() { int n, d; cin >> n >> d; int ans = 0; rep(i, n) { int x, y; cin >> x >> y; double far; far = sqrt((x * x) + (y * y)); if...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef long long ll; #define all(x) x.begin(), x.end() signed main() { ll n, d; cin >> n >> d; ll ans = 0; rep(i, n) { ll x, y; cin >> x >> y; double long far; far = sqrt((x * x) + (y * y)); ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 8, 9, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 8, 9, 0, 14, 8, 9, 0, 43, 49, 22]]
1
101
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair<int, int>; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair<int, int>; template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; } template <class T> inline bool chmax(T &a, T b) { if (a < b) ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 8, 9, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 14, 8, 9, 0, 43, 39, 78]]
1
222
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pii pair<int, int> #define _FastIO \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define pii pair<int, int> #define _FastIO \ ios_base::sync_with_stdio(0); \ cin.tie(0); ...
[["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
102
#include "bits/stdc++.h" using namespace std; int main() { int n, ans = 0, x, y, d, dd, dis; cin >> n >> d; dd = d * d; for (int i = 0; i < n; i++) { cin >> x >> y; dis = x * x + y * y; if (dis <= d) { ans++; } } cout << ans << endl; return 0; }
#include "bits/stdc++.h" using namespace std; int main() { long long n, ans = 0, x, y, d, dd, dis; cin >> n >> d; dd = d * d; for (int i = 0; i < n; i++) { cin >> x >> y; dis = x * x + y * y; if (dis <= dd) { ans++; } } cout << ans << endl; return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]]
1
95
#include <stdio.h> int main() { int i; int ans = 0; int n; int d; long a[400001]; scanf("%d %d", &n, &d); for (i = 0; i < n * 2; i += 2) { scanf("%ld %ld", &a[i], &a[i + 1]); } for (i = 0; i < n * 2; i += 2) { if (a[i] * a[i] + a[i + 1] * a[i + 1] <= d * d) { ans++; } } printf("...
#include <stdio.h> int main() { int i; int ans = 0; int n; long d; long a[400001]; scanf("%d %ld", &n, &d); for (i = 0; i < n * 2; i += 2) { scanf("%ld %ld", &a[i], &a[i + 1]); } for (i = 0; i < n * 2; i += 2) { if (a[i] * a[i] + a[i + 1] * a[i + 1] <= d * d) { ans++; } } printf...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
145
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n, d; cin >> n >> d; vector<int> x(n), y(n); rep(i, n) cin >> x[i] >> y[i]; int cnt = 0; rep(i, n) { if (x[i] * x[i] + y[i] * y[i] <= d * d) { ...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; int main() { ll n, d; cin >> n >> d; vector<ll> x(n), y(n); rep(i, n) cin >> x[i] >> y[i]; int cnt = 0; rep(i, n) { if (x[i] * x[i] + y[i] * y[i] <= d * d) { ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78]]
1
133
// package com.atcoder.contest174.b; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) { FastScanner fs = new FastScanner(); int n = fs.nextInt(); int d = fs.nextInt();...
// package com.atcoder.contest174.b; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) { FastScanner fs = new FastScanner(); int n = fs.nextInt(); long d = fs.nextInt()...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["-", 0, 7, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 7, 8, 196, 0, 503, 39, 506, 0, 96]]
3
306
import math N,D = map(int,input().split()) A = [list(map(int, input().split())) for i in range(N)] count = 0 for i in range(N-1): a = math.sqrt((A[i][0]**2+(A[i][1])**2)) if a <= D: count += 1 print(count)
import math N,D = map(int,input().split()) A = [list(map(int, input().split())) for i in range(N)] count = 0 for i in range(N): a = math.sqrt((A[i][0]**2+(A[i][1])**2)) if a <= D: count += 1 print(count)
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 17, 33], ["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
99
import numpy as np N, D = map(int,input().split()) num = 0 for n in range(N): x,y = map(int,input().split()) d = np.sqrt(x**2 + y**2) if d >= D: num+=1 print(num)
import numpy as np N, D = map(int,input().split()) num = 0 for n in range(N): x,y = map(int,input().split()) d = np.sqrt(x**2 + y**2) if d <= D: num+=1 print(num)
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]]
5
73
import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int T = in.nextInt(); int count = 0; double a = Math.pow(in.nextDouble(), 2); for (int i = 0; i < T; i++) { double a1 = in.nextDouble(), a2 = in.nextDouble(); if (Ma...
import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int T = in.nextInt(); int count = 0; double a = Math.pow(in.nextDouble(), 2); for (int i = 0; i < T; i++) { double a1 = in.nextDouble(), a2 = in.nextDouble(); if (Ma...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 20], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19]]
3
134
import math a = list(map(int,input().split())) #N a[0] #D a[1] d = 0 for i in range(a[0]): b = list(map(int,input().split())) c = math.sqrt(b[0]*b[0]+b[1]*b[1]) if c >= a[1]: d=d+1 print(d)
import math a = list(map(int,input().split())) #N a[0] #D a[1] d = 0 for i in range(a[0]): b = list(map(int,input().split())) c = math.sqrt(b[0]*b[0]+b[1]*b[1]) if a[1] >= c: d=d+1 print(d)
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 22]]
5
95
#include <iostream> using namespace std; const int N = 2e5 + 10; int main() { int n, d; cin >> n >> d; int ans = 0; for (int i = 1, x, y; i <= n; ++i) { cin >> x >> y; if (x * x + y * y <= d * d) ans++; } cout << ans << '\n'; return 0; }
#include <iostream> #define int long long using namespace std; const int N = 2e5 + 10; signed main() { int n, d; cin >> n >> d; int ans = 0; for (int i = 1, x, y; i <= n; ++i) { cin >> x >> y; if (x * x + y * y <= d * d) ans++; } cout << ans << '\n'; return 0; }
[["+", 36, 36, 36, 36, 0, 30, 0, 58, 0, 148], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 141, 22], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 0, 30, 0, 14, 39, 86, 0, 156]]
1
90
#include <bits/stdc++.h> using namespace std; int main() { int n; long long int d; cin >> n >> d; int ans = 0; int x, y; for (int i = 0; i < n; i++) { cin >> x >> y; if (x * x + y * y <= d * d) ans++; } cout << ans; }
#include <bits/stdc++.h> using namespace std; int main() { int n; long long int d; cin >> n >> d; int ans = 0; long long int x, y; for (int i = 0; i < n; i++) { cin >> x >> y; if (x * x + y * y <= d * d) ans++; } cout << ans; }
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
79
#include <assert.h> #include <iostream> //#include<vector> #include <math.h> #define ios \ ios::sync_with_stdio(false); \ cin.tie(0); \...
#include <assert.h> #include <iostream> //#include<vector> #include <math.h> #define ios \ ios::sync_with_stdio(false); \ cin.tie(0); \...
[["-", 0, 7, 8, 9, 0, 57, 64, 1, 0, 35]]
1
144
#include <math.h> #include <stdio.h> int main() { int t, d, c = 0; scanf("%d %d", &t, &d); while (t--) { int x, y; scanf("%d %d", &x, &y); double result = sqrt(x * x + y * y); if (result <= d) c = c + 1; } printf("%d", c); }
#include <math.h> #include <stdio.h> int main() { int t, d, c = 0; scanf("%d %d", &t, &d); while (t--) { long int x, y; scanf("%ld %ld", &x, &y); double result = sqrt(x * x + y * y); if (result <= d) c = c + 1; } printf("%d", c); }
[["+", 0, 52, 8, 9, 0, 43, 39, 86, 0, 96], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
92
#include <bits/stdc++.h> using namespace std; int main() { int N, D; cin >> N >> D; int a, b; int ans = 0; for (int i = 1; i <= N; i++) { cin >> a >> b; if (a * a + b * b <= D * D) ans++; } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long N, D; cin >> N >> D; long long a, b; long long ans = 0; for (int i = 1; i <= N; i++) { cin >> a >> b; if (a * a + b * b <= D * D) ans++; } cout << ans << endl; return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
81
/* * Name : chaitanya * * Institute : ANITS,Visakhapatnam * "Don't regret anything you do, because in the end it makes you who you * are." * */ #include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <complex>...
/* * Name : chaitanya * * Institute : ANITS,Visakhapatnam * "Don't regret anything you do, because in the end it makes you who you * are." * */ #include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <complex>...
[["-", 8, 9, 0, 52, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 52, 8, 9, 0, 43, 39, 78]]
1
146
import math n,d = map(int, input().split()) count = 0 for i in range(n): x,y = map(int, input().split()) dis = math.sqrt((x**2)+(y**2)) if dis >= d: count += 1 print(count)
import math n,d = map(int, input().split()) count = 0 for i in range(n): x,y = map(int, input().split()) dis = math.sqrt((x**2)+(y**2)) if dis <= d: count += 1 print(count)
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]]
5
75
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef uint64_t bu; typedef vector<ll> vll; typedef vector<int> vi; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<pll> vpl; typedef vector<string> vs; typedef vector<char> vc; #define vb vector<bool> #define pub push_back #def...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef uint64_t bu; typedef vector<ll> vll; typedef vector<int> vi; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<pll> vpl; typedef vector<string> vs; typedef vector<char> vc; #define vb vector<bool> #define pub push_back #def...
[["-", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 2, 63, 22]]
1
1,304
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { int n, d, S = 0; cin >> n >> d; d *= d; for (int i = 0; i < n; i++) { ll a, b; cin >> a >> b; if (a * a + b * b <= d) S++; } cout << S << endl; }
#include <bits/stdc++.h> using namespace std; #define ll long long int main() { int n, S = 0; ll d; cin >> n >> d; d *= d; for (int i = 0; i < n; i++) { ll a, b; cin >> a >> b; if (a * a + b * b <= d) S++; } cout << S << endl; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 49, 22]]
1
82
N, D = map(int,input().split()) for i in range(N): X, Y = map(int, input().split()) A = ((X**2 + Y**2)**0.5) if A <= D: Z = Z + 1 print(Z)
N, D = map(int,input().split()) Z = 0 for i in range(N): X, Y = map(int, input().split()) A = ((X**2 + Y**2)**0.5) if A <= D: Z = Z + 1 print(Z)
[["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612]]
5
69
n, d = map(int, input().split()) point = [list(map(int, input().split())) for i in range(n)] d = d*d ans = 0 for i in point: if d <= i[0]*i[0]+i[1]*i[1]: ans += 1 print(ans)
n, d = map(int, input().split()) point = [list(map(int, input().split())) for i in range(n)] d = d*d ans = 0 for i in point: if d >= i[0]*i[0]+i[1]*i[1]: ans += 1 print(ans)
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20]]
5
85
#include <bits/stdc++.h> using namespace std; #define LL long long #define sc(a) scanf("%d", &a) #define sc2(a, b) scanf("%d%d", &a, &b) #define sc3(a, b, c) scanf("%d%d%d", &a, &b, &c) #define scl(a) scanf("%lld", &a) #define scl2(a, b) scanf("%lld%lld", &a, &b) #define ss(a) scanf("%s", a) #define mem(a, b) memset(a,...
#include <bits/stdc++.h> using namespace std; #define LL long long #define sc(a) scanf("%d", &a) #define sc2(a, b) scanf("%d%d", &a, &b) #define sc3(a, b, c) scanf("%d%d%d", &a, &b, &c) #define scl(a) scanf("%lld", &a) #define scl2(a, b) scanf("%lld%lld", &a, &b) #define ss(a) scanf("%s", a) #define mem(a, b) memset(a,...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
165
#include <bits/stdc++.h> using namespace std; int main() { int n, cnt; double k; cnt = 0; cin >> n >> k; while (n--) { int x, y; cin >> x >> y; double dis = sqrt(x * x + y * y); if (dis <= k) cnt++; } cout << cnt << endl; }
#include <bits/stdc++.h> #define int long long using namespace std; signed main() { int n, cnt; double k; cnt = 0; cin >> n >> k; while (n--) { int x, y; cin >> x >> y; double dis = sqrt(x * x + y * y); if (dis <= k) cnt++; } cout << cnt << endl; }
[["+", 36, 36, 36, 36, 0, 30, 0, 58, 0, 148], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 141, 22], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 36, 36, 36, 36, 0, 30, 0, 14, 39, 40], ["+", 36, 36, 0, 30, 0, 14, 39, 86, 0, 156]]
1
77
n,d = map(int,input().split()) res = 0 for _ in range(n): x,y = map(int,input().split()) if x*x+y*y>=d*d: res+=1 print(res)
n,d = map(int,input().split()) res = 0 for _ in range(n): x,y = map(int,input().split()) if x*x+y*y<=d*d: res+=1 print(res)
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 20], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]]
5
63
param_n, param_d = map(int, input().split()) param_count = 0 for i in param_n: param_a, param_b = map(int, input().split()) if (param_a)*(param_a) + (param_b)*(param_b) <= (param_d)*(param_d): param_count = param_count + 1 print(param_count)
param_n, param_d = map(int, input().split()) param_count = 0 for i in range(param_n): param_a, param_b = map(int, input().split()) if (param_a)*(param_a) + (param_b)*(param_b) <= (param_d)*(param_d): param_count = param_count + 1 print(param_count)
[["+", 36, 36, 0, 656, 0, 7, 12, 652, 63, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 24], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 25]]
5
74
#include <iostream> int main() { int N = 0, D = 0, X = 0, Y = 0; std::cin >> N >> D; int answer = 0; for (int count = 0; count < N; count++) { std::cin >> X >> Y; if (((X * X) + (Y * Y) - (D * D)) > 0) { continue; } ++answer; } std::cout << answer << std::endl; }
#include <iostream> int main() { int N = 0; long long D = 0, X = 0, Y = 0; std::cin >> N >> D; int answer = 0; for (int count = 0; count < N; count++) { std::cin >> X >> Y; if (((X * X) + (Y * Y) - (D * D)) > 0) { continue; } ++answer; } std::cout << answer << std::endl; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
103
#include <bits/stdc++.h> using namespace std; int main() { int n, d, x, y, ctr = 0; double max; cin >> n >> d; while (n--) { cin >> x >> y; max = sqrt(x * x + y * y); if (max <= d) ctr++; } cout << ctr << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long int n, d, x, y, ctr = 0; double max; cin >> n >> d; while (n--) { cin >> x >> y; max = sqrt(x * x + y * y); if (max <= d) ctr++; } cout << ctr << endl; }
[["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
75
#include <bits/stdc++.h> #define ll long long using namespace std; const int INF = 1e9 + 7; bool isPerfectSquare(ll x) { ll s = sqrt(x); return (s * s == x); } int main() { ios::sync_with_stdio(false); int n, d; cin >> n >> d; int ans = 0; for (int i = 0; i < n; ++i) { ll x, y; cin >> x >> y; ...
#include <bits/stdc++.h> #define ll long long using namespace std; const int INF = 1e9 + 7; bool isPerfectSquare(ll x) { ll s = sqrt(x); return (s * s == x); } int main() { ios::sync_with_stdio(false); int n, d; cin >> n >> d; int ans = 0; for (int i = 0; i < n; ++i) { ll x, y; cin >> x >> y; ...
[["-", 0, 57, 15, 339, 51, 2, 3, 4, 0, 22], ["+", 15, 339, 51, 2, 3, 4, 0, 16, 31, 22], ["+", 15, 339, 51, 2, 3, 4, 0, 16, 17, 72], ["+", 15, 339, 51, 2, 3, 4, 0, 16, 12, 22]]
1
174
#include <bits/stdc++.h> using namespace std; using i64 = long long; using f64 = double; #define FOR(i, s, n) for (size_t i = (s); i < (size_t)(n); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(v) (v).begin(), (v).end() template <typename T, typename U> inline bool chmax(T &a, U b) { return a < b ? (a = b, true)...
#include <bits/stdc++.h> using namespace std; using i64 = long long; using f64 = double; #define FOR(i, s, n) for (size_t i = (s); i < (size_t)(n); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(v) (v).begin(), (v).end() template <typename T, typename U> inline bool chmax(T &a, U b) { return a < b ? (a = b, true)...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40]]
1
179
#include <bits/stdc++.h> namespace ztd { using namespace std; #define reg register #define ms(a) memset(a, 0, sizeof(a)) #define count(x) __builtin_popcountll(x) #define smallest_one(x) __builtin_ffsll(x) typedef long long ll; typedef unsigned long long ull; typedef unsigned int uint; typedef double db; // basic I/O te...
#include <bits/stdc++.h> namespace ztd { using namespace std; #define reg register #define ms(a) memset(a, 0, sizeof(a)) #define count(x) __builtin_popcountll(x) #define smallest_one(x) __builtin_ffsll(x) typedef long long ll; typedef unsigned long long ull; typedef unsigned int uint; typedef double db; // basic I/O te...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
522
#include <bits/stdc++.h> using namespace std; int main() { int N, D; cin >> N >> D; int X, Y, i, l; int n = 0; for (i = 0; i < N; i++) { cin >> X >> Y; l = sqrt(pow(X, 2) + pow(Y, 2)); if (l <= D) n += 0; } cout << n << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int N, D; cin >> N >> D; int X, Y, i; double l; int n = 0; for (i = 0; i < N; i++) { cin >> X >> Y; l = sqrt(pow(X, 2) + pow(Y, 2)); if (l <= D) n++; } cout << n << endl; return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 21], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["-", 8, 9, 0, 57, 64, 1, 0, 11, 17, 107], ["-", 8, 9, 0, 57, 64, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 57, 64, 1, 0, 27, 17, 29]]
1
96
#include <bits/stdc++.h> using namespace std; int main() { int N, D; cin >> N >> D; int X, Y; int ans = 0; for (int i = 0; i < N; i++) { cin >> X >> Y; if (sqrt(X * X + Y * Y) <= D) { ans++; } } cout << ans << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int N, D; cin >> N >> D; long X, Y; int ans = 0; for (int i = 0; i < N; i++) { cin >> X >> Y; if (sqrt(X * X + Y * Y) <= D) { ans++; } } cout << ans << endl; return 0; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
84
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int n, d; cin >> n >> d; int cnt = 0; int rez = 0; while (n--) { int a, b; cin >> a >> b; rez = pow(a, 2) + pow(b, 2); if (sqrt(rez) <= d) { cnt++; } } cout << cnt; }
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int n, d; cin >> n >> d; int cnt = 0; long long rez = 0; while (n--) { int a, b; cin >> a >> b; rez = pow(a, 2) + pow(b, 2); if (sqrt(rez) <= d) { cnt++; } } cout << cnt; }
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
99
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int d = sc.nextInt(); int[][] arr = new int[n][2]; for (int i = 0; i < n; i++) { for (int j = 0; j < 2; j++) { arr[i][j] = sc.nextInt();...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int d = sc.nextInt(); int[][] arr = new int[n][2]; for (int i = 0; i < n; i++) { for (int j = 0; j < 2; j++) { arr[i][j] = sc.nextInt();...
[["-", 0, 7, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 7, 8, 196, 0, 503, 39, 506, 0, 96], ["-", 0, 503, 49, 200, 51, 74, 39, 506, 0, 507], ["+", 0, 503, 49, 200, 51, 74, 39, 506, 0, 96], ["-", 15, 15, 0, 16, 12, 74, 39, 506, 0, 507], ["+", 15, 15, 0, 16, 12, 74, 39, 506, 0, 96]]
3
204
def main(): d, n = map(int, input().split()) counter = 0 for _ in range(n): x, y = map(int, input().split()) if x**2 + y**2 <= d**2: counter += 1 return print(counter) main()
def main(): n, d = map(int, input().split()) counter = 0 for _ in range(n): x, y = map(int, input().split()) if x**2 + y**2 <= d**2: counter += 1 return print(counter) main()
[["-", 8, 196, 0, 1, 0, 662, 31, 684, 0, 22], ["-", 8, 196, 0, 1, 0, 662, 31, 684, 0, 21], ["+", 8, 196, 0, 1, 0, 662, 31, 684, 0, 21], ["+", 8, 196, 0, 1, 0, 662, 31, 684, 0, 22]]
5
72
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define all(a) a.begin(), a.end() #define pb push_back #define mp make_pair typedef long long ll; typedef pair<ll, ll> P; typedef pair<ll, int> pli; typedef pair<int, int> pii; #define rep(i, a, b) for (ll i = a; i < b; i++) #define qrep(q...
#include <bits/stdc++.h> using namespace std; #define fi first #define se second #define all(a) a.begin(), a.end() #define pb push_back #define mp make_pair typedef long long ll; typedef pair<ll, ll> P; typedef pair<ll, int> pli; typedef pair<int, int> pii; #define rep(i, a, b) for (ll i = a; i < b; i++) #define qrep(q...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 14, 8, 9, 0, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 9, 0, 43, 39, 78]]
1
885
#include <cmath> #include <iostream> using namespace std; int main() { int64_t nof, d; cin >> nof >> d; int64_t tot = 0; int64_t p1, p2; for (size_t i{0}; i != nof; ++i) { cin >> p1 >> p2; if (sqrt(p1 * p1 + p2 * p2) <= d) ++tot; } }
#include <cmath> #include <iostream> using namespace std; int main() { int64_t nof, d; cin >> nof >> d; int64_t tot = 0; int64_t p1, p2; for (size_t i{0}; i != nof; ++i) { cin >> p1 >> p2; if (sqrt(p1 * p1 + p2 * p2) <= d) ++tot; } cout << tot; }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
76
import math def main(): N, D = list(map(int, input().split())) ans = 0 for i in range(1,N): A, B = list(map(int, input().split())) dist = math.sqrt(A**2 + B**2 ) if dist <= D: ans +=1 print(ans) if __name__ == '__main__': main()
import math def main(): N, D = list(map(int, input().split())) ans = 0 for i in range(0,N): A, B = list(map(int, input().split())) dist = math.sqrt(A**2 + B**2) if dist <= D: ans +=1 print(ans) if __name__ == '__main__': main()
[["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]]
5
94
// // main.cpp // B // // Created by Yoshinao Itakura on 2020/08/02. // Copyright © 2020 Yoshinao Itakura. All rights reserved. // #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using ...
// // main.cpp // B // // Created by Yoshinao Itakura on 2020/08/02. // Copyright © 2020 Yoshinao Itakura. All rights reserved. // #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <map> #include <queue> #include <set> #include <string> #include <vector> using ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 43, 39, 86, 0, 96]]
1
155
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; import java.util.StringJoiner; import java.util.StringTokenizer; import java.util.function.IntUnaryOperator; import java.util.function.LongUnaryOper...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; import java.util.StringJoiner; import java.util.StringTokenizer; import java.util.function.IntUnaryOperator; import java.util.function.LongUnaryOper...
[["-", 0, 195, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 195, 8, 196, 0, 503, 39, 506, 0, 96], ["-", 0, 7, 8, 196, 0, 503, 39, 506, 0, 507], ["+", 0, 7, 8, 196, 0, 503, 39, 506, 0, 96]]
3
1,004
k = int(input()) if k % 2 == 0 or k % 5 == 0: print("-1") elif k == (1 or 7): print(1) else: t = 2 ex = 77 for i in range(10 ** 8): if ex % k == 0: break ex = (ex % k) * 10 + 7 t += 1 print(t)
k = int(input()) if k % 2 == 0 or k % 5 == 0: print(-1) elif k == 1 or k == 7: print(1) else: t = 2 ex = 77 for i in range(10 ** 8): if ex % k == 0: break ex = (ex % k) * 10 + 7 t += 1 print(t)
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655], ["+", 0, 1, 0, 652, 3, 4, 0, 664, 17, 33], ["+", 0, 1, 0, 652, 3, 4, 0, 664, 28, 612], ["-", 0, 57, 75, 665, 15, 666, 0, 23, 0, 24], ["+", 0, 57, 75, 665, 15, 679, 12, 666, 0, 22], ["+", 0, 57...
5
84
#include <bits/stdc++.h> #define rep(i, ss, ee) for (int i = ss; i < ee; ++i) using namespace std; int k; void input() { cin >> k; } void exit_end(int ans) { cout << ans << endl; exit(0); } void solve() { vector<int> v(k + 1, -1); if (k % 2 == 0) exit_end(-1); v[1] = 7 % k; rep(i, 2, k) v[i] = (v[i ...
#include <bits/stdc++.h> #define rep(i, ss, ee) for (int i = ss; i < ee; ++i) using namespace std; int k; void input() { cin >> k; } void exit_end(int ans) { cout << ans << endl; exit(0); } void solve() { vector<int> v(k + 1, -1); if (k % 2 == 0) exit_end(-1); v[1] = 7 % k; rep(i, 2, k + 1) v[i] = (...
[["+", 31, 69, 28, 2, 3, 4, 0, 16, 17, 72], ["+", 31, 69, 28, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
177
#include <iostream> int main(void) { int k; std::cin >> k; int cur = 7; int cnt = 1; for (int i = 0; i <= k; i++) { if (cur == 0) { std::cout << cnt << std::endl; return 0; } else { cnt++; cur = cur * 10 + 7; cur %= k; } } std::cout << -1 << std::endl; return 0...
#include <iostream> int main(void) { int k; std::cin >> k; int cur = 7 % k; int cnt = 1; for (int i = 0; i <= k; i++) { if (cur == 0) { std::cout << cnt << std::endl; return 0; } else { cnt++; cur = cur * 10 + 7; cur %= k; } } std::cout << -1 << std::endl; retu...
[["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 109], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22]]
1
96
k = int(input()) start = 7 % k ans = start con = 1 if k % 2 == 0 or k % 5 == 0: print("No") exit() while True: if ans == 0: print(con) break else: con += 1 ans = ans * 10 + 7 ans = ans % k if ans == start: print("-1") break
k = int(input()) start = 7 % k ans = start con = 1 if k % 2 == 0 or k % 5 == 0: print("-1") exit() while True: if ans == 0: print(con) break else: con += 1 ans = ans * 10 + 7 ans = ans % k if ans == start: print("-1") break
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
83
#include <bits/stdc++.h> using namespace std; #define print cout << #define printl(s) cout << s << endl; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; const ll modseed = pow(10, 9) + 7; template <typename T> vector<T> getValues(int num) { vector<T> values(num); for (int i = 0; i < num; i+...
#include <bits/stdc++.h> using namespace std; #define print cout << #define printl(s) cout << s << endl; #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; const ll modseed = pow(10, 9) + 7; template <typename T> vector<T> getValues(int num) { vector<T> values(num); for (int i = 0; i < num; i+...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
252
K = int(input()) i = 7%K se = set(i) cnt = 1 while True: if i == 0: print(cnt) break cnt += 1 i = (i*10 + 7)%K if i in se: print(-1) break else: se.add(i)
K = int(input()) i = 7%K se = set([i]) cnt = 1 while True: if i == 0: print(cnt) break cnt += 1 i = (i*10 + 7)%K if i in se: print(-1) break else: se.add(i)
[["+", 0, 662, 12, 652, 3, 4, 0, 634, 0, 70], ["+", 0, 662, 12, 652, 3, 4, 0, 634, 0, 73]]
5
68
k=int(input()) ans=[0]*(k+1) ans[0] = 7 if 7 % k == 0: print(0) quit() for i in range(1,k): ans[i] += ((10*ans[i-1]+7)%k) if ans[i] % k == 0: print(i+1) break else: print(-1)
k=int(input()) ans=[0]*(k+1) ans[0] = 7 if 7 % k == 0: print(1) quit() for i in range(1,k): ans[i] += ((10*ans[i-1]+7)%k) if ans[i] % k == 0: print(i+1) break else: print(-1)
[["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]]
5
94
#include <iostream> #include <math.h> #include <set> using namespace std; int main() { int n; cin >> n; int ans = 1; long long m = 7; while (ans <= n) { m = (10 * m + 7) % n; // cout<<m<<endl; if (m % n == 0) break; ans++; } if (ans <= n) cout << ans + 1; else cout <...
#include <iostream> #include <math.h> #include <set> using namespace std; int main() { int n; cin >> n; int ans = 1; long long m = 0; while (ans <= n) { m = (10 * m + 7) % n; // cout<<m<<endl; if (m % n == 0) break; ans++; } if (ans <= n) cout << ans; else cout << -1...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 57, 64, 1, 0, 16, 12, 16, 17, 72], ["-", 0, 57, 64, 1, 0, 16, 12, 16, 12, 13]]
1
88
#include <bits/stdc++.h> using ll = long long; using namespace std; ll modpow(ll n, ll x, ll MOD) { ll ret = 1; while (x) { if (x & 1) { (ret *= n) %= MOD; } x >>= 1; (n *= n) %= MOD; } return ret; } int main() { int k; cin >> k; if (k % 7 == 0) { for (int i = 1; i < k; ++i) { ...
#include <bits/stdc++.h> using ll = long long; using namespace std; ll modpow(ll n, ll x, ll MOD) { ll ret = 1; while (x) { if (x & 1) { (ret *= n) %= MOD; } x >>= 1; (n *= n) %= MOD; } return ret; } int main() { int k; cin >> k; if (k % 7 == 0) { for (int i = 1; i <= k; ++i) { ...
[["-", 0, 57, 64, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 57, 64, 9, 0, 7, 15, 16, 17, 19], ["-", 75, 76, 0, 9, 0, 7, 15, 16, 17, 18], ["+", 75, 76, 0, 9, 0, 7, 15, 16, 17, 19], ["-", 0, 57, 64, 9, 0, 1, 0, 16, 12, 13], ["+", 0, 57, 64, 9, 0, 1, 0, 16, 12, 13]]
1
245
import sys read = sys.stdin.read readlines = sys.stdin.readlines def main(): k = int(input()) if k % 2 == 0 or k % 5 == 0: print(-1) sys.exit() if k % 7 == 0: l = k * 9 // 7 else: l = k * 9 r = 1 # カウント p = 10 ** r while (p % l) != 1: p = (p * 10...
import sys read = sys.stdin.read readlines = sys.stdin.readlines def main(): k = int(input()) if k % 2 == 0 or k % 5 == 0: print(-1) sys.exit() if k % 7 == 0: l = k * 9 // 7 else: l = k * 9 r = 1 # カウント p = 10 ** r while (p % l) != 1: p = (p * 10...
[["-", 8, 196, 0, 1, 0, 662, 12, 657, 12, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 22]]
5
117
#include <bits/stdc++.h> #define ll long long #define rep(i, n) for (ll i = 0; i < n; i++) #define repr(i, a, b) for (ll i = a; i < b; i++) #define all(a) a.begin(), a.end() #define w(tc) \ ll tc; ...
#include <bits/stdc++.h> #define ll long long #define rep(i, n) for (ll i = 0; i < n; i++) #define repr(i, a, b) for (ll i = a; i < b; i++) #define all(a) a.begin(), a.end() #define w(tc) \ ll tc; ...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13]]
1
132
#include <bits/stdc++.h> using namespace std; #include <iomanip> #include <math.h> 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; } const int mod = 1000...
#include <bits/stdc++.h> using namespace std; #include <iomanip> #include <math.h> 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; } const int mod = 1000...
[["-", 0, 43, 49, 50, 51, 4, 0, 16, 17, 33], ["-", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13]]
1
206
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; /* ll n , m ; cin >> n >> m ; ll a , b , c ; cin >> a >> b >> c ; vector<ll> A(n) ; cout << "Yes" << endl ; cout << "No" << endl ; */ int main() { ll n; cin >> n; ll ans = 7 % n; fo...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; /* ll n , m ; cin >> n >> m ; ll a , b , c ; cin >> a >> b >> c ; vector<ll> A(n) ; cout << "Yes" << endl ; cout << "No" << endl ; */ int main() { ll n; cin >> n; ll ans = 7 % n; fo...
[["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 32]]
1
93
// Problem : C - Repsept // Contest : AtCoder - AtCoder Beginner Contest 174 // URL : https://atcoder.jp/contests/abc174/tasks/abc174_c // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <bits/stdc++.h> #pragma GCC target("avx,avx2,fma") //#pragma...
// Problem : C - Repsept // Contest : AtCoder - AtCoder Beginner Contest 174 // URL : https://atcoder.jp/contests/abc174/tasks/abc174_c // Memory Limit : 1024 MB // Time Limit : 2000 ms // Powered by CP Editor (https://github.com/cpeditor/cpeditor) #include <bits/stdc++.h> #pragma GCC target("avx,avx2,fma") //#pragma...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
456
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int n, m; int a[1000], b[1000]; int main() { int k; cin >> k; if (k == 1) { cout << 7 << endl; return 0; } if (k % 7 == 0) { k = k / 7; } if (__gcd(10, k) != 1) { cout << -1 << endl; return 0; } int c = 1...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int n, m; int a[1000], b[1000]; int main() { int k; cin >> k; if (k == 1) { cout << 1 << endl; return 0; } if (k % 7 == 0) { k = k / 7; } if (__gcd(10, k) != 1) { cout << -1 << endl; return 0; } int c = 1...
[["-", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13]]
1
137
k = int(input()) a = 7 for i in range(1, 10**7): if a == 0: print(i) exit() a = (a*10+7)%k print(-1)
k = int(input()) a = 7 for i in range(1, 10**6): if a%k == 0: print(i) exit() a = (a*10+7)%k print(-1)
[["-", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 109], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 12, 22]]
5
51
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define all(n) begin(n), end(n) using ll = long long; using P = pair<int, int>; int main() { ll k; cin >> k; vector<int> num(k + 1); num[0] = 7 % k; if (k == 7) { cout << 1 << endl; return 0; } rep(i, k)...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define all(n) begin(n), end(n) using ll = long long; using P = pair<int, int>; int main() { ll k; cin >> k; vector<int> num(k + 1); num[0] = 7 % k; if (num[0] == 0) { cout << 1 << endl; return 0; } rep(...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 69, 28, 22], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 70], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 16, 31, 69, 341, 342, 0, 73], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16,...
1
152
#include <bits/stdc++.h> typedef long long ll; #define pb push_back #define mod 1000000007ll const ll maxn = 9e18; using namespace std; void solve() { int k; cin >> k; int num = 7 % 9, i = 0; map<int, int> m; while (1) { m[num]++; if (m[num] > 1) { cout << -1 << endl; return; } if...
#include <bits/stdc++.h> typedef long long ll; #define pb push_back #define mod 1000000007ll const ll maxn = 9e18; using namespace std; void solve() { int k; cin >> k; ll num = 7 % k, i = 0; map<int, int> m; while (1) { m[num]++; if (m[num] > 1) { cout << -1 << endl; return; } if ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22]]
1
161
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; map<int, int> mp; int num = 7; int ans = 1; while (1) { mp[num]++; if (num == 0) { cout << ans << endl; return 0; } if (mp[num] > 1) { cout << -1 << endl; return 0; } num = (num * ...
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; map<int, int> mp; int num = 7 % k; int ans = 1; while (1) { mp[num]++; if (num == 0) { cout << ans << endl; return 0; } if (mp[num] > 1) { cout << -1 << endl; return 0; } num = (nu...
[["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 109], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22]]
1
101
def main(): K = int(input()) a = 7 % K d = 1 for k in range(1, K): if a == 0: return print(k) d *= 10 d %= K a += 7 * d a %= K print(-1) if __name__ == '__main__': main()
def main(): K = int(input()) a = 7 % K d = 1 for k in range(1, K+1): if a == 0: return print(k) d *= 10 d %= K a += 7 * d a %= K print(-1) if __name__ == '__main__': main()
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
70
K = int(input()) ans = -1 num7 = 7; for i in range(10000): if (num7 % K) == 0: ans = i+1 break else: num7 = num7*10+7 i+=1 print(ans)
K = int(input()) ans = -1 num7 = 7 for i in range(1000000): if (num7 % K) == 0: ans = i+1 break else: num7 = (num7*10+7)%K i+=1 print(ans)
[["-", 36, 36, 36, 36, 36, 36, 0, 656, 0, 35], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 25], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 109], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 22]]
5
55
def main(): k = int(input()) a = [1] a.append(7 % k) [a.append((a[i-1] * 10 + 7) % k) for i in range(2, k+1)] for i in range(k): if a[i] == 0: print(i) return print(-1) if __name__ == '__main__': main()
def main(): k = int(input()) a = [1] a.append(7 % k) [a.append((a[i-1] * 10 + 7) % k) for i in range(2, k+1)] for i in range(1, k+1): if a[i] == 0: print(i) return print(-1) if __name__ == '__main__': main()
[["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
94
k = int(input()) a = 0 for i in range(k): a = (a*10+7)/k if a == 0: print(i+1) quit() print(-1)
k = int(input()) a = 0 for i in range(k): a = (a*10+7)%k if a == 0: print(i+1) quit() print(-1)
[["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 85], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 109]]
5
49
k = int(input()) a = 7 for i in range(1, k): if a % k == 0: print(i) break a = (10 * a + 7) % k else: print(-1)
k = int(input()) a = 7 for i in range(1, k + 1): if a % k == 0: print(i) break a = (10 * a + 7) % k else: print(-1)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
51
k=int(input()) a=0 for i in range(k): a=(a*10+7)%k if a==0: print(i+1) exit()
k=int(input()) a=0 for i in range(k): a=(a*10+7)%k if a==0: print(i+1) exit() print(-1)
[["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 652, 3, 4, 0, 664, 17, 33], ["+", 0, 1, 0, 652, 3, 4, 0, 664, 28, 612], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]]
5
44