problem_id stringlengths 6 6 | language stringclasses 2
values | original_status stringclasses 3
values | original_src stringlengths 19 243k | changed_src stringlengths 19 243k | change stringclasses 3
values | i1 int64 0 8.44k | i2 int64 0 8.44k | j1 int64 0 8.44k | j2 int64 0 8.44k | error stringclasses 270
values | stderr stringlengths 0 226k |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
constexpr lint inf = 1LL << 60;
constexpr lint mod = 1000000007;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int k;
cin >> k;
if (k % 2 == 0) {
cout << -1 << "\n";
return 0;
}
lint res = 7 % k;
lint ret = 1;
... | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
constexpr lint inf = 1LL << 60;
constexpr lint mod = 1000000007;
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int k;
cin >> k;
if (k % 2 == 0) {
cout << -1 << "\n";
return 0;
}
lint res = 7 % k;
lint ret = 1;
... | insert | 20 | 20 | 20 | 24 | TLE | |
p02596 | C++ | Time Limit Exceeded | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for (ll i = 0; i < ll(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i < ll(b); i++)
#define FORD(i, a, b) for (ll i = a; i > ll(b); i--)
#define ALL(x) x.b... | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for (ll i = 0; i < ll(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i < ll(b); i++)
#define FORD(i, a, b) for (ll i = a; i > ll(b); i--)
#define ALL(x) x.b... | replace | 29 | 32 | 29 | 33 | TLE | |
p02596 | Python | Time Limit Exceeded | K = int(input())
if K % 2 == 0:
print(-1)
else:
r = 0
rem = 7
while True:
r += 1
rem = rem % K
if rem == 0:
break
rem = (rem * 10) + 7
print(r)
| K = int(input())
if K % 2 == 0:
print(-1)
else:
r = 0
rem = 7
while True:
r += 1
rem = rem % K
if rem == 0:
break
if r > K:
r = -1
break
rem = (rem * 10) + 7
print(r)
| insert | 11 | 11 | 11 | 14 | TLE | |
p02596 | Python | Time Limit Exceeded | K = int(input())
count = 1
check = 7
if K % 2 == 0 or K % 5 == 0:
print(-1)
else:
while True:
if check % K == 0:
print(count)
break
else:
count += 1
check = check * 10 + 7
| K = int(input())
count = 1
check = 7
if K % 2 == 0 or K % 5 == 0:
print(-1)
else:
while True:
if check % K == 0:
print(count)
break
else:
count += 1
check = (check * 10 + 7) % K
| replace | 13 | 14 | 13 | 14 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
long long k;
cin >> k;
if (k % 2 == 0) {
cout << -1 << endl;
return 0;
}
int ans(7 % k);
int cur(7 % k);
int res(1);
while (ans) {
cur = cur * 10 % k;
ans = (ans + cur) % k;
res++;
}
cout << res << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
long long k;
cin >> k;
if (k % 2 == 0 || k % 5 == 0) {
cout << -1 << endl;
return 0;
}
int ans(7 % k);
int cur(7 % k);
int res(1);
while (ans) {
cur = cur * 10 % k;
ans = (ans + cur) % k;
res++;
}
cout << res << endl;
... | replace | 6 | 7 | 6 | 7 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iomanip> //setprecision()
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using ll = long long;
using namespace std;
double Mcos(double k) { return cos(k * atan(1.0) * 4 / 180); }
void monmo() {}
int main() {
int... | #include <algorithm>
#include <cmath>
#include <iomanip> //setprecision()
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
using ll = long long;
using namespace std;
double Mcos(double k) { return cos(k * atan(1.0) * 4 / 180); }
void monmo() {}
int main() {
int... | insert | 33 | 33 | 33 | 38 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define arr(n) array<int, n>
#define INF 1e9
typedef long long ll;
typedef pair<int, int> pii;
int main() {
ll K;
cin >> K;
ll x = 0;
rep(i, 300000000) {
x = (x * 10 + 7) % K;
if (x == 0) {
cout << (i + 1)... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define arr(n) array<int, n>
#define INF 1e9
typedef long long ll;
typedef pair<int, int> pii;
int main() {
ll K;
cin >> K;
ll x = 0;
rep(i, 30000000) {
x = (x * 10 + 7) % K;
if (x == 0) {
cout << (i + 1) ... | replace | 12 | 13 | 12 | 13 | TLE | |
p02596 | Python | Time Limit Exceeded | # coding: utf-8
k = int(input())
kx = k
if k % 2 == 1:
while True:
num = list(str(kx))
if all(kx == "7" for kx in num):
print(len(str(kx)))
break
kx = kx + k
else:
print("-1")
| # coding: utf-8
k = int(input())
ans = -1
x = 7
for i in range(k):
if x % k == 0:
ans = i + 1
break
x = (10 * x + 7) % k
print(ans)
| replace | 2 | 12 | 2 | 11 | TLE | |
p02596 | Python | Time Limit Exceeded | k = int(input())
if k % 2 == 0:
print(-1)
else:
ans = 1
num = 7 % k
temp = 7 % k
while True:
if num % k == 0:
print(ans)
break
else:
ans += 1
temp = temp * 10 % k
num += temp % k
num %= k
| k = int(input())
if k % 2 == 0 or k % 5 == 0:
print(-1)
else:
ans = 1
num = 7 % k
temp = 7 % k
while True:
if num % k == 0:
print(ans)
break
else:
ans += 1
temp = temp * 10 % k
num += temp % k
num %= k
| replace | 2 | 3 | 2 | 3 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main() {
int k;
cin >> k;
ll val = 7;
int count = 0;
bool temp = true;
if (k % 2 == 0) {
cout << -1 << endl;
} else {
while (true) {
if (val % k == 0) {
count++;
break;
} else if (count > k) {
... | #include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main() {
int k;
cin >> k;
ll val = 7;
int count = 0;
bool temp = true;
if (k % 2 == 0) {
cout << -1 << endl;
} else {
while (true) {
if (val % k == 0) {
count++;
break;
} else if (count > k) {
... | insert | 19 | 19 | 19 | 20 | TLE | |
p02596 | Python | Time Limit Exceeded | k = int(input())
if k % 2 == 0 or k % 5 == 0:
print(-1)
else:
ans = 1
num = 7
while True:
if int(num) % k == 0:
print(ans)
break
else:
ans += 1
num += 7 * pow(10, ans - 1, k)
num %= k
| k = int(input())
if k % 2 == 0 or k % 5 == 0:
print(-1)
else:
ans = 1
num = 7
while True:
if num % k == 0:
print(ans)
break
else:
ans += 1
num += 7 * pow(10, ans - 1, k)
num %= k
| replace | 8 | 9 | 8 | 9 | TLE | |
p02596 | Python | Time Limit Exceeded | #!/usr/bin/env python3
def main():
K = int(input())
if K % 7 == 0:
L = 9 * K / 7
else:
L = 9 * K
if L == 2 or L == 5:
ans = -1
else:
i = 1
tmp = 10
while True:
tmp %= L
if tmp == 1:
ans = i
brea... | #!/usr/bin/env python3
def main():
K = int(input())
if K % 7 == 0:
L = 9 * K / 7
else:
L = 9 * K
if L % 2 == 0 or L % 5 == 0:
ans = -1
else:
i = 1
tmp = 10
while True:
tmp %= L
if tmp == 1:
ans = i
... | replace | 9 | 10 | 9 | 10 | TLE | |
p02596 | Python | Time Limit Exceeded | K = int(input())
ans = 1
a = 7
i = K
while K > 0:
m = a % K
if m == 0:
print(ans)
break
else:
ans += 1
a = m * 10 + 7
i -= 1
if m != 0:
print(-1)
| K = int(input())
ans = 1
a = 7
i = K
while i > 0:
m = a % K
if m == 0:
print(ans)
break
else:
ans += 1
a = m * 10 + 7
i -= 1
if m != 0:
print(-1)
| replace | 5 | 6 | 5 | 6 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int K;
cin >> K;
int remainder = 0;
int digit = 0;
while (true) {
digit++;
int i = (10 * remainder + 7) % K;
if (i == remainder)
break;
remainder = i;
if (remainder == 0)
break;
}
if (remainder == 0)
cout << di... | #include <bits/stdc++.h>
using namespace std;
int main() {
int K;
cin >> K;
int remainder = 0;
int digit = 0;
while (digit < 1000000) {
digit++;
int i = (10 * remainder + 7) % K;
if (i == remainder)
break;
remainder = i;
if (remainder == 0)
break;
}
if (remainder == 0)
... | replace | 8 | 9 | 8 | 9 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int n, sol, usu;
int main() {
ios::sync_with_stdio(false);
cin >> n;
if (n % 2 == 0) {
cout << -1;
return 0;
}
sol = 1;
usu = 7;
while (true) {
if (usu % n == 0) {
cout << sol;
return 0;
}
usu = usu % n;
usu = usu * 10... | #include <bits/stdc++.h>
using namespace std;
int n, sol, usu;
int main() {
ios::sync_with_stdio(false);
cin >> n;
if (n % 2 == 0) {
cout << -1;
return 0;
}
sol = 1;
usu = 7;
while (true) {
if (usu % n == 0) {
cout << sol;
return 0;
}
usu = usu % n;
usu = usu * 10... | insert | 27 | 27 | 27 | 31 | TLE | |
p02596 | Python | Time Limit Exceeded | from sys import stdin
input = stdin.buffer.readline
k = int(input())
t, c = 7, 1
while t % k:
t = t * 10 + 7
c += 1
print(c)
| from sys import stdin
input = stdin.buffer.readline
k = int(input())
t = 7
for i in range(1, k + 1):
if not t % k:
print(i)
exit()
t = (t * 10 + 7) % k
print(-1)
| replace | 4 | 9 | 4 | 11 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;
int main() {
int K, X = 7, count = 1;
cin >> K;
int N = X % K;
if (K % 2 == 0) {
cout << -1 << endl;
return 0;
}
while (N != 0) {
N = N * 10 + 7;
N %= K;
count++;
}
cout << count <<... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;
int main() {
int K, X = 7, count = 1;
cin >> K;
int N = X % K;
if (K % 2 == 0 || K % 5 == 0) {
cout << -1 << endl;
return 0;
}
while (N != 0) {
N = N * 10 + 7;
N %= K;
count++;
}
co... | replace | 9 | 10 | 9 | 10 | TLE | |
p02596 | C++ | Time Limit Exceeded | #pragma region
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef ... | #pragma region
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef ... | replace | 96 | 97 | 96 | 97 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll k;
cin >> k;
ll a = 7;
ll ans = 1;
if (k % 2 == 0) {
cout << -1 << endl;
return 0;
}
while (1) {
if (a % k == 0) {
cout << ans << endl;
return 0;
}
a = (a * 10 + 7) % k;
ans++;
}
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll k;
cin >> k;
ll a = 7;
ll ans = 1;
if (k % 2 == 0) {
cout << -1 << endl;
return 0;
}
while (1) {
if (a % k == 0) {
cout << ans << endl;
return 0;
}
if (ans > k) {
cout << -1 << endl;
... | insert | 18 | 18 | 18 | 22 | TLE | |
p02596 | C++ | Runtime Error | #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... | replace | 25 | 26 | 25 | 26 | 0 | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
using vec = vector<int>;
using mat = vector<vector<int>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"
constexpr int MOD = 1000000007;
const int INF = 1 << 30;
in... | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
using vec = vector<int>;
using mat = vector<vector<int>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"
constexpr int MOD = 1000000007;
const int INF = 1 << 30;
in... | insert | 32 | 32 | 32 | 36 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define pob pop_back
#define ff first
#define ss second
#define endl "\n"
#define all(a) a.begin(), a.end()
#define debug(x) cout << x << endl;
#define int long long
#define ordered_set ... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define pob pop_back
#define ff first
#define ss second
#define endl "\n"
#define all(a) a.begin(), a.end()
#define debug(x) cout << x << endl;
#define int long long
#define ordered_set ... | replace | 32 | 33 | 32 | 33 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
int main() {
ll n;
cin >> n;
if (n % 2 == 0) {
cou... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
int main() {
ll n;
cin >> n;
if (n % 2 == 0 || n % 5 =... | replace | 17 | 18 | 17 | 18 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<pll> vpl;
typedef vector<vll> vvll;
#define ALL(a) a.begin(), a.end()
#define SZ(a)... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pdd;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<pll> vpl;
typedef vector<vll> vvll;
#define ALL(a) a.begin(), a.end()
#define SZ(a)... | replace | 59 | 60 | 59 | 60 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
using namespace std;
long long power(long long x, unsigned long long y, long long p) {
long long res = 1;
x = x % p; // Update x if it is more than or
// equal to p
if (x == 0)
return 0; // In case x is divisible... | #include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
using namespace std;
long long power(long long x, unsigned long long y, long long p) {
long long res = 1;
x = x % p; // Update x if it is more than or
// equal to p
if (x == 0)
return 0; // In case x is divisible... | replace | 42 | 43 | 42 | 43 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll k;
cin >> k;
if (k % 2 == 0) {
cout << -1 << endl;
return 0;
}
ll ans = 0;
ll now = 7;
while (now % k != 0) {
now *= 10;
now += 7;
now %= k;
ans++;
}
cout << ans + 1 << endl;
}
| #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll k;
cin >> k;
if (k % 2 == 0 || k % 5 == 0) {
cout << -1 << endl;
return 0;
}
ll ans = 0;
ll now = 7;
while (now % k != 0) {
now *= 10;
now += 7;
now %= k;
ans++;
}
cout << ans + 1 << endl;
}
| replace | 7 | 8 | 7 | 8 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(), x.end()
#define rep(i, j, n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 100... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(), x.end()
#define rep(i, j, n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 100... | replace | 47 | 49 | 47 | 49 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll inf = 1000000000000000000, mod = 1000000007, BS, k;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
ll n;
cin >> n;
if (n ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll inf = 1000000000000000000, mod = 1000000007, BS, k;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
ll n;
cin >> n;
if (n ... | insert | 14 | 14 | 14 | 18 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << ": " << (x) << endl
#define INF (int)1e9
#define EPS (double)1e-9
#define MOD ((int)1e9 + 7)
using namespace std;
typedef long long llong;
typedef vector<int> vi;
typedef vector<... | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << ": " << (x) << endl
#define INF (int)1e9
#define EPS (double)1e-9
#define MOD ((int)1e9 + 7)
using namespace std;
typedef long long llong;
typedef vector<int> vi;
typedef vector<... | replace | 27 | 28 | 27 | 28 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
inline int read(void) {
int num = 0, f = 1;
char ch;
while (!isdigit(ch = getchar()))
if (ch == '-')
f = -1;
while (isdigit(ch))
num = num * 10 + ch - '0', ch = getchar();
return num * f;
}
int main() {
int k = read(), n = 0, cnt = 0;
if (!(k % 2... | #include <bits/stdc++.h>
using namespace std;
inline int read(void) {
int num = 0, f = 1;
char ch;
while (!isdigit(ch = getchar()))
if (ch == '-')
f = -1;
while (isdigit(ch))
num = num * 10 + ch - '0', ch = getchar();
return num * f;
}
int main() {
int k = read(), n = 0, cnt = 0;
if (!(k % 2... | insert | 25 | 25 | 25 | 29 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int k;
int main() {
cin >> k;
if (!(k & 1)) {
cout << -1 << endl;
return 0;
}
if (!(k % 7))
k /= 7;
int a = 1, b = 1, n = 1;
while (a % k) {
++n;
b = b * 10 % k;
a = (a + b) % k;
}
cout << n << endl;
}
| #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int k;
int main() {
cin >> k;
if (!(k & 1) || !(k % 5)) {
cout << -1 << endl;
return 0;
}
if (!(k % 7))
k /= 7;
int a = 1, b = 1, n = 1;
while (a % k) {
++n;
b = b * 10 % k;
a = (a + b) % k;
}
cout << n << endl... | replace | 8 | 9 | 8 | 9 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll k;
cin >> k;
if (k % 2 == 0) {
cout << "-1" << endl;
return 0;
}
if (k % 7 == 0) {
k = k / 7;
}
while (k % 10 == 0) {
k = k / 10;
}
ll ans = 0;
bool ok = true;
ll tot = 1;
while (ok) {
if (to... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ll k;
cin >> k;
if (k % 2 == 0) {
cout << "-1" << endl;
return 0;
}
if (k % 7 == 0) {
k = k / 7;
}
while (k % 10 == 0) {
k = k / 10;
}
ll ans = 0;
bool ok = true;
ll tot = 1;
while (ok) {
if (an... | insert | 21 | 21 | 21 | 25 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include "bits/stdc++.h"
using namespace std;
void Main() {
int K;
cin >> K;
if (7 % K == 0) {
cout << 1 << endl;
return;
}
int ans = -1;
set<int> reminder;
reminder.insert(7 % K);
int n7 = 7;
int pow10 = 10;
int counter = 1;
while (true) {
++counter;
n7 += pow10 * 7;
n7 %=... | #include "bits/stdc++.h"
using namespace std;
void Main() {
int K;
cin >> K;
if (7 % K == 0) {
cout << 1 << endl;
return;
}
int ans = -1;
set<int> reminder;
reminder.insert(7 % K);
int n7 = 7;
int pow10 = 10;
int counter = 1;
while (true) {
++counter;
n7 += pow10 * 7;
n7 %=... | insert | 31 | 31 | 31 | 32 | TLE | |
p02596 | C++ | Time Limit Exceeded | #define LOCAL
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <ran... | #define LOCAL
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <ran... | replace | 146 | 147 | 146 | 147 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define fastio() ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define ll long long
#define mk make_pair
#define pb push_back
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
void go() {
int k;
cin >> k;
if ... | #include <bits/stdc++.h>
using namespace std;
#define fastio() ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define ll long long
#define mk make_pair
#define pb push_back
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
void go() {
int k;
cin >> k;
if ... | replace | 16 | 17 | 16 | 17 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vl> vvl;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<pii> vpii;
t... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vl> vvl;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<pii> vpii;
t... | insert | 46 | 46 | 46 | 47 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
int main() {
ll k;
cin >> k;
if (k % 2 == 0) {
cout << "-1" << endl;
return 0;
}
ll res = 1;
ll x = 7;
while (true) {
x %= k;
if (x == 0) {
cout << res << endl;
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
int main() {
ll k;
cin >> k;
if (k % 2 == 0) {
cout << "-1" << endl;
return 0;
}
ll res = 1;
ll x = 7;
while (true) {
if (res == 2000000) {
cout << "-1" << endl;
b... | insert | 16 | 16 | 16 | 20 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#ifdef _DEBUG
#define dout cout
#define debug() if (true)
#define dvout(v) vout(v)
#else
#define dout \
if (false) \
cout
#define debug()... | #include <bits/stdc++.h>
using namespace std;
#ifdef _DEBUG
#define dout cout
#define debug() if (true)
#define dvout(v) vout(v)
#else
#define dout \
if (false) \
cout
#define debug()... | replace | 49 | 50 | 49 | 50 | TLE | |
p02596 | C++ | Runtime Error | #include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
ll k;
ll a = 7;
for (int i = 0; i <= k; ... | #include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
ll k;
cin >> k;
ll a = 7;
for (int i =... | insert | 19 | 19 | 19 | 20 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int sum[500005];
int vis[500005];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long n, i, j = 0;
cin >> n;
if (n % 2 == 0) {
cout << -1 << endl;
} else {
long long p = 7 % n;
j++;
while (p != 0) {
p = (p * 10 + 7) % n... | #include <bits/stdc++.h>
using namespace std;
int sum[500005];
int vis[500005];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long n, i, j = 0;
cin >> n;
if (n % 2 == 0 || n % 5 == 0) {
cout << -1 << endl;
} else {
long long p = 7 % n;
j++;
while (p != 0) {
p = (p... | replace | 10 | 11 | 10 | 11 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <iostream>
using namespace std;
int main() {
int k;
cin >> k;
if (k % 2 == 0)
return cout << -1, 0;
string s = "7";
long long cur_power = 1, cur = 7;
while (cur % k != 0) {
cur_power = cur_power * 10 % k;
cur = cur + 7 * cur_power % k;
cur %= k;
s += '7';
}
cout << s.size()... | #include <iostream>
using namespace std;
int main() {
int k;
cin >> k;
if (k % 2 == 0)
return cout << -1, 0;
string s = "7";
long long cur_power = 1, cur = 7;
while (cur % k != 0) {
cur_power = cur_power * 10 % k;
cur = cur + 7 * cur_power % k;
cur %= k;
s += '7';
if (s.size() > k)
... | insert | 15 | 15 | 15 | 17 | TLE | |
p02596 | C++ | Time Limit Exceeded |
#include <bits/stdc++.h>
using namespace std;
/*helpfull*/
using vl = vector<long long>;
using vpl = vector<pair<long long, long long>>;
using vs = vector<string>;
using pl = pair<long long, long long>;
using ll = long long int;
using vb = vector<bool>;
struct hash_pair {
template <class T1, class T2> size_t oper... |
#include <bits/stdc++.h>
using namespace std;
/*helpfull*/
using vl = vector<long long>;
using vpl = vector<pair<long long, long long>>;
using vs = vector<string>;
using pl = pair<long long, long long>;
using ll = long long int;
using vb = vector<bool>;
struct hash_pair {
template <class T1, class T2> size_t oper... | replace | 83 | 84 | 83 | 84 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
ll k;
ll count = 0;
ll amount = 0;
ll ans = -1;
cin >> k;
if (k % 2 == 0) {
cout << ans << endl;
} else {
for (;;) {
amount *= 10;
amount += 7;
c... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
ll k;
ll count = 0;
ll amount = 0;
ll ans = -1;
cin >> k;
if (k % 2 == 0) {
cout << ans << endl;
} else {
rep(i, 1e7) {
amount *= 10;
amount += 7;
... | replace | 14 | 15 | 14 | 15 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int k;
cin >> k;
if ((k % 2) == 0 || (k % 5) == 0)
cout << -1 << endl;
else if (k == 1)
cout << 1 << endl;
else {
if ((k % 7) == 0)
k /= 7;
vector<int> x(0);
x.push_back(1 % k);
while (1) {
int X = (10 * x.at(x.siz... | #include <bits/stdc++.h>
using namespace std;
int main() {
int k;
cin >> k;
if ((k % 2) == 0 || (k % 5) == 0)
cout << -1 << endl;
else if (k == 1 || k == 7)
cout << 1 << endl;
else {
if ((k % 7) == 0)
k /= 7;
vector<int> x(0);
x.push_back(1 % k);
while (1) {
int X = (10 * ... | replace | 8 | 9 | 8 | 9 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) \
; \
for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> sta... | #include <bits/stdc++.h>
#define rep(i, n) \
; \
for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> sta... | insert | 67 | 67 | 67 | 71 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long int n, k;
int count = 1;
cin >> n;
k = 7;
long long int sum = 7;
if (n % 2 == 0 || n == 5) {
cout << "-1\n";
return 0;
}
while (sum % n != 0) {
sum = sum + ((k % n) * (10... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long int n, k;
int count = 1;
cin >> n;
k = 7;
long long int sum = 7;
if (n % 2 == 0 || n % 5 == 0) {
cout << "-1\n";
return 0;
}
while (sum % n != 0) {
sum = sum + ((k % n) *... | replace | 10 | 11 | 10 | 11 | TLE | |
p02596 | C++ | Time Limit Exceeded | // author-Shivam gupta
#include <bits/stdc++.h>
using namespace std;
#define MEM(a, b) memset(a, (b), sizeof(a))
#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)
#define IN(A, B, C) assert(B <= A && A <= C)
#define MP make_pair
#define FOR(i, a) for (int i = 0; i < a; i++)
#define FOR1(i, j,... | // author-Shivam gupta
#include <bits/stdc++.h>
using namespace std;
#define MEM(a, b) memset(a, (b), sizeof(a))
#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)
#define IN(A, B, C) assert(B <= A && A <= C)
#define MP make_pair
#define FOR(i, a) for (int i = 0; i < a; i++)
#define FOR1(i, j,... | replace | 72 | 73 | 72 | 74 | TLE | |
p02596 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <cctype>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define ld long double
#define PRY cout << "YES\n"
#define PRN cout << "NO\n"
#define SETP(sp) fixed << setprecision(sp)
#define PB push_back
#define GO ... | #include <bits/stdc++.h>
#include <cctype>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define ld long double
#define PRY cout << "YES\n"
#define PRN cout << "NO\n"
#define SETP(sp) fixed << setprecision(sp)
#define PB push_back
#define GO ... | insert | 185 | 185 | 185 | 186 | 0 | |
p02596 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define ll long long
#define REP(i, n) for (int i = 0; i < n; i++)
#define PI 3.141592653589
#define MOD 1000000007
using namespace std;
template <typename T> T gcd(T a, T b) {... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define ll long long
#define REP(i, n) for (int i = 0; i < n; i++)
#define PI 3.141592653589
#define MOD 1000000007
using namespace std;
template <typename T> T gcd(T a, T b) {... | replace | 22 | 23 | 22 | 23 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <vector>
using ll = long long;
using namespace std;
int main() {
long a = 0;
long K;
cin >> K;
if (K % 7 == 0)
K /= 7;
if (K % 2 == 0) {
cout << -1;
exit(0);
}
long n = 1;
long r = 1 % K;
while (r != 0) {
r = (10 * r + 1) % K;
n +... | #include <algorithm>
#include <iostream>
#include <vector>
using ll = long long;
using namespace std;
int main() {
long a = 0;
long K;
cin >> K;
if (K % 7 == 0)
K /= 7;
if (K % 2 == 0 || K % 5 == 0) {
cout << -1;
exit(0);
}
long n = 1;
long r = 1 % K;
while (r != 0) {
r = (10 * r + 1... | replace | 13 | 14 | 13 | 14 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int k, L;
cin >> k;
if (k % 7 == 0)
k /= 7;
L = 9 * k;
if (L == 2 || L == 5) {
cout << -1 << '\n';
return 0;
}
int tmp = 10, cnt = 1;
while (1) {
if (tmp % L == 1) {
cout << cnt << '\n';
return 0;
}
tmp %= ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int k, L;
cin >> k;
if (k % 7 == 0)
k /= 7;
L = 9 * k;
if (L % 2 == 0 || L % 5 == 0) {
cout << -1 << '\n';
return 0;
}
int tmp = 10, cnt = 1;
while (1) {
if (tmp % L == 1) {
cout << cnt << '\n';
return 0;
}
... | replace | 10 | 11 | 10 | 11 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main(void) {
long long k;
cin >> k;
long long tmp = 7 % k;
set<int> s;
s.insert(7);
if (tmp == 0) {
cout << 1 << endl;
return 0;
}
s.insert(tmp);
for (long long i = 2;; i++) {
tmp = ((tmp * 10) % k + 7 % k) % k;
if (tmp == 0) {
co... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
long long k;
cin >> k;
long long tmp = 7 % k;
set<int> s;
s.insert(7);
if (tmp == 0) {
cout << 1 << endl;
return 0;
}
s.insert(tmp);
for (long long i = 2;; i++) {
tmp = ((tmp * 10) % k + 7 % k) % k;
if (tmp == 0) {
co... | insert | 24 | 24 | 24 | 25 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define inf LLONG_MAX >> 2
#define MAX 1000000
#define mod 1000000007
#define pb push_back
#define f(i, a, n, x) for ((i) = (a); (i) < (n); (i) += (x))
#define fd(i, a, n, x) for ((i) = (a); (i) >= (n); (i) -= (x))
#define fi first
#define se seco... | #include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define inf LLONG_MAX >> 2
#define MAX 1000000
#define mod 1000000007
#define pb push_back
#define f(i, a, n, x) for ((i) = (a); (i) < (n); (i) += (x))
#define fd(i, a, n, x) for ((i) = (a); (i) >= (n); (i) -= (x))
#define fi first
#define se seco... | replace | 52 | 53 | 52 | 53 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
using ll = long long;
int main() {
int k;
cin >> k;
ll a = 7 % k;
ll b = 7;
if (a == 0) {
cout << 1 << endl;
return 0;
}
if (b % 2 == 0 || b % 5 == 0) {
cout << -1 << endl;
return 0;
}
for (int n = 2;; n++... | #include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
using ll = long long;
int main() {
int k;
cin >> k;
ll a = 7 % k;
ll b = 7;
if (a == 0) {
cout << 1 << endl;
return 0;
}
if (k % 2 == 0 || k % 5 == 0) {
cout << -1 << endl;
return 0;
}
for (int n = 2;; n++... | replace | 16 | 17 | 16 | 17 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ll n, x = 7, ans = 1;
cin >> n;
if ((n % 2) == 0) {
cout << "-1\n";
return 0;
}
while (true) {
if ((x % n) == 0) {
cout << ans << '\n';
return 0;
}
x *= 10;
x += 7;
x %= n;
ans++;
}
... | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main() {
ll n, x = 7, ans = 1;
cin >> n;
if ((n % 2) == 0) {
cout << "-1\n";
return 0;
}
while (true) {
if ((x % n) == 0) {
cout << ans << '\n';
return 0;
}
x *= 10;
x += 7;
x %= n;
ans++;
... | insert | 21 | 21 | 21 | 25 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
#define rep(A, B, C) for (A = B; A < C; ++A)
#define pii pair<int, int>
#define pll pair<ll, ll>
using namespace std;
/////////////////////////////////////////////////////
ll K;
ll i, j, k;
int main() {
scanf("%lld", &K);
if (K % 2 == 0) {
printf("-1\n");
... | #include <bits/stdc++.h>
#define ll long long
#define rep(A, B, C) for (A = B; A < C; ++A)
#define pii pair<int, int>
#define pll pair<ll, ll>
using namespace std;
/////////////////////////////////////////////////////
ll K;
ll i, j, k;
int main() {
scanf("%lld", &K);
if (K % 2 == 0 || K % 5 == 0) {
printf... | replace | 17 | 18 | 17 | 18 | TLE | |
p02596 | C++ | Time Limit Exceeded | #pragma GCC optimize(2)
#include <bits/stdc++.h>
namespace __temp_inbuilt {
int read(void) {
int res = 0, sign = 1;
char ch = std::getchar();
while (!std::isdigit(ch)) {
if (ch == '-')
sign = -1;
ch = std::getchar();
}
while (std::isdigit(ch))
res = res * 10 + ch - 48, ch = std::getchar();
... | #pragma GCC optimize(2)
#include <bits/stdc++.h>
namespace __temp_inbuilt {
int read(void) {
int res = 0, sign = 1;
char ch = std::getchar();
while (!std::isdigit(ch)) {
if (ch == '-')
sign = -1;
ch = std::getchar();
}
while (std::isdigit(ch))
res = res * 10 + ch - 48, ch = std::getchar();
... | replace | 66 | 67 | 66 | 67 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
int main() {
ll K, sev = 0, rep = 0;
cin >> K;
if (K % 2 == 0) {
cout << -1 << endl;
return 0;
}
while (sev <=... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
int main() {
ll K, sev = 0, rep = 0;
cin >> K;
if (K % 2 == 0) {
cout << -1 << endl;
return 0;
}
while (rep <=... | replace | 17 | 18 | 17 | 18 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define fo(i, n) for (i = 0; i < n; i++)
#define fo1(i, n) for (i = 1; i <= n; i++)
#define foab(i, a, b) for (i = a; i <= b; i++)
#define of(i, n) for... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define fo(i, n) for (i = 0; i < n; i++)
#define fo1(i, n) for (i = 1; i <= n; i++)
#define foab(i, a, b) for (i = a; i <= b; i++)
#define of(i, n) for... | insert | 112 | 112 | 112 | 116 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define ll long long
#define ls id << 1
#define rs id << 1 | 1
#define mem(array, value, size, type) \
memset(array, value, ((size) + 5) * sizeof(type))
#define memarray(array, value) memset(array, value, sizeof(array))
#define pb(x) push_back(x)
#defi... | #include <bits/stdc++.h>
#define ll long long
#define ls id << 1
#define rs id << 1 | 1
#define mem(array, value, size, type) \
memset(array, value, ((size) + 5) * sizeof(type))
#define memarray(array, value) memset(array, value, sizeof(array))
#define pb(x) push_back(x)
#defi... | replace | 37 | 38 | 37 | 38 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
template <typename T> long long modpow(const T n, const T p, const T mod);
template <typename T> long long modinv(const T n, const T mod);
template <typename T> bool chmax(T &a, const T &b);
template <typename T> bool chmin(T &a, const T &b);
long long ... | #include <bits/stdc++.h>
#include <math.h>
using namespace std;
template <typename T> long long modpow(const T n, const T p, const T mod);
template <typename T> long long modinv(const T n, const T mod);
template <typename T> bool chmax(T &a, const T &b);
template <typename T> bool chmin(T &a, const T &b);
long long ... | insert | 31 | 31 | 31 | 36 | TLE | |
p02596 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int K;
cin >> K;
if (K % 2 == 0) {
cout << -1 << "\n";
return 0;
}
int now = 0;
for... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int K;
cin >> K;
if (K % 2 == 0) {
cout << -1 << "\n";
return 0;
}
int now = 0;
for... | replace | 23 | 24 | 23 | 24 | 0 | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define repd(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) repd(i, 0, n)
#define all(x) (x).begin(), (x).end()
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chma... | #include <bits/stdc++.h>
using namespace std;
#define repd(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) repd(i, 0, n)
#define all(x) (x).begin(), (x).end()
template <class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T> inline bool chma... | insert | 40 | 40 | 40 | 44 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define vl vector<ll>
#define vi vector<int>
#define vvl vector<vl>
#define vvi vector<vi>
#define pb push_back
#define P pair<ll, ll>
#define mp make_pair
#define F first
#define S second
#define rep(i, n) for (ll i = 0; i <... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define vl vector<ll>
#define vi vector<int>
#define vvl vector<vl>
#define vvi vector<vi>
#define pb push_back
#define P pair<ll, ll>
#define mp make_pair
#define F first
#define S second
#define rep(i, n) for (ll i = 0; i <... | insert | 57 | 57 | 57 | 61 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
long long modAdd(long long a, long long b, long long mod) {
return ((a % mod) + (b % mod)) % mod;
}
long long modSub(long long a, long long b, long long mod) {
long long c = ((a % mod) - (b % mod)) % ... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
long long modAdd(long long a, long long b, long long mod) {
return ((a % mod) + (b % mod)) % mod;
}
long long modSub(long long a, long long b, long long mod) {
long long c = ((a % mod) - (b % mod)) % ... | insert | 60 | 60 | 60 | 62 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define sws \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define ll long ... | #include <bits/stdc++.h>
using namespace std;
#define sws \
ios_base::sync_with_stdio(0); \
cin.tie(0); \
cout.tie(0)
#define ll long ... | replace | 43 | 44 | 43 | 44 | TLE | |
p02596 | C++ | Time Limit Exceeded | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int K, amari = 0, ba;
std::cin >> K;
if (K % 2 == 0) {
cout << -1;
} else {
long long int i = 0;
while (1) {
i++;
ba = amari;
amari = (amari * 10 + 7) % K;... | #define rep(i, n) for (int i = 0; i < (int)(n); i++)
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int K, amari = 0, ba;
std::cin >> K;
if (K % 2 == 0) {
cout << -1;
} else {
long long int i = 0;
while (1) {
i++;
ba = amari;
amari = (amari * 10 + 7) % K;... | insert | 27 | 27 | 27 | 31 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <stack>
#include <string>
... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <stack>
#include <string>
... | replace | 157 | 158 | 157 | 158 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define MOD 1e9 + 7;
using namespace std;
using ll = long long;
int main() {
ll k, ans = 1;
cin >> k;
int seven = 7;
if (k % 2 == 0) {
cout << "-1";
return 0;
}
while (seven % k != 0) {
seven = (seven * 10 + 7) % k;
... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define MOD 1e9 + 7;
using namespace std;
using ll = long long;
int main() {
ll k, ans = 1;
cin >> k;
int seven = 7;
if (k % 2 == 0) {
cout << "-1";
return 0;
}
while (seven % k != 0) {
seven = (seven * 10 + 7) % k;
... | insert | 17 | 17 | 17 | 21 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i <= n; i++)
typedef long long ll;
int main() {
ll k;
cin >> k;
if (k % 2 == 0) {
cout << -1 << endl;
return 0;
}
ll seven = 7;
ll count = 1;
while (true) {
if (seven ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, n) for (int i = 1; i <= n; i++)
typedef long long ll;
int main() {
ll k;
cin >> k;
if (k % 2 == 0) {
cout << -1 << endl;
return 0;
}
ll seven = 7;
ll count = 1;
while (true) {
if (seven ... | insert | 24 | 24 | 24 | 28 | TLE | |
p02596 | C++ | Runtime Error | #include <bits/stdc++.h>
#define sz 100002
#define pb push_back
#define ff first
#define ss second
#define ll long long
#define P push
#define PQ priority_queue<double, vector<double>, greater<double>> q
#define VEC(n) \
ll int x; ... | #include <bits/stdc++.h>
#define sz 100002
#define pb push_back
#define ff first
#define ss second
#define ll long long
#define P push
#define PQ priority_queue<double, vector<double>, greater<double>> q
#define VEC(n) \
ll int x; ... | replace | 53 | 54 | 53 | 54 | 0 | |
p02596 | C++ | Time Limit Exceeded | #include <algorithm>
#include <climits> // FOO_MAX, FOO_MIN
#include <cmath>
#include <cstdlib> // abs(int)
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
#define roundup(n, d) (((n) + ((d)-1)) / (d))
#define assign_max(into, compared)... | #include <algorithm>
#include <climits> // FOO_MAX, FOO_MIN
#include <cmath>
#include <cstdlib> // abs(int)
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <string>
#include <vector>
using namespace std;
#define roundup(n, d) (((n) + ((d)-1)) / (d))
#define assign_max(into, compared)... | replace | 36 | 37 | 36 | 37 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include ... | #include <algorithm>
#include <assert.h>
#include <bitset>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include ... | replace | 47 | 48 | 47 | 48 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
// const int N = ;
int k;
int main() {
cin >> k;
if (k % 2 == 0)
puts("-1");
else {
int x = 7, ans = 1;
x %= k;
while (x != 0) {
x = (x * 10 + 7) % k;
ans++;
}
cout << ans;
}
return 0;
} | #include <bits/stdc++.h>
using namespace std;
// const int N = ;
int k;
int main() {
cin >> k;
if (k % 2 == 0 || k % 5 == 0)
puts("-1");
else {
int x = 7, ans = 1;
x %= k;
while (x != 0) {
x = (x * 10 + 7) % k;
ans++;
}
cout << ans;
}
return 0;
} | replace | 6 | 7 | 6 | 7 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
unsigned int K;
cin >> K;
if (K % 2 == 0 || K % 5 == 0) {
cout << -1 << endl;
return 0;
}
unsigned int i = 0;
unsigned int ai = 0;
while (true) {
i++;
ai = ai * 10 + 7;
if (ai % K == 0) {
cout << i << endl;
retur... | #include <bits/stdc++.h>
using namespace std;
int main() {
unsigned int K;
cin >> K;
if (K % 2 == 0 || K % 5 == 0) {
cout << -1 << endl;
return 0;
}
unsigned int i = 0;
unsigned int ai = 0;
while (true) {
i++;
ai = (ai * 10 + 7) % K;
if (ai == 0) {
cout << i << endl;
ret... | replace | 16 | 18 | 16 | 18 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll k;
cin >> k;
ll tmpk = k, rank = 0;
while (tmpk) {
tmpk /= 10;
rank++;
}
ll ans = 1;
if (k % 2 == 0 && k / 2 > 0) {
ans = -1;
} else {
ll sevens = 7;
for (int i = 1; i < rank; i++) {
sevens ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll k;
cin >> k;
ll tmpk = k, rank = 0;
while (tmpk) {
tmpk /= 10;
rank++;
}
ll ans = 1;
if (k % 2 == 0 && k / 2 > 0) {
ans = -1;
} else {
ll sevens = 7;
for (int i = 1; i < rank; i++) {
sevens ... | replace | 33 | 34 | 33 | 34 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <algorithm>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
// #include <stdio.h>
// #include <stack>
// #include <queue>
// #include <cstdio>
#include <cmath>
#include <fstream>
#include <iterator>
#include <map>
// #include <list>
#include <iomanip>
// #include <stdlib.h>
// #inclu... | #include <algorithm>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
// #include <stdio.h>
// #include <stack>
// #include <queue>
// #include <cstdio>
#include <cmath>
#include <fstream>
#include <iterator>
#include <map>
// #include <list>
#include <iomanip>
// #include <stdlib.h>
// #inclu... | insert | 153 | 153 | 153 | 157 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define P pair<ll, ll>
#define Graph vector<vector<P>>
#define fi first
#define se second
constexpr ll mod = 1000000007;
constexpr ll INF = (1ll << 60);
constexpr double pi = 3.14159265358979323846;
template ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define P pair<ll, ll>
#define Graph vector<vector<P>>
#define fi first
#define se second
constexpr ll mod = 1000000007;
constexpr ll INF = (1ll << 60);
constexpr double pi = 3.14159265358979323846;
template ... | insert | 38 | 38 | 38 | 42 | TLE | |
p02596 | C++ | Time Limit Exceeded | #pragma GCC optimize("O3")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int long long
#define pb push_back
#define pf pus... | #pragma GCC optimize("O3")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define int long long
#define pb push_back
#define pf pus... | replace | 53 | 54 | 53 | 54 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(a) (a).begin(), (a).end()
#define overload4(_1, _2, _3, _4, 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,... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(a) (a).begin(), (a).end()
#define overload4(_1, _2, _3, _4, 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,... | insert | 31 | 31 | 31 | 35 | TLE | |
p02596 | C++ | Time Limit Exceeded | /*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
*$* WRITER:kakitamasziru/OxOmisosiru *$*
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=*/
#ifdef LOCAL_JUDGE
#define _GLIBCXX_DEBUG
#endif
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <cstdint> // int64_t, int*_t
#include <iomanip>
#include ... | /*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
*$* WRITER:kakitamasziru/OxOmisosiru *$*
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=*/
#ifdef LOCAL_JUDGE
#define _GLIBCXX_DEBUG
#endif
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <cstdint> // int64_t, int*_t
#include <iomanip>
#include ... | replace | 59 | 60 | 59 | 60 | TLE | |
p02596 | C++ | Time Limit Exceeded | // Patwari26
// #include template<t> as mine
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define endl '\n'
#define mii map<ll, ll>
#define pii pair<ll, ll>
#define vi vector<ll>
#define all(a) (a).begin(), (a).end()
#define x first
#define y second
#define sz(x) (ll) x.size(... | // Patwari26
// #include template<t> as mine
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define endl '\n'
#define mii map<ll, ll>
#define pii pair<ll, ll>
#define vi vector<ll>
#define all(a) (a).begin(), (a).end()
#define x first
#define y second
#define sz(x) (ll) x.size(... | replace | 31 | 32 | 31 | 32 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
//////////////////
#ifdef DEBUG
#include "debug.h"
#define dump(...) \
DUMPOUT << " " << string(#__VA_ARGS__) << ": " \
<< "[" << to_string(__LINE__) << ":" << __FUNCTIO... | #include <bits/stdc++.h>
using namespace std;
//////////////////
#ifdef DEBUG
#include "debug.h"
#define dump(...) \
DUMPOUT << " " << string(#__VA_ARGS__) << ": " \
<< "[" << to_string(__LINE__) << ":" << __FUNCTIO... | insert | 83 | 83 | 83 | 87 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
long long k;
cin >> k;
if (k % 2 == 0 || k % 5 == 0) {
cout << -1 << '\n';
}
if (k % 7 == 0) {
k /= 7;
}
k *= 9;
if (k == 9) {
cout << 1 << '\n';
return 0;
}
long long cnt = 1;
long long hehe... | #include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
long long k;
cin >> k;
if (k % 2 == 0 || k % 5 == 0) {
cout << -1 << '\n';
return 0;
}
if (k % 7 == 0) {
k /= 7;
}
k *= 9;
if (k == 9) {
cout << 1 << '\n';
return 0;
}
long long cnt = 1;
... | insert | 9 | 9 | 9 | 10 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define MOD 1000000007ll
#define pb push_back
#define vl vector<ll>
#define pll pair<ll, ll>
#define mp make_pair
using namespace std;
#define pi (long double)3.14159265358979323846
#define fast ... | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define MOD 1000000007ll
#define pb push_back
#define vl vector<ll>
#define pll pair<ll, ll>
#define mp make_pair
using namespace std;
#define pi (long double)3.14159265358979323846
#define fast ... | insert | 51 | 51 | 51 | 55 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repbit(bit, n) for (int bit = 0; bit < (1 << n); bit++)
using namespace std;
typedef long long ll;
const int INF = 1001001001;
// const ll INF = 1000000000000000000;
int main() {
int k;
cin >> k;
if (k % 2 == 0) {
cout << -1 <... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repbit(bit, n) for (int bit = 0; bit < (1 << n); bit++)
using namespace std;
typedef long long ll;
const int INF = 1001001001;
// const ll INF = 1000000000000000000;
int main() {
int k;
cin >> k;
if (k % 2 == 0 or k % 5 == 0) {
... | replace | 13 | 14 | 13 | 14 | TLE | |
p02596 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 5;
int dp[MAXN];
int main() {
int k;
cin >> k;
dp[1] = 7 % k;
if (dp[1] == 0)
return cout << 1 << "\n", 0;
for (int i = 2; i <= MAXN; i++) {
dp[i] = (dp[1] + (dp[i - 1] * (10 % k)) % k) % k;
if (dp[i] == 0)
return cout << i... | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 5;
int dp[MAXN];
int main() {
int k;
cin >> k;
dp[1] = 7 % k;
if (dp[1] == 0)
return cout << 1 << "\n", 0;
for (int i = 2; i < MAXN; i++) {
dp[i] = (dp[1] + (dp[i - 1] * (10 % k)) % k) % k;
if (dp[i] == 0)
return cout << i ... | replace | 10 | 11 | 10 | 11 | 0 | |
p02596 | C++ | Runtime Error | #include <iostream>
int main() {
int K;
std::cin >> K;
int m = 0;
for (int i = 0; i < K; i++) {
m = (m * 10 + 7 % K) % K;
if (m == 0) {
std::cout << i + 1 << std::endl;
exit(1);
}
}
std::cout << -1 << std::endl;
} | #include <iostream>
int main() {
int K;
std::cin >> K;
int m = 0;
for (int i = 0; i < K; i++) {
m = (m * 10 + 7 % K) % K;
if (m == 0) {
std::cout << i + 1 << std::endl;
exit(0);
}
}
std::cout << -1 << std::endl;
} | replace | 10 | 11 | 10 | 11 | 1 | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#include <cmath>
using ll = long long;
using namespace std;
stack<int> st;
queue<int> qu;
queue<pair<int, int>> qu2;
priority_queue<int> pq;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, n) for (int i = 1; i <= (int)(n); i++)
#define mins(x, y) x = min(x, y)
#define maxs(... | #include <bits/stdc++.h>
#include <cmath>
using ll = long long;
using namespace std;
stack<int> st;
queue<int> qu;
queue<pair<int, int>> qu2;
priority_queue<int> pq;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, n) for (int i = 1; i <= (int)(n); i++)
#define mins(x, y) x = min(x, y)
#define maxs(... | replace | 46 | 47 | 46 | 47 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define INF LONG_LONG_MAX
#define int long long
#define ar array
#define db double
#define pi 3.14159265358979323846
#define pow pw
int pw(int a, int b) {
int ans = 1;
while (b) {
if (b % 2)
ans *= a;
a *= a;
b /= 2;
}
return (ans);
}
signed main()... | #include <bits/stdc++.h>
using namespace std;
#define INF LONG_LONG_MAX
#define int long long
#define ar array
#define db double
#define pi 3.14159265358979323846
#define pow pw
int pw(int a, int b) {
int ans = 1;
while (b) {
if (b % 2)
ans *= a;
a *= a;
b /= 2;
}
return (ans);
}
signed main()... | insert | 28 | 28 | 28 | 32 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, m, n) for (int i = m; i < n; ++i)
#define FORR(i, m, n) for (int i = m; i >= n; --i)
#define ALL(v) (v).begin(), ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, m, n) for (int i = m; i < n; ++i)
#define FORR(i, m, n) for (int i = m; i >= n; --i)
#define ALL(v) (v).begin(), ... | replace | 33 | 34 | 33 | 34 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
long long k;
cin >> k;
if (k % 2 == 0) {
return cout << "-1\n", 0;
}
int cur = 7 % k;
int ans = 1;
while (cur != 0) {
cur = cur * 10 + 7;
cur %= k;
ans++;
}
cout << ans << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
long long k;
cin >> k;
if (k % 2 == 0 || k % 5 == 0) {
return cout << "-1\n", 0;
}
int cur = 7 % k;
int ans = 1;
while (cur != 0) {
cur = cur * 10 + 7;
cur %= k;
ans++;
}
cout << ans << endl;
}
| replace | 7 | 8 | 7 | 8 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int k;
cin >> k;
if (k % 2 == 0) {
cout << "-1";
return 0;
}
int p = 0, c = 0;
while (1 == 1) {
c++;
p = (p * 10 + 7) % k;
if (p == 0) {
break;
}
}
cout << c;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int k;
cin >> k;
if (k % 2 == 0) {
cout << "-1";
return 0;
}
if (k % 5 == 0) {
cout << "-1";
return 0;
}
int p = 0, c = 0;
while (1 == 1) {
c++;
p = (p * 10 + 7) % k;
if (p == 0) {
break;
}
}
cout << c;
... | insert | 6 | 6 | 6 | 10 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int K;
cin >> K;
int cnt = 0, now = 0;
auto start = chrono::system_clock::now();
while (++cnt) {
now = (now * 10 + 7) % K;
if (now == 0)
return cout << cnt << "\n", 0;
if (static_cast<double>(chrono::duration_cast<chrono::microsecon... | #include <bits/stdc++.h>
using namespace std;
int main() {
int K;
cin >> K;
int cnt = 0, now = 0;
auto start = chrono::system_clock::now();
while (++cnt) {
now = (now * 10 + 7) % K;
if (now == 0)
return cout << cnt << "\n", 0;
if (static_cast<double>(chrono::duration_cast<chrono::microsecon... | replace | 15 | 16 | 15 | 16 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
int main() {
int K;
cin >> K;
auto start = system_clock::now();
for (int cnt = 1, now = 0;
static_cast<double>(
duration_cast<milliseconds>(system_clock::now() - start).count()) <
1999;
cnt++) {
now =... | #include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
int main() {
int K;
cin >> K;
auto start = system_clock::now();
for (int cnt = 1, now = 0;
static_cast<double>(
duration_cast<milliseconds>(system_clock::now() - start).count()) <
1990;
cnt++) {
now =... | replace | 11 | 12 | 11 | 12 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll k;
ll num = 7;
cin >> k;
ll sum = 7LL % k;
ll fac = 10LL % k;
if (k % 2 != 0 && k != 5) {
ll cnt = 1;
while (sum % k) {
sum += (num % k * fac) % k;
num = (num % k * fac);
cnt++;
}
cout << cnt... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll k;
ll num = 7;
cin >> k;
ll sum = 7LL % k;
ll fac = 10LL % k;
ll cnt = 1;
while (sum % k && cnt <= 10000000) {
sum += (num % k * fac) % k;
num = num % k * fac;
cnt++;
}
if (sum % k == 0) {
cout << cnt <<... | replace | 9 | 16 | 9 | 16 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
int K;
cin >> K;
if ((K % 2 == 0) || (K % 5 == 0)) {
cout << -1 << endl;
} else {
if (K % 7 == 0) {
K /= 7;
}
int mod = 9 * K;
int x = 1 % 9 * K;
for (int i = 1;; i++) {
x = (x * (10 % mod)) % mod;
if (x == 1) ... | #include <bits/stdc++.h>
using namespace std;
int main() {
int K;
cin >> K;
if ((K % 2 == 0) || (K % 5 == 0)) {
cout << -1 << endl;
} else {
if (K % 7 == 0) {
K /= 7;
}
int mod = 9 * K;
int x = 1 % (9 * K);
for (int i = 1;; i++) {
x = (x * (10 % mod)) % mod;
if (x == 1... | replace | 13 | 14 | 13 | 14 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
long long MOD = 1000000007LL;
const double PI = 3.14159265358979323846;
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -21474... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
long long MOD = 1000000007LL;
const double PI = 3.14159265358979323846;
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -21474... | replace | 24 | 25 | 24 | 25 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int64_t MOD = 1000000007;
double PI = 3.141592653589793;
int main() {
int K;
cin >> K;
if (K % 2 == 0 || K % 2 == 5)
cout << -1;
else {
int tmp = 7, ans = 1;
while (true) {
if (tmp % K == 0) {
cout << ans;
break;
} else {
... | #include <bits/stdc++.h>
using namespace std;
int64_t MOD = 1000000007;
double PI = 3.141592653589793;
int main() {
int K;
cin >> K;
if (K % 2 == 0 || K % 5 == 0)
cout << -1;
else {
int tmp = 7, ans = 1;
while (true) {
if (tmp % K == 0) {
cout << ans;
break;
} else {
... | replace | 9 | 10 | 9 | 10 | TLE | |
p02596 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int K;
cin >> K;
long long int N = 7;
long long int i = 1;
long long int output = -1;
if (K % 2 == 0) {
cout << output << '\n';
return 0;
}
while (i < LLONG_MAX) {
if (N % K == 0) {
output = i;
break;
}
... | #include <bits/stdc++.h>
using namespace std;
int main() {
long long int K;
cin >> K;
long long int N = 7;
long long int i = 1;
long long int output = -1;
if (K % 2 == 0) {
cout << output << '\n';
return 0;
}
while (i < 7 * K + 1) {
if (N % K == 0) {
output = i;
break;
}
... | replace | 15 | 16 | 15 | 16 | TLE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.