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 <assert.h> #include <bits/stdc++.h> #include <time.h> using namespace std; #define For(i, x, n) for (long long i = x; i < n; i++) #define rFor(i, x, n) for (long long i = x; i >= n; i--) #define itFor(it, st) for (auto it = st.begin(); it != st.end(); it++) #define MOD 1000000007 #define PI 3.141592653589793...
#include <assert.h> #include <bits/stdc++.h> #include <time.h> using namespace std; #define For(i, x, n) for (long long i = x; i < n; i++) #define rFor(i, x, n) for (long long i = x; i >= n; i--) #define itFor(it, st) for (auto it = st.begin(); it != st.end(); it++) #define MOD 1000000007 #define PI 3.141592653589793...
[["+", 8, 9, 0, 9, 0, 57, 75, 76, 0, 95], ["+", 0, 57, 75, 76, 0, 57, 75, 76, 0, 95]]
1
439
#ifndef Local #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx") #endif #include <bits/stdc++.h> using namespace std; #define popCnt(x) (__builtin_popcountll(x)) #define sz(x) ((int)(x.size())) #define all(v) begin(v), e...
#ifndef Local #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx") #endif #include <bits/stdc++.h> using namespace std; #define popCnt(x) (__builtin_popcountll(x)) #define sz(x) ((int)(x.size())) #define all(v) begin(v), e...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
284
def main(sample_file = ''): """ convenient functions # for i, a in enumerate(iterable) # q, mod = divmod(a, b) # divmod(x, y) returns the tuple (x//y, x%y) # Higher-order function: reduce(operator.mul, xyz_count, 1) # manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc...
def main(sample_file = ''): """ convenient functions # for i, a in enumerate(iterable) # q, mod = divmod(a, b) # divmod(x, y) returns the tuple (x//y, x%y) # Higher-order function: reduce(operator.mul, xyz_count, 1) # manage median(s) using two heapq https://atcoder.jp/contests/abc127/tasks/abc...
[["+", 0, 662, 12, 657, 31, 23, 0, 652, 63, 22], ["+", 12, 657, 31, 23, 0, 652, 3, 4, 0, 24], ["-", 0, 662, 12, 657, 31, 23, 0, 657, 17, 85], ["+", 12, 657, 31, 23, 0, 652, 3, 4, 0, 21], ["+", 31, 23, 0, 652, 3, 4, 0, 23, 0, 25]]
5
2,781
def COMinit(): fac[0] = fac[1] = 1 finv[0] = finv[1] = 1 inv[1] = 1 for i in range(2,max): fac[i] = fac[i-1]*i%mod inv[i] = mod - inv[mod%i]*(mod//i)%mod finv[i] = finv[i-1]*inv[i]%mod def COM(n,k): if n < k: return 0 if n < 0 or k < 0: return 0 retur...
def COMinit(): fac[0] = fac[1] = 1 finv[0] = finv[1] = 1 inv[1] = 1 for i in range(2,max): fac[i] = fac[i-1]*i%mod inv[i] = mod - inv[mod%i]*(mod//i)%mod finv[i] = finv[i-1]*inv[i]%mod def COM(n,k): if n < k: return 0 if n < 0 or k < 0: return 0 retur...
[["-", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22]]
5
280
#include <bits/stdc++.h> #include <iostream> using namespace std; // FILE *fi = freopen("1.txt", "r", stdin); // FILE *fo = freopen("1", "w", stdout); // FILE *fi = freopen("P.inp", "r", stdin); // FILE *fo = freopen("P.out", "w", stdout); int k; string s; const long long Mod = 1e9 + 7; long long g[2000001]; long long ...
#include <bits/stdc++.h> #include <iostream> using namespace std; // FILE *fi = freopen("1.txt", "r", stdin); // FILE *fo = freopen("1", "w", stdout); // FILE *fi = freopen("P.inp", "r", stdin); // FILE *fo = freopen("P.out", "w", stdout); int k; string s; const long long Mod = 1e9 + 7; long long g[2000001]; long long ...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
311
n = int(input()) lis = list(map(int, input().split())) s = 0 for i in lis: s = s^i lis = list(map(lambda x: str(-(-s^x)), lis)) st = ' '.join(lis) print(st)
n = int(input()) lis = list(map(int, input().split())) s = 0 for i in lis: s = s^i lis = list(map(lambda x: str(s^x), lis)) st = ' '.join(lis) print(st)
[["-", 0, 670, 8, 652, 3, 4, 0, 664, 17, 33], ["-", 8, 652, 3, 4, 0, 664, 28, 23, 0, 24], ["-", 0, 664, 28, 23, 0, 657, 31, 664, 17, 33], ["-", 8, 652, 3, 4, 0, 664, 28, 23, 0, 25]]
5
75
n=int(input()) a=list(map(int,input().split())) wk=0 for i in range(0,n,2): wk^=a[i]^a[i+1] ans=[] for i in range(n): ans.append(str(wk^a[i])) print(" ".join(list(set(ans))))
n=int(input()) a=list(map(int,input().split())) wk=0 for i in range(0,n,2): wk^=a[i]^a[i+1] ans=[] for i in range(n): ans.append(str(wk^a[i])) print(" ".join(ans))
[["-", 3, 4, 0, 652, 3, 4, 0, 652, 63, 22], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
96
N = int(input()) A = list(map(int, input().split())) s = 0 for a in A: s ^= a print(s) ans = [] for a in A: ans += [str(a ^ s)] print(' ' .join(ans))
N = int(input()) A = list(map(int, input().split())) s = 0 for a in A: s ^= a ans = [] for a in A: ans += [str(a ^ s)] print(' ' .join(ans))
[["-", 0, 7, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
70
#include <bits/stdc++.h> using namespace std; int main() { int n; int x = 0; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; x ^= a[i]; } for (int i = 0; i < n; i++) { cout << (x ^ a[i]) << " "; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int x = 0; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; x ^= a[i]; } for (int i = 0; i < n; i++) { cout << (x ^ a[i]) << " "; } return 0; }
[["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
90
n=int(input()) arr=list(map(int,input().split())) xors=0 for val in arr: xors^=val ans=[] for i in range(n): ans.append(xors^arr[i]) print(ans)
n=int(input()) arr=list(map(int,input().split())) xors=0 for val in arr: xors^=val ans=[] for i in range(n): ans.append(xors^arr[i]) print(*ans)
[["+", 0, 1, 0, 652, 3, 4, 0, 661, 0, 48]]
5
63
import numpy as np N = int(input()) a = np.fromstring(input(), sep=" ", dtype=np.int64) b = np.bitwise_xor.reduce(a) c = np.bitwise_xor(a, 0) print(*c, sep=" ")
import numpy as np N = int(input()) a = np.fromstring(input(), sep=" ", dtype=np.int64) b = np.bitwise_xor.reduce(a) c = np.bitwise_xor(a, b) print(*c, sep=" ")
[["-", 0, 1, 0, 662, 12, 652, 3, 4, 0, 612], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 22]]
5
65
#include <bits/stdc++.h> using namespace std; #define int long long int #define pb push_back #define mp make_pair #define ff first #define ss second #define all(x) x.begin(), x.end() #define tr(it, a) for (auto it = a.begin(); it != a.end(); it++) #define deb(x) cout << #x << "=" << x << endl #define deb2(x, y) cout <<...
#include <bits/stdc++.h> using namespace std; #define int long long int #define pb push_back #define mp make_pair #define ff first #define ss second #define all(x) x.begin(), x.end() #define tr(it, a) for (auto it = a.begin(); it != a.end(); it++) #define deb(x) cout << #x << "=" << x << endl #define deb2(x, y) cout <<...
[["-", 0, 1, 0, 11, 12, 16, 12, 16, 17, 72], ["-", 0, 1, 0, 11, 12, 16, 12, 16, 12, 13]]
1
348
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; typedef tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, tree_order_statistics_node_update> oset; #define sim template <class c #defi...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; using namespace std; typedef tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, tree_order_statistics_node_update> oset; #define sim template <class c #defi...
[["-", 49, 373, 3, 347, 0, 16, 0, 42, 0, 35], ["-", 0, 53, 49, 373, 3, 347, 0, 16, 12, 22], ["-", 49, 65, 0, 53, 49, 373, 3, 347, 0, 47], ["-", 0, 14, 49, 65, 0, 53, 0, 42, 0, 47], ["-", 0, 14, 49, 65, 0, 53, 0, 42, 0, 22], ["+", 0, 42, 0, 16, 0, 42, 0, 11, 17, 32], ["+", 0, 42, 0, 11, 0, 42, 0, 2, 63, 13], ["-", 49, 6...
1
454
// I'm a f*cking looser #include <bits/stdc++.h> using namespace std; #define ll long long #define fasino \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
// I'm a f*cking looser #include <bits/stdc++.h> using namespace std; #define ll long long #define fasino \ ios_base::sync_with_stdio(false); \ cin.tie(0); ...
[["-", 8, 9, 0, 338, 8, 1, 0, 16, 17, 140], ["+", 8, 9, 0, 338, 8, 1, 0, 11, 17, 130]]
1
105
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <ve...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <ve...
[["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 110]]
1
895
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cmath> #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <cstdlib> #include <deque> // deque #include <io...
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <bitset> // bitset #include <cctype> // isupper, islower, isdigit, toupper, tolower #include <cmath> #include <cstdint> // int64_t, int*_t #include <cstdio> // printf #include <cstdlib> #include <deque> // deque #include <io...
[["+", 8, 9, 0, 9, 0, 1, 0, 11, 31, 22], ["+", 8, 9, 0, 9, 0, 1, 0, 11, 17, 132], ["+", 8, 9, 0, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 14, 8, 9, 0, 9, 0, 1, 0, 35]]
1
688
#include <bits/stdc++.h> using namespace std; using ll = long long; const int MOD = 1000000007; ll pd[200010]; ll rd[200010]; ll Ep(int x, int y) { if (y == 0) return 1; if (y == 1) return x; ll r = Ep(x, y / 2); if (y % 2 == 1) return r * r % MOD * x % MOD; else return r * r % MOD; } ll Ftl(...
#include <bits/stdc++.h> using namespace std; using ll = long long; const int MOD = 1000000007; ll pd[2000010]; ll rd[2000010]; ll Ep(int x, int y) { if (y == 0) return 1; if (y == 1) return x; ll r = Ep(x, y / 2); if (y % 2 == 1) return r * r % MOD * x % MOD; else return r * r % MOD; } ll Ft...
[["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 12, 2, 3, 4, 0, 16, 31, 16, 17, 72], ["+", 12, 2, 3, 4, 0, 16, 31, 16, 12, 22], ["+", 31, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 31, 16, 12, 2, 3, 4, 0, 16, 12, 13]]
1
341
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rept(i, k, n) for (ll i = (k); i < (ll)(n); i++) #define all(v) v.begin(), v.end() #define Sort(v) sort(v.begin(), v.end()) #define Reverse(v) reverse(v.begin(), v.end()) typedef long long ll; typedef pair<int, int...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define rept(i, k, n) for (ll i = (k); i < (ll)(n); i++) #define all(v) v.begin(), v.end() #define Sort(v) sort(v.begin(), v.end()) #define Reverse(v) reverse(v.begin(), v.end()) typedef long long ll; typedef pair<int, int...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
1
488
#include <bits/stdc++.h> #define X first #define Y second using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef pair<ll, int> pli; typedef pair<ll, ll> pll; const ll INF = 2e18; const int inf = 1e9 + 10; const int maxN = 2e6 + 10; const int maxD = 15; const int maxH = ...
#include <bits/stdc++.h> #define X first #define Y second using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pii; typedef pair<ll, int> pli; typedef pair<ll, ll> pll; const ll INF = 2e18; const int inf = 1e9 + 10; const int maxN = 2e6 + 10; const int maxD = 15; const int maxH = ...
[["-", 0, 11, 12, 16, 31, 16, 12, 69, 28, 22], ["-", 12, 16, 31, 16, 12, 69, 341, 342, 0, 70], ["-", 12, 16, 31, 16, 12, 69, 341, 342, 0, 73]]
1
378
#include <bits/stdc++.h> using namespace std; typedef long long int ll; // template {{{ 0 // using {{{ 1 using ll = long long int; using pii = pair<int, int>; using pll = pair<ll, ll>; using vi = vector<int>; using vl = vector<ll>; using vii = vector<pii>; using vll = vector<pll>; // }}} 1 // definition {{{ 1 // scan...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; // template {{{ 0 // using {{{ 1 using ll = long long int; using pii = pair<int, int>; using pll = pair<ll, ll>; using vi = vector<int>; using vl = vector<ll>; using vii = vector<pii>; using vll = vector<pll>; // }}} 1 // definition {{{ 1 // scan...
[["-", 12, 11, 31, 69, 341, 342, 0, 16, 17, 72], ["-", 12, 11, 31, 69, 341, 342, 0, 16, 12, 13], ["-", 0, 1, 0, 34, 12, 11, 12, 69, 28, 22], ["+", 0, 1, 0, 34, 12, 11, 12, 69, 28, 22], ["-", 12, 11, 12, 69, 341, 342, 0, 16, 17, 72], ["-", 12, 11, 12, 69, 341, 342, 0, 16, 12, 13]]
1
1,150
#define _DEBUG #include "bits/stdc++.h" #define CHOOSE(a) CHOOSE2 a #define CHOOSE2(a0, a1, a2, a3, a4, x, ...) x #define debug_1(x1) cout << #x1 << ": " << x1 << endl #define debug_2(x1, x2) \ cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << endl #define d...
#define _DEBUG #include "bits/stdc++.h" #define CHOOSE(a) CHOOSE2 a #define CHOOSE2(a0, a1, a2, a3, a4, x, ...) x #define debug_1(x1) cout << #x1 << ": " << x1 << endl #define debug_2(x1, x2) \ cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << endl #define d...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
1,199
K,S=*$< T=K.to_i+s=S.size-c=1 M=10**9+7 p T.downto(s).sum{c+0*c=c*25*_1*($.+=1).pow(M-2,M)%M}%M
K,S=*$< T=K.to_i+s=S.size-c=1 k=M=10**9+7 p T.downto(s).sum{c+0*c=c*25*_1*(k+=1).pow(M-2,M)%M}%M
[["+", 36, 36, 36, 36, 0, 493, 0, 662, 31, 22], ["+", 36, 36, 36, 36, 0, 493, 0, 662, 0, 32], ["-", 31, 738, 12, 652, 486, 739, 0, 755, 31, 744], ["+", 31, 738, 12, 652, 486, 739, 0, 755, 31, 22]]
4
69
#include <bits/stdc++.h> #define fi first #define se second #define pb push_back #define mp make_pair #define pii pair<int, int> #define pli pair<long long, int> #define pil pair<int, long long> #define ll long long #define el '\n' using namespace std; const int N = 2e6 + 10; // const int N = 1e3 + 10; const ll MOD ...
#include <bits/stdc++.h> #define fi first #define se second #define pb push_back #define mp make_pair #define pii pair<int, int> #define pli pair<long long, int> #define pil pair<int, long long> #define ll long long #define el '\n' using namespace std; const int N = 2e6 + 10; // const int N = 1e3 + 10; const ll MOD ...
[["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25]]
1
347
from collections import defaultdict, deque, Counter from heapq import heappush, heappop, heapify import math import bisect import random from itertools import permutations, accumulate, combinations, product import sys import string from bisect import bisect_left, bisect_right from math import factorial, ceil, floor, gc...
from collections import defaultdict, deque, Counter from heapq import heappush, heappop, heapify import math import bisect import random from itertools import permutations, accumulate, combinations, product import sys import string from bisect import bisect_left, bisect_right from math import factorial, ceil, floor, gc...
[["-", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 12, 22]]
5
577
#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>; // auto mod int // https://youtu.be/L8grWxBlIZ4?t=9858 // https://youtu.be/ERZuLAxZffQ?t=4807 : optimize // https://youtu.be/8uowVvQ_-Mo?t=1329 : division const int mod = 100000...
#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>; // auto mod int // https://youtu.be/L8grWxBlIZ4?t=9858 // https://youtu.be/ERZuLAxZffQ?t=4807 : optimize // https://youtu.be/8uowVvQ_-Mo?t=1329 : division const int mod = 100000...
[["+", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35]]
1
666
#include <bits/stdc++.h> using namespace std; #define repl(i, l, r) for (ll i = (l); i < (r); i++) #define rep(i, n) repl(i, 0, n) using ll = long long; const ll MOD = 1000000007; const ll MAX = 1100000; ll fac[MAX], finv[MAX], inv[MAX]; void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; r...
#include <bits/stdc++.h> using namespace std; #define repl(i, l, r) for (ll i = (l); i < (r); i++) #define rep(i, n) repl(i, 0, n) using ll = long long; const ll MOD = 1000000007; const ll MAX = 2100000; ll fac[MAX], finv[MAX], inv[MAX]; void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; r...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["-", 0, 30, 0, 14, 8, 9, 0, 37, 0, 38]]
1
401
mod=10**9+7 k=int(input()) s=input() n=len(s) c=1 t=1 ans=0 m=10**20 for i in range(k+1): ans+=c*t if ans>m:ans%=mod c*=(n+k-i)*pow(i+1,mod-2,mod) if c>m:c%=mod t*=25 if t>m:t%=mod print(ans)
mod=10**9+7 k=int(input()) s=input() n=len(s) c=1 t=1 ans=0 m=10**20 for i in range(k+1): ans+=c*t if ans>m:ans%=mod c*=(n+k-i)*pow(i+1,mod-2,mod) if c>m:c%=mod t*=25 if t>m:t%=mod print(ans%mod)
[["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
108
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define chmin(x, y) x = min(x, y) #define chmax(x, y) x = max(x, y) using namespace std; typedef long long ll; typedef pair<int, int> P; const int inf = 1 << 21; const ll INF = 1LL << 60; const ll mod = 1e9 + 7; const int dx[4] = {-1, 0, 1, 0}; co...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define chmin(x, y) x = min(x, y) #define chmax(x, y) x = max(x, y) using namespace std; typedef long long ll; typedef pair<int, int> P; const int inf = 1 << 21; const ll INF = 1LL << 60; const ll mod = 1e9 + 7; const int dx[4] = {-1, 0, 1, 0}; co...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13]]
1
507
#include <bits/stdc++.h> #define loop2(i, s, n, a) for (int i = int(s); i < int(n); i += a) #define loop(i, s, n) loop2(i, s, n, 1) #define rep(i, n) loop(i, 0, n) #define pb push_back #define all(in) in.begin(), in.end() using ll = long long; using ull = unsigned long long; using namespace std; const int MOD = 1e9 ...
#include <bits/stdc++.h> #define loop2(i, s, n, a) for (int i = int(s); i < int(n); i += a) #define loop(i, s, n) loop2(i, s, n, 1) #define rep(i, n) loop(i, 0, n) #define pb push_back #define all(in) in.begin(), in.end() using ll = long long; using ull = unsigned long long; using namespace std; const int MOD = 1e9 ...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 12, 13]]
1
437
MOD = 10 ** 9 + 7 K = int(input()) M = len(input()) N = M + K pow25 = [1] * (N + 1) fac = [1] * (N + 1) inv = [1] * (N + 1) for x in range(1, N + 1): fac[x] = fac[x - 1] * x % MOD pow25[x] = pow25[x - 1] * 25 % MOD inv[N] = pow(fac[N], MOD-2, MOD) for x in range(N - 1, -1, -1): inv[x] = inv[x + 1] * (x + 1...
MOD = 10 ** 9 + 7 K = int(input()) M = len(input()) N = M + K pow25 = [1] * (N + 1) fac = [1] * (N + 1) inv = [1] * (N + 1) for x in range(1, N + 1): fac[x] = fac[x - 1] * x % MOD pow25[x] = pow25[x - 1] * 25 % MOD inv[N] = pow(fac[N], MOD-2, MOD) for x in range(N - 1, -1, -1): inv[x] = inv[x + 1] * (x + 1...
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["-", 0, 656, 0, 1, 0, 662, 12, 634, 0, 70], ["-", 0, 656, 0, 1, 0, 662, 12, 634, 0, 612], ["-", 0, 656, 0, 1, 0, 662, 12, 634, 0, 73]]
5
229
package main import ( "bufio" "fmt" "os" "sort" "strconv" ) const N = 1_000_000_007 const MAX = 2_000_001 var fac, finv, inv []int var pow25, pow26 []int // バグってるけど記念提出 func main() { sc := NewScanner() k := sc.ReadInt() s := sc.ReadString() fac = make([]int, MAX) fac[0] = 1 fac[1] = 1 finv = make([]in...
package main import ( "bufio" "fmt" "os" "sort" "strconv" ) const N = 1_000_000_007 const MAX = 2_000_001 var fac, finv, inv []int var pow25, pow26 []int func main() { sc := NewScanner() k := sc.ReadInt() s := sc.ReadString() fac = make([]int, MAX) fac[0] = 1 fac[1] = 1 finv = make([]int, MAX) finv[0...
[["+", 12, 432, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 12, 432, 0, 2, 3, 4, 0, 16, 12, 433]]
7
892
// Let's join Kaede Takagaki Fan Club !! #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("avx") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<i...
// Let's join Kaede Takagaki Fan Club !! #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #pragma GCC target("avx") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace std; typedef long long ll; typedef pair<int, int> P; typedef pair<i...
[["+", 0, 11, 12, 16, 31, 16, 31, 16, 17, 109], ["+", 0, 11, 12, 16, 31, 16, 31, 16, 12, 22]]
1
591
#include "bits/stdc++.h" using namespace std; using ll = long long; using Pii = pair<int, int>; using Pll = pair<ll, ll>; #define rep(i, begin, n) for (int i = begin; i < n; i++) #define repe(i, begin, n) for (int i = begin; i <= n; i++) #define repr(i, begin, n) for (int i = begin; i > begin - n; i--) #define repre(i,...
#include "bits/stdc++.h" using namespace std; using ll = long long; using Pii = pair<int, int>; using Pll = pair<ll, ll>; #define rep(i, begin, n) for (int i = begin; i < n; i++) #define repe(i, begin, n) for (int i = begin; i <= n; i++) #define repr(i, begin, n) for (int i = begin; i > begin - n; i--) #define repre(i,...
[["+", 31, 16, 12, 2, 3, 4, 0, 16, 17, 33], ["+", 31, 16, 12, 2, 3, 4, 0, 16, 12, 13]]
1
522
#include <cstdint> template <std::uint_fast64_t mod> class modint { using u64 = std::uint_fast64_t; public: u64 v; constexpr modint(const u64 x = 0) noexcept : v(x % mod) {} constexpr modint operator+(const modint rhs) const noexcept { return modint(*this) += rhs; } constexpr modint operator-(const m...
#include <cstdint> template <std::uint_fast64_t mod> class modint { using u64 = std::uint_fast64_t; public: u64 v; constexpr modint(const u64 x = 0) noexcept : v(x % mod) {} constexpr modint operator+(const modint rhs) const noexcept { return modint(*this) += rhs; } constexpr modint operator-(const m...
[["+", 0, 7, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 108], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35]]
1
587
x = int(input()) for i in range(1, 360): if (x*i)%360 == 0: print(i) exit()
x = int(input()) for i in range(1, 360+1): if (x*i)%360 == 0: print(i) exit()
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
36
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define pb push_back #define fi first #define se second const ll mod = 1e9 + 7; const int N = 2e5 + 5; void solve() { int x; cin >> x; cout << 360 / x << endl; } /// z = 180*(n-2) /// z/n = 1 /// z = 1*n = 180*(n-2) /// ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define pb push_back #define fi first #define se second const ll mod = 1e9 + 7; const int N = 2e5 + 5; void solve() { int x; cin >> x; cout << 360 / __gcd(360, x) << endl; } /// z = 180*(n-2) /// z/n = 1 ///...
[["+", 0, 16, 31, 16, 12, 16, 12, 2, 63, 22], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 24], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 21], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 25]]
1
115
#include <bits/stdc++.h> using namespace std; #pragma region // {{{ #define all(x) std::begin(x), std::end(x) #define rall(x) std::rbegin(x), std::rend(x) #define rep(i, begin, end) \ for (int64_t i{begin}, i##_end{end}; i < i##_end; ++i) #define repc(i, begin, la...
#include <bits/stdc++.h> using namespace std; #pragma region // {{{ #define all(x) std::begin(x), std::end(x) #define rall(x) std::rbegin(x), std::rend(x) #define rep(i, begin, end) \ for (int64_t i{begin}, i##_end{end}; i < i##_end; ++i) #define repc(i, begin, la...
[["+", 0, 2, 3, 4, 0, 16, 12, 2, 63, 22], ["+", 3, 4, 0, 16, 12, 2, 3, 4, 0, 24], ["+", 3, 4, 0, 16, 12, 2, 3, 4, 0, 13], ["+", 3, 4, 0, 16, 12, 2, 3, 4, 0, 21], ["+", 3, 4, 0, 16, 12, 2, 3, 4, 0, 25]]
1
365
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (ll i = 0; i < n; i++) #define repl(i, l, r) for (ll i = (l); i < (r); i++) #define per(i, n) for (ll i = n - 1; i >= 0; i--) #define perl(i, r, l) for (ll i = r - 1; i >= l; i--) #define fi first #define se second #define pb push_back #define ins inse...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (ll i = 0; i < n; i++) #define repl(i, l, r) for (ll i = (l); i < (r); i++) #define per(i, n) for (ll i = n - 1; i >= 0; i--) #define perl(i, r, l) for (ll i = r - 1; i >= l; i--) #define fi first #define se second #define pb push_back #define ins inse...
[["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 13], ["+", 0, 43, 49, 50, 51, 2, 3, 4, 0, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 31, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 31, 13]]
1
374
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; cout << 360 / x << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; cout << 360 / __gcd(360, x) << endl; return 0; }
[["+", 0, 16, 31, 16, 12, 16, 12, 2, 63, 22], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 24], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 21], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 25]]
1
30
#include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <memory> #include <queue> #inc...
#include <algorithm> #include <bitset> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <memory> #include <queue> #inc...
[["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
3,760
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(i, n) for (int i = 1; i <= (int)(n); i++) #define drep(i, n) for (int i = (n)-1; i >= 0; i--) #define ALL(x) (x).begin(), (x).end() using namespace std; typedef long long ll; typedef pair<int, int> P; typedef vector<int> vi; type...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rrep(i, n) for (int i = 1; i <= (int)(n); i++) #define drep(i, n) for (int i = (n)-1; i >= 0; i--) #define ALL(x) (x).begin(), (x).end() using namespace std; typedef long long ll; typedef pair<int, int> P; typedef vector<int> vi; type...
[["+", 0, 57, 64, 1, 0, 11, 12, 16, 17, 85], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 12, 22]]
1
590
#include <algorithm> #include <cmath> #include <complex> #include <functional> #include <iostream> #include <limits> #include <numeric> #include <sstream> #include <string> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int X; cin >> X; for (int i = 1...
#include <algorithm> #include <cmath> #include <complex> #include <functional> #include <iostream> #include <limits> #include <numeric> #include <sstream> #include <string> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int X; cin >> X; for (int i = 1...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
104
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, n) for (long long i = 0; i < (n); ++i) #define ll long long #define P pair<ll, ll> #define all(v) (v).begin(), (v).end() const ll mod = 1e9 + 7; const ll INF = 1e18; const double pi = acos(-1.0); int main(void) { int x; cin >> x; ...
#include <bits/stdc++.h> using namespace std; #define _GLIBCXX_DEBUG #define rep(i, n) for (long long i = 0; i < (n); ++i) #define ll long long #define P pair<ll, ll> #define all(v) (v).begin(), (v).end() const ll mod = 1e9 + 7; const ll INF = 1e18; const double pi = acos(-1.0); int main(void) { int x; cin >> x; ...
[["+", 0, 1, 0, 16, 31, 16, 12, 16, 31, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 85]]
1
79
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repr(i, n) for (int i = (int)(n); i >= 0; i--) #define all(v) v.begin(), v.end() typedef long long ll; int main() { int X; cin >> X; for (int i = 1; i <= 360; i++) { if ((i * (180 - X)) % 360 == 0) { ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define repr(i, n) for (int i = (int)(n); i >= 0; i--) #define all(v) v.begin(), v.end() typedef long long ll; int main() { int X; cin >> X; for (int i = 1; i <= 360; i++) { if ((i * X) % 360 == 0) { cout...
[["-", 31, 16, 31, 23, 0, 16, 12, 23, 0, 24], ["-", 31, 23, 0, 16, 12, 23, 0, 16, 31, 13], ["-", 31, 23, 0, 16, 12, 23, 0, 16, 17, 33], ["-", 31, 16, 31, 23, 0, 16, 12, 23, 0, 25]]
1
88
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; if (360 % x == 0) cout << (360 / x); else cout << (x * 360) / __gcd(x, 360); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; if (360 % x == 0) cout << (360 / x); else cout << ((x * 360) / __gcd(x, 360)) / x; return 0; }
[["+", 12, 16, 31, 23, 0, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 2, 3, 4, 0, 25], ["+", 75, 76, 0, 1, 0, 16, 12, 16, 17, 85], ["+", 75, 76, 0, 1, 0, 16, 12, 16, 12, 22]]
1
54
#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<ll, ll, ll> T; const long long INF = 1LL << 60; const int MOD = 1000000000 + 7; #define rev(s) (string((s).rbegin(), (s).rend())) template <typename T> inline strin...
#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<ll, ll, ll> T; const long long INF = 1LL << 60; const int MOD = 1000000000 + 7; #define rev(s) (string((s).rbegin(), (s).rend())) template <typename T> inline strin...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78]]
1
459
#include <stdio.h> #define ULL unsigned long long #define MOD 1000000007 #define MAX 30000000 ULL RepSq(ULL n, ULL m, ULL mod); void nCk_init(int mod); ULL nCk(int n, int k, int mod); ULL fac[MAX], finv[MAX], inv[MAX]; int main() { nCk_init(MOD); int K, a, iCnt = 0; scanf("%d", &K); getchar(); while ((...
#include <stdio.h> #define ULL unsigned long long #define MOD 1000000007 #define MAX 10000000 ULL RepSq(ULL n, ULL m, ULL mod); void nCk_init(int mod); ULL nCk(int n, int k, int mod); ULL fac[MAX], finv[MAX], inv[MAX]; int main() { nCk_init(MOD); int K, a, iCnt = 0; scanf("%d", &K); getchar(); while ((...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59]]
1
476
#include <algorithm> #include <iostream> #include <stdio.h> #include <string.h> #define maxn 2000005 using namespace std; typedef long long ll; const ll mod = 1e9 + 7; ll fac[maxn], inv[maxn]; ll pow25[maxn], pow26[maxn]; ll quickpow(ll p, ll k) { ll ans = 1; while (k) { if (k & 1) ans = (ans * p) % mod; ...
#include <algorithm> #include <iostream> #include <stdio.h> #include <string.h> #define maxn 2000005 using namespace std; typedef long long ll; const ll mod = 1e9 + 7; ll fac[maxn], inv[maxn]; ll pow25[maxn], pow26[maxn]; ll quickpow(ll p, ll k) { ll ans = 1; while (k) { if (k & 1) ans = (ans * p) % mod; ...
[["-", 0, 7, 10, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 7, 10, 43, 49, 50, 51, 16, 31, 13]]
1
455
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (ll i = 0; i < n; i++) #define repl(i, l, r) for (ll i = (l); i < (r); i++) #define per(i, n) for (ll i = n - 1; i >= 0; i--) #define perl(i, r, l) for (ll i = r - 1; i >= l; i--) #define fi first #define se second #define pb push...
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (ll i = 0; i < n; i++) #define repl(i, l, r) for (ll i = (l); i < (r); i++) #define per(i, n) for (ll i = n - 1; i >= 0; i--) #define perl(i, r, l) for (ll i = r - 1; i >= l; i--) #define fi first #define se second #define pb push...
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
1,304
#include <bits/stdc++.h> using namespace std; #define all(x) x.begin(), x.end() #define sz(x) (int)x.size() #define pb push_back #define endl '\n' #define snd second #define fst first #define fastio cin.tie(NULL), cout.sync_with_stdio(true) typedef long long int ll; typedef unsigned long long int ull; typedef vector...
#include <bits/stdc++.h> using namespace std; #define all(x) x.begin(), x.end() #define sz(x) (int)x.size() #define pb push_back #define endl '\n' #define snd second #define fst first #define fastio cin.tie(NULL), cout.sync_with_stdio(true) typedef long long int ll; typedef unsigned long long int ull; typedef vector...
[["-", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 12, 22]]
1
475
#include <algorithm> #include <fstream> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <sstream> #include <stack> #include <string> #include <vector> #define ll long long #define MAX_N 1000001 using namespace std; long long MOD = 1000000007; long long fact[MAX_N]; voi...
#include <algorithm> #include <fstream> #include <iomanip> #include <iostream> #include <list> #include <map> #include <queue> #include <sstream> #include <stack> #include <string> #include <vector> #define ll long long #define MAX_N 2000001 using namespace std; long long MOD = 1000000007; long long fact[MAX_N]; voi...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 17, 72], ["+", 0, 43, 49, 50, 51, 4, 0, 16, 12, 13], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
463
import java.util.*; public class Main { public static long MOD = (long)Math.pow(10, 9) + 7; public static void main(String[] args) { Scanner sc = new Scanner(System.in); long k = sc.nextLong(); String s = sc.next(); long n = s.length(); long[] rui26 = new long[1000001]; long[] rui25 = new ...
import java.util.*; public class Main { public static long MOD = (long)Math.pow(10, 9) + 7; public static void main(String[] args) { Scanner sc = new Scanner(System.in); long k = sc.nextLong(); String s = sc.next(); long n = s.length(); long[] rui26 = new long[1000001]; long[] rui25 = new...
[["-", 12, 504, 71, 74, 51, 23, 0, 16, 17, 33], ["-", 12, 504, 71, 74, 51, 23, 0, 16, 12, 499]]
3
492
// // Created by Takuto Endo on 2020/07/13. // #include <bits/stdc++.h> #define int long long using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) typedef pair<int, int> pii; const int INF = 1l << 60; constexpr int mod = 1000000007; #define ll long long template <ll M = mod> class ModInt { public: ...
// // Created by Takuto Endo on 2020/07/13. // #include <bits/stdc++.h> #define int long long using namespace std; #define rep(i, n) for (int i = 0; i < (n); ++i) typedef pair<int, int> pii; const int INF = 1l << 60; constexpr int mod = 1000000007; #define ll long long template <ll M = mod> class ModInt { public: ...
[["-", 0, 30, 0, 359, 54, 376, 0, 356, 0, 32], ["-", 0, 30, 0, 359, 54, 376, 0, 356, 365, 22], ["+", 31, 2, 63, 346, 3, 347, 0, 77, 39, 78], ["+", 12, 2, 63, 346, 3, 347, 0, 77, 39, 78]]
1
1,417
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; const ll MOD = 1e9 + 7; // const ll MOD = 998244353; const ll INF = MOD * MOD; struct mint { ll x; mint(ll x = 0) : x((x % MOD + MOD) % MOD) {} mint operator-() const { return mint(-x); } mint &operator+=(const mint a)...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; const ll MOD = 1e9 + 7; // const ll MOD = 998244353; const ll INF = MOD * MOD; struct mint { ll x; mint(ll x = 0) : x((x % MOD + MOD) % MOD) {} mint operator-() const { return mint(-x); } mint &operator+=(const mint a)...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13]]
1
9,834
from sys import stdin input = stdin.readline def nCr(n,r): return fact[n]*(inv[n-r]%M)*(inv[r]%M) M = 1000000007 k = int(input()) s = len(input()) t = k+s fact = [1] p25 = [1] for i in range(1,t+1): fact += [(fact[-1] * i)%M] if i<=k: p25 += [(p25[-1] * 25) % M] inv = [1]*(t+1) inv[t] = pow(fact[t...
from sys import stdin input = stdin.readline def nCr(n,r): return fact[n]*(inv[n-r]%M)*(inv[r]%M) M = 1000000007 k = int(input()) s = len(input().strip()) t = k+s fact = [1] p25 = [1] for i in range(1,t+1): fact += [(fact[-1] * i)%M] if i<=k: p25 += [(p25[-1] * 25) % M] inv = [1]*(t+1) inv[t] = po...
[["+", 12, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
222
#include <iostream> #include <string> long long Modpow(long long a, long long n, long long mod) { long long res = 1; while (n > 0) { if (n & 1) { res = res * a % mod; } a = a * a % mod; n >>= 1; } return res; } long long Modinv(long long a, long long mod) { return Modpow(a, mod - 2, mod)...
#include <iostream> #include <string> long long Modpow(long long a, long long n, long long mod) { long long res = 1; while (n > 0) { if (n & 1) { res = res * a % mod; } a = a * a % mod; n >>= 1; } return res; } long long Modinv(long long a, long long mod) { return Modpow(a, mod - 2, mod)...
[["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 23, 0, 16, 12, 23, 0, 25], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
334
#include <bits/stdc++.h> using namespace std; const int N = 2e6 + 5; typedef long long LL; LL mod = 1e9 + 7, ans; string s; int k, n; LL fac[N], inv[N]; LL ksm(LL a, LL b) { LL res = 1; while (b) { if (b & 1) res = res * a % mod; b /= 2; a = a * a % mod; } return res; } LL comb(int a, int ...
#include <bits/stdc++.h> using namespace std; const int N = 2e6 + 5; typedef long long LL; LL mod = 1e9 + 7, ans; string s; int k, n; LL fac[N], inv[N]; LL ksm(LL a, LL b) { LL res = 1; while (b) { if (b & 1) res = res * a % mod; b /= 2; a = a * a % mod; } return res; } LL comb(int a, int ...
[["-", 8, 9, 0, 1, 0, 11, 12, 11, 12, 13], ["+", 8, 9, 0, 1, 0, 11, 12, 11, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 10, 43, 39, 40], ["+", 0, 14, 8, 9, 0, 7, 10, 43, 39, 78], ["+", 0, 7, 8, 1, 0, 11, 12, 16, 17, 109], ["+", 0, 7, 8, 1, 0, 11, 12, 16, 12, 22]]
1
277
#include <algorithm> #include <iostream> #include <map> #include <numeric> #include <set> #include <string> #include <vector> using namespace std; typedef long long li; #define ceil(a, b) (((a) + (b)-1) / (b)) #define yn(i) ((i) ? "Yes" : "No") #define chmin(a, b) (a > (b) ? a = (b), 1 : 0) #define abs(n) max((n), -(n)...
#include <algorithm> #include <iostream> #include <map> #include <numeric> #include <set> #include <string> #include <vector> using namespace std; typedef long long li; #define ceil(a, b) (((a) + (b)-1) / (b)) #define yn(i) ((i) ? "Yes" : "No") #define chmin(a, b) (a > (b) ? a = (b), 1 : 0) #define abs(n) max((n), -(n)...
[["-", 0, 14, 8, 9, 0, 37, 0, 41, 64, 22], ["-", 0, 14, 8, 9, 0, 37, 0, 41, 0, 102], ["+", 0, 14, 8, 9, 0, 37, 0, 41, 0, 102], ["+", 0, 14, 8, 9, 0, 37, 0, 41, 75, 22]]
1
380
#include <algorithm> #include <bits/stdc++.h> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #incl...
#include <algorithm> #include <bits/stdc++.h> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstring> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #incl...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
2,618
x = int(input()) if 360 % x == 0: print(360 // x) else: common = 360 * x // math.gcd(360, x) ans = common // x print(ans)
import math x = int(input()) if 360 % x == 0: print(360 // x) else: common = 360 * x // math.gcd(360, x) ans = common // x print(ans)
[["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]]
5
46
X = int(input()) K = 0 while ((X * K) % 360 != 0) and (K == 0): K += 1 print(K)
X = int(input()) K = 0 while ((X * K) % 360 != 0) or (K == 0): K += 1 print(K)
[["-", 36, 36, 0, 656, 0, 52, 15, 679, 17, 355], ["+", 36, 36, 0, 656, 0, 52, 15, 679, 17, 354]]
5
37
import numpy as np X = int(input()) X_lcm = np.lcm(360, 360-X) print(X_lcm // X)
import numpy as np X = int(input()) X_lcm = np.lcm(360, X) print(X_lcm // X)
[["-", 0, 662, 12, 652, 3, 4, 0, 657, 31, 612], ["-", 0, 662, 12, 652, 3, 4, 0, 657, 17, 33]]
5
30
a=int(input()) x = 0 i = 1 while(1): x += a i += 1 x %= 360 if x: continue else: print(i) quit()
a=int(input()) x = 0 i = 0 while(1): x += a i += 1 x %= 360 if x: continue else: print(i) quit()
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612]]
5
41
X=int(input()) K=0 a=0 while True: a+=X K+=1 if K%360==0: break print(K)
X=int(input()) K=0 a=0 while True: a+=X K+=1 if a%360==0: break print(K)
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 31, 22], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 31, 22]]
5
35
#include <bits/stdc++.h> using namespace std; int main() { long long x; cin >> x; long long temp = (__gcd(x, (long long)360)); cout << ((x / temp) * 360) << endl; }
#include <bits/stdc++.h> using namespace std; int main() { long long x; cin >> x; long long temp = (__gcd(x, (long long)360)); cout << ((x / temp) * 360) / x << endl; }
[["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 85], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
51
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <complex> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <random> #include <regex> #include <set> #include <stack> #include <vector> using namespace std; #pragma region #define r...
#include <algorithm> #include <cassert> #include <climits> #include <cmath> #include <complex> #include <cstring> #include <functional> #include <iostream> #include <map> #include <queue> #include <random> #include <regex> #include <set> #include <stack> #include <vector> using namespace std; #pragma region #define r...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
418
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll maxn = 1e5 + 1000; ll t; int main() { // freopen("in.txt","r",stdin); ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); cin >> t; ll res = 1; for (;; res++) { if (res * 360 % t == 0) break; } res = res * 360 / t; cout...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll maxn = 1e5 + 1000; ll t; int main() { // freopen("in.txt","r",stdin); ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); cin >> t; ll res = 1; for (;; res++) { if (res * 360 % t == 0) break; } res = res * 360 / t; cout...
[["-", 0, 1, 0, 16, 31, 16, 12, 16, 31, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 85], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]]
1
99
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() using namespace std; typedef long long ll; const int MOD = 1e9 + 7; int main() { int x; cin >> x; for (int i = 0;; i++) { if ((x * i) % 360 == 0) { cout << i << endl; return 0; } } return 0; }
#include <bits/stdc++.h> #define all(x) (x).begin(), (x).end() using namespace std; typedef long long ll; const int MOD = 1e9 + 7; int main() { int x; cin >> x; for (int i = 1;; i++) { if ((x * i) % 360 == 0) { cout << i << endl; return 0; } } return 0; }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
77
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <vector> #define F first #define S second #define all(a) a.begin(), a.end() #define setDP(arr) memset(arr, -1, ...
#include <algorithm> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <vector> #define F first #define S second #define all(a) a.begin(), a.end() #define setDP(arr) memset(arr, -1, ...
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
192
x = int(input()) def lcm(x, y): return (x * y) // math.gcd(x, y) print(lcm(x, 360)//x)
import math x = int(input()) def lcm(x, y): return (x * y) // math.gcd(x, y) print(lcm(x, 360)//x)
[["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]]
5
42
#include <algorithm> #include <cmath> #include <iostream> #include <list> #include <string> #include <utility> #include <vector> using namespace std; using ll = long long; using str = string; using vl = vector<ll>; using vs = vector<str>; using listl = list<ll>; #define min(A, B) min(static_cast<ll>(A), static_cast<...
#include <algorithm> #include <cmath> #include <iostream> #include <list> #include <string> #include <utility> #include <vector> using namespace std; using ll = long long; using str = string; using vl = vector<ll>; using vs = vector<str>; using listl = list<ll>; #define min(A, B) min(static_cast<ll>(A), static_cast<...
[["-", 12, 16, 12, 2, 3, 4, 0, 16, 31, 13], ["-", 12, 16, 12, 2, 3, 4, 0, 16, 17, 33]]
1
1,015
#pragma GCC optimize("O3") //コンパイラ最適化用 #define _GLIBCXX_DEBUG //配列に[]でアクセス時のエラー表示 #include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <chrono> //実行時間計測 #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <functional> //sortのgr...
#pragma GCC optimize("O3") //コンパイラ最適化用 #define _GLIBCXX_DEBUG //配列に[]でアクセス時のエラー表示 #include <algorithm> //sort,二分探索,など #include <bitset> //固定長bit集合 #include <chrono> //実行時間計測 #include <cmath> //pow,logなど #include <complex> //複素数 #include <deque> //両端アクセスのキュー #include <functional> //sortのgr...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
589
// M #include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); printf("%d\n", n * 360 / __gcd(n, 360)); return 0; }
// M #include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); printf("%d\n", n * 360 / __gcd(n, 360) / n); return 0; }
[["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 85], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22]]
1
48
//#pragma GCC optimize("O3") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define trav(x, a) for (const auto &x : a) #define sz(x) (int)(x).size() #define all(x) (x).begin(), x.end() #define mem(a, v) memset((a), (v), sizeof(a)) #define enl printf("\n") #define ...
//#pragma GCC optimize("O3") #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define trav(x, a) for (const auto &x : a) #define sz(x) (int)(x).size() #define all(x) (x).begin(), x.end() #define mem(a, v) memset((a), (v), sizeof(a)) #define enl printf("\n") #define ...
[["-", 0, 16, 31, 16, 12, 16, 31, 16, 31, 22], ["-", 0, 16, 31, 16, 12, 16, 31, 16, 17, 48]]
1
242
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; x = 180 - x; int i = 1; while (360 * i % x != 0) { i++; } cout << 360 * i / x << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; int i = 1; while (360 * i % x != 0) { i++; } cout << 360 * i / x << endl; }
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 31, 13], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
55
from math import gcd x = int(input()) print(360*gcd(x,360)//x)
from math import gcd x = int(input()) print(360*(x//gcd(x,360))//x)
[["+", 3, 4, 0, 657, 31, 657, 12, 23, 0, 24], ["+", 0, 657, 31, 657, 12, 23, 0, 657, 31, 22], ["+", 0, 657, 31, 657, 12, 23, 0, 657, 17, 676], ["+", 12, 23, 0, 657, 12, 652, 3, 4, 0, 25]]
5
25
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { int x; cin >> x; int t = 180 - x; int k = 1; while (t % 360 != 0) { k++; t += 180 - x; } cout << k; }
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { int x; cin >> x; int t = x; int k = 1; while (t % 360 != 0) { k++; t += x; } cout << k; }
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 31, 13], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 31, 13], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33]]
1
56
import sys readline = sys.stdin.readline MOD = 10 ** 9 + 7 INF = float('INF') sys.setrecursionlimit(10 ** 5) def main(): x = int(readline()) for i in range(1, 361): if ((180 - x) * i) % 360 == 0: return print(i) if __name__ == '__main__': main()
import sys readline = sys.stdin.readline MOD = 10 ** 9 + 7 INF = float('INF') sys.setrecursionlimit(10 ** 5) def main(): x = int(readline()) for i in range(1, 361): if (x * i) % 360 == 0: return print(i) if __name__ == '__main__': main()
[["-", 0, 657, 31, 23, 0, 657, 31, 23, 0, 24], ["-", 31, 23, 0, 657, 31, 23, 0, 657, 31, 612], ["-", 31, 23, 0, 657, 31, 23, 0, 657, 17, 33], ["-", 0, 657, 31, 23, 0, 657, 31, 23, 0, 25]]
5
85
x=gets.to_i p (360%x).zero? ? 360/x : x.lcm(360)
x=gets.to_i p (360%x).zero? ? 360/x : x.lcm(360)/x
[["+", 0, 652, 3, 4, 0, 754, 75, 738, 17, 85], ["+", 0, 652, 3, 4, 0, 754, 75, 738, 12, 22]]
4
24
#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 vector<int> vi; typedef vector<ll> vl; typedef vector<pii> vii; typedef vector<vi> vvi; typedef vector<pll> vll; typedef vector<vl> vvl; #define fori(i, n) for (in...
#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 vector<int> vi; typedef vector<ll> vl; typedef vector<pii> vii; typedef vector<vi> vvi; typedef vector<pll> vll; typedef vector<vl> vvl; #define fori(i, n) for (in...
[["-", 0, 16, 31, 16, 12, 16, 31, 16, 31, 22], ["-", 0, 16, 31, 16, 12, 16, 31, 16, 17, 48]]
1
250
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int k; for (int i = 0;; i++) { k = n * i; if (k % 360 == 0) { cout << i << endl; break; } } }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int k; for (int i = 1;; i++) { k = n * i; if (k % 360 == 0) { cout << i << endl; break; } } }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]]
1
59
// ABHISHEK AGRAWAL// // Newbie......You have to be odd to be no. ONE :)// #include <bits/stdc++.h> using namespace std; #define ll long long int #define ld long double #define fl float #define lcm(a, b) (a * (b / __gcd(a, b))) #define vs vector<string> #define vc vector<char> #define vll vector<ll> #define sll set<ll>...
// ABHISHEK AGRAWAL// // Newbie......You have to be odd to be no. ONE :)// #include <bits/stdc++.h> using namespace std; #define ll long long int #define ld long double #define fl float #define lcm(a, b) (a * (b / __gcd(a, b))) #define vs vector<string> #define vc vector<char> #define vll vector<ll> #define sll set<ll>...
[["-", 8, 9, 0, 43, 49, 50, 51, 2, 63, 22], ["-", 0, 43, 49, 50, 51, 2, 3, 4, 0, 24], ["+", 0, 43, 49, 50, 51, 16, 12, 2, 63, 22], ["+", 49, 50, 51, 16, 12, 2, 3, 4, 0, 24], ["+", 49, 50, 51, 16, 12, 2, 3, 4, 0, 21], ["+", 49, 50, 51, 16, 12, 2, 3, 4, 0, 13]]
1
1,026
import math x=int(input()) if 360%x==0: print(360//x) else: print(x * 360 // math.gcd(x, 360))
import math x=int(input()) if 360%x==0: print(360//x) else: print(360 // math.gcd(x, 360))
[["-", 0, 652, 3, 4, 0, 657, 31, 657, 31, 22], ["-", 0, 652, 3, 4, 0, 657, 31, 657, 17, 48]]
5
40
x=int(input("")) import math a=math.gcd(360,x) print(int(360*x/a/a))
x=int(input("")) import math a=math.gcd(360,x) print(int(360/a))
[["-", 3, 4, 0, 657, 31, 657, 31, 657, 17, 48], ["-", 3, 4, 0, 657, 31, 657, 31, 657, 12, 22], ["-", 0, 652, 3, 4, 0, 657, 31, 657, 17, 85], ["-", 0, 652, 3, 4, 0, 657, 31, 657, 12, 22]]
5
35
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <string> using namespace std; int main() { long long x; cin >> x; cout << (360 / (__gcd(x, 1LL * 360)) * x) / 360 << endl; return 0; }
#include <algorithm> #include <cmath> #include <cstdio> #include <iostream> #include <map> #include <string> using namespace std; int main() { long long x; cin >> x; cout << (360 / (__gcd(x, 1LL * 360)) * x) / x << endl; return 0; }
[["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
56
#include <bits/stdc++.h> using namespace std; void solve(long long X) { cout << 360 / X << endl; } int main() { long long X; scanf("%lld", &X); solve(X); return 0; }
#include <bits/stdc++.h> using namespace std; void solve(long long X) { cout << 360 / gcd(X, 360) << endl; } int main() { long long X; scanf("%lld", &X); solve(X); return 0; }
[["+", 0, 16, 31, 16, 12, 16, 12, 2, 63, 22], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 24], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 21], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 25]]
1
51
#include <algorithm> #include <cmath> #include <iostream> using namespace std; int main() { int x; cin >> x; int r = x * 360 / __gcd(x, 360); int ans = 360 / r; cout << ans << endl; }
#include <algorithm> #include <cmath> #include <iostream> using namespace std; int main() { int x; cin >> x; int r = x * 360 / __gcd(x, 360); int ans = r / x; cout << ans << endl; }
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 31, 13], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 85], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 85], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22]]
1
50
def lcm(x, y): if x > y: greater = x else: greater = y while(True): if((greater % x == 0) and (greater % y == 0)): lcm = greater break greater += 1 return lcm num1 = int(input()) a=lcm(num1,360) b=a/360 print(int(b))
def lcm(x, y): if x > y: greater = x else: greater = y while(True): if((greater % x == 0) and (greater % y == 0)): lcm = greater break greater += 1 return lcm num1 = int(input()) a=lcm(num1,360) b=a/num1 print(int(b))
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22]]
5
82
def solve(x): k = 0 while k*x % 360 != 0: k += 1 return k x = int(input()) print(solve(x))
def solve(x): k = 1 while k*x % 360 != 0: k += 1 return k x = int(input()) print(solve(x))
[["-", 0, 14, 8, 196, 0, 1, 0, 662, 12, 612], ["+", 0, 14, 8, 196, 0, 1, 0, 662, 12, 612]]
5
38
#include <cstdio> #include <iostream> #define debug(...) fprintf(stderr, __VA_ARGS__) using namespace std; inline char nc() { // return getchar(); static char buf[100000], *l = buf, *r = buf; return l == r && (r = (l = buf) + fread(buf, 1, 100000, stdin), l == r) ? EOF : *l++; } template...
#include <cstdio> #include <iostream> #define debug(...) fprintf(stderr, __VA_ARGS__) using namespace std; inline char nc() { // return getchar(); static char buf[100000], *l = buf, *r = buf; return l == r && (r = (l = buf) + fread(buf, 1, 100000, stdin), l == r) ? EOF : *l++; } template...
[["-", 3, 4, 0, 16, 12, 2, 3, 4, 0, 13], ["+", 3, 4, 0, 16, 12, 2, 3, 4, 0, 13]]
1
238
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define FOR(i, start, end) for (int i = start; i <= end; i++) const int INF = 1001001001; typedef long long ll; const ll MOD = 1000000007; using namespace std; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1;...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define FOR(i, start, end) for (int i = start; i <= end; i++) const int INF = 1001001001; typedef long long ll; const ll MOD = 1000000007; using namespace std; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1;...
[["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 109], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
1,381
x = int(input()) for i in range(100000): if x * i % 360 == 0: print(i) exit()
x = int(input()) for i in range(1, 100000): if x * i % 360 == 0: print(i) exit()
[["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21]]
5
32
#include <bits/stdc++.h> using namespace std; typedef long long int ll; const ll mod = 1e9 + 7; //ユークリッドの互除法 ll gcd(ll x, ll y) { if (x > y) swap(x, y); if (x == 0) return y; return gcd(x, y % x); }; int main() { int x; cin >> x; if (gcd(360, x) == 1) cout << 360 << endl; else cout << 36...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; const ll mod = 1e9 + 7; //ユークリッドの互除法 ll gcd(ll x, ll y) { if (x > y) swap(x, y); if (x == 0) return y; return gcd(x, y % x); }; int main() { int x; cin >> x; if (gcd(360, x) == 1) cout << 360 << endl; else cout << 36...
[["+", 0, 16, 31, 16, 12, 16, 12, 2, 63, 22], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 24], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 21], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 25]]
1
107
from math import gcd X = int(input()) print(360//gcd(X,180))
from math import gcd X = int(input()) print(360//gcd(X,360))
[["-", 3, 4, 0, 657, 12, 652, 3, 4, 0, 612], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 612]]
5
23
import math x=int(input()) print(360//math.gcd(x,180))
import math x=int(input()) print(360//math.gcd(x,360))
[["-", 3, 4, 0, 657, 12, 652, 3, 4, 0, 612], ["+", 3, 4, 0, 657, 12, 652, 3, 4, 0, 612]]
5
23
#include <bits/stdc++.h> using namespace std; int32_t main() { int x; cin >> x; cout << (360 / x) << endl; }
#include <bits/stdc++.h> using namespace std; int32_t main() { int x; cin >> x; cout << (360 / __gcd(x, 360)) << endl; }
[["+", 31, 16, 12, 23, 0, 16, 12, 2, 63, 22], ["+", 12, 23, 0, 16, 12, 2, 3, 4, 0, 24], ["+", 12, 23, 0, 16, 12, 2, 3, 4, 0, 21], ["+", 12, 23, 0, 16, 12, 2, 3, 4, 0, 13], ["+", 12, 23, 0, 16, 12, 2, 3, 4, 0, 25]]
1
29
#include <bits/stdc++.h> #define ll long long #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define fr(i, a, b) for (int i = a; i < b; i++) #define frr(i, a, b) for (int i = a; i >= b; i--...
#include <bits/stdc++.h> #define ll long long #define fast \ ios_base::sync_with_stdio(false); \ cin.tie(NULL) #define fr(i, a, b) for (int i = a; i < b; i++) #define frr(i, a, b) for (int i = a; i >= b; i--...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
114
#include <bits/stdc++.h> #define clr(x) memset(x, 0, sizeof(x)) #define For(i, a, b) for (int i = (a); i <= (b); i++) #define Fod(i, b, a) for (int i = (b); i >= (a); i--) #define fi first #define se second #define kill _z_kill #define pb(x) push_back(x) #define mp(x, y) make_pair(x, y) #define outval(x) cerr << #x " =...
#include <bits/stdc++.h> #define clr(x) memset(x, 0, sizeof(x)) #define For(i, a, b) for (int i = (a); i <= (b); i++) #define Fod(i, b, a) for (int i = (b); i >= (a); i--) #define fi first #define se second #define kill _z_kill #define pb(x) push_back(x) #define mp(x, y) make_pair(x, y) #define outval(x) cerr << #x " =...
[["-", 0, 1, 0, 11, 12, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 13], ["-", 0, 16, 31, 16, 12, 16, 31, 16, 31, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 31, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 48], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]]
1
272
x = int(input()) for i in range(1, 360 + 1): if i * x == 360: print(i) exit(0)
x = int(input()) for i in range(1, 360 + 1): if i * x % 360 == 0: print(i) exit(0)
[["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 60], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 109], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 60], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 0, 612]]
5
35
#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 mt make_tuple #define fo(i, n) for (i = 0; i < n; i++) #define fo1(i, n) for (i = 1; i <= n; i++) #define Fo(i, k, n) for (i = k; k <= n ? i <=...
#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 mt make_tuple #define fo(i, n) for (i = 0; i < n; i++) #define fo1(i, n) for (i = 1; i <= n; i++) #define Fo(i, k, n) for (i = k; k <= n ? i <=...
[["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
694