buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { int n; cin >> n; int k; for (int i = 1; i <= 360; i++) { if ((i * n) % 360 == 0) { k = i; } } cout << k; return 0; }
#include <bits/stdc++.h> #include <iostream> using namespace std; int main() { int n; cin >> n; int k = 0; // n=min(n,(180-n)); for (int i = 1; i <= 360; i++) { if ((i * n) % 360 == 0) { k = i; break; } } cout << k; return 0; }
[["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94]]
1
65
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #inc...
#include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <cmath> #include <complex> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <iterator> #include <list> #include <map> #inc...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 51, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["+", 51, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["-", 0, 1, 0, 11, 12, 16, 31, 16, 12, 13], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 0, ...
1
315
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define REP(a, b) for (int a = 0; a < (b); ++a) #define REP1(i, n) for (int i = 1; i <= (n); ++i) #define debug(x) cerr << #x << ": " << x << '\n' #define all(x) (x).begin(), (x).end() #define YES() printf("YES\n") #define NO() printf("NO\n") ...
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define REP(a, b) for (int a = 0; a < (b); ++a) #define REP1(i, n) for (int i = 1; i <= (n); ++i) #define debug(x) cerr << #x << ": " << x << '\n' #define all(x) (x).begin(), (x).end() #define YES() printf("YES\n") #define NO() printf("NO\n") ...
[["-", 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
912
#include <bits/stdc++.h> using namespace std; #define FOR(i, l, r) for (long long i = (l); i < (r); ++i) #define REP(i, n) FOR(i, 0, n) #define REPS(i, n) FOR(i, 1, n + 1) #define RFOR(i, l, r) for (long long i = (l); i >= (r); --i) #define RREP(i, n) RFOR(i, n - 1, 0) #define RREPS(i, n) RFOR(i, n, 1) #define int long...
#include <bits/stdc++.h> using namespace std; #define FOR(i, l, r) for (long long i = (l); i < (r); ++i) #define REP(i, n) FOR(i, 0, n) #define REPS(i, n) FOR(i, 1, n + 1) #define RFOR(i, l, r) for (long long i = (l); i >= (r); --i) #define RREP(i, n) RFOR(i, n - 1, 0) #define RREPS(i, n) RFOR(i, n, 1) #define int long...
[["+", 0, 16, 31, 16, 12, 16, 31, 2, 63, 22], ["+", 31, 16, 12, 16, 31, 2, 3, 4, 0, 24], ["+", 31, 16, 12, 16, 31, 2, 3, 4, 0, 21], ["+", 31, 16, 12, 16, 31, 2, 3, 4, 0, 22], ["+", 31, 16, 12, 16, 31, 2, 3, 4, 0, 25]]
1
211
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Main { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String ...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Main { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String n...
[["-", 0, 57, 75, 196, 0, 503, 49, 200, 51, 499], ["+", 0, 57, 75, 196, 0, 503, 49, 200, 51, 499]]
3
308
#include <bits/stdc++.h> using namespace std; int main() { int X, A; int counter = 1; cin >> X; int K = 360 / X; if (360 % X == 0) cout << K << endl; else { while (true) { counter++; if ((counter * 360) % X == 0) { cout << counter * K << endl; break; } } } }
#include <bits/stdc++.h> using namespace std; int main() { int X, A; int counter = 1; cin >> X; int K = 360 / X; if (360 % X == 0) cout << K << endl; else { while (true) { counter++; if ((counter * 360) % X == 0) { cout << (counter * 360) / X << endl; break; } }...
[["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 85], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
83
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; if (360 % x == 0) { cout << 360 / x << endl; return 0; } int counter = 1; while (true) { if (360 * counter % x == 0) { cout << 360 * counter % x; return 0; } counter++; } return -1; }
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; if (360 % x == 0) { cout << 360 / x << endl; return 0; } int counter = 1; while (true) { if ((360 * counter) % x == 0) { cout << 360 * counter / x; return 0; } counter++; } return -1; }
[["+", 15, 339, 51, 16, 31, 16, 31, 23, 0, 24], ["+", 15, 339, 51, 16, 31, 16, 31, 23, 0, 25], ["-", 64, 9, 0, 1, 0, 16, 12, 16, 17, 109], ["+", 64, 9, 0, 1, 0, 16, 12, 16, 17, 85]]
1
80
#include <math.h> #include <stdio.h> int N, X; int k = 0; int count = 0; int rem; int swap(int c, int d) { if (d < c) { rem = c; c = d; d = rem; } } int gcd(int a, int b) { swap(a, b); if (a == 0) return b; else return gcd(b % a, a); } int main(void) { scanf("%d", &X); if (360 % X =...
#include <math.h> #include <stdio.h> int N, X; int k = 0; int count = 0; int rem; int swap(int c, int d) { if (d < c) { rem = c; c = d; d = rem; } } int gcd(int a, int b) { swap(a, b); if (a == 0) return b; else return gcd(b % a, a); } int main(void) { scanf("%d", &X); if (360 % X =...
[["-", 0, 2, 3, 4, 0, 16, 31, 16, 31, 22], ["-", 0, 2, 3, 4, 0, 16, 31, 16, 17, 48]]
0
157
import math x=int(input()) ct=0 for i in range(1000): ct+=(180-x) if ct%360==0: print(i+1) exit()
import math x=int(input()) ct=0 for i in range(1000): ct+=x if ct%360==0: print(i+1) exit()
[["-", 8, 196, 0, 1, 0, 677, 12, 23, 0, 24], ["-", 0, 1, 0, 677, 12, 23, 0, 657, 31, 612], ["-", 0, 1, 0, 677, 12, 23, 0, 657, 17, 33], ["-", 8, 196, 0, 1, 0, 677, 12, 23, 0, 25]]
5
44
import sys x = int(input()) y = 0 m = 1 if 360 % x == 0: m = int(360 / x) else: for i in range(1, 360): y = x * i if y > 360: if y % 360 == 0: m = i break print(m)
import sys x = int(input()) y = 0 m = 1 if 360 % x == 0: m = int(360 / x) else: for i in range(1, 1000): y = x * i if y > 360: if y % 360 == 0: m = i break print(m)
[["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]]
5
68
# -*- coding: utf-8 -*- # get a integer a = int(input()) m = a c = 1 while m % 360 != 0: m+=a c+=1 print(m)
# -*- coding: utf-8 -*- # get a integer a = int(input()) m = a c = 1 while m % 360 != 0: m+=a c+=1 print(c)
[["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22]]
5
33
#include <bits/stdc++.h> #define fi first #define se second using namespace std; typedef long long ui; int x; int exgcd(int a, int b, int &x, int &y) { if (b == 0) { x = 1; y = 0; return a; } int res = exgcd(b, a % b, x, y); int t = x; x = y; y = t - a / b * y; return res; } int main() {...
#include <bits/stdc++.h> #define fi first #define se second using namespace std; typedef long long ui; int x; int exgcd(int a, int b, int &x, int &y) { if (b == 0) { x = 1; y = 0; return a; } int res = exgcd(b, a % b, x, y); int t = x; x = y; y = t - a / b * y; return res; } int main() {...
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 17, 48], ["-", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22]]
1
160
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ll long long #define REP(i, a, b) for (ll i = a; i < b; i++) #define REPI(i, a, b) for (ll i = b - 1; i >= a; i--) #define i_os ...
#include <bits/stdc++.h> using namespace std; #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ll long long #define REP(i, a, b) for (ll i = a; i < b; i++) #define REPI(i, a, b) for (ll i = b - 1; i >= a; i--) #define i_os ...
[["+", 0, 43, 49, 50, 51, 16, 12, 2, 63, 22], ["+", 49, 50, 51, 16, 12, 2, 3, 4, 0, 21], ["+", 49, 50, 51, 16, 12, 2, 3, 4, 0, 13]]
1
189
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; cout << 360 / __gcd(360, 180 - x); }
#include <bits/stdc++.h> using namespace std; int main() { int x; cin >> x; cout << 360 / __gcd(360, x); }
[["-", 12, 16, 12, 2, 3, 4, 0, 16, 31, 13], ["-", 12, 16, 12, 2, 3, 4, 0, 16, 17, 33]]
1
32
#include <bits/stdc++.h> using namespace std; #define ll long long int #define mod 1000000007 #define pb(a) push_back(a) #define pi pair<int, int> #define f first #define s second #define endl "\n" void solve() { int x; cin >> x; int k = 1; int p = 360; while (p % 360) { p += 360; } cout << p / x << e...
#include <bits/stdc++.h> using namespace std; #define ll long long int #define mod 1000000007 #define pb(a) push_back(a) #define pi pair<int, int> #define f first #define s second #define endl "\n" void solve() { int x; cin >> x; int k = 1; int p = 360; while (p % x) { p += 360; } cout << p / x << end...
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 12, 22]]
1
97
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; int main() { int x; cin >> x; if (360 % x == 0) cout << 360 / x << endl; else { rep(i, x) { if (360 * (i + 1) % x == 0) { cout << 360 * (i + 1) / x << endl; } } ...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) typedef long long ll; int main() { int x; cin >> x; if (360 % x == 0) cout << 360 / x << endl; else { rep(i, x) { if (360 * (i + 1) % x == 0) { cout << 360 * (i + 1) / x << endl; break; ...
[["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 35]]
1
89
x = int(input()) if 360 % x == 0: print(360 // x) else: import math gcd = mat.gcd(x, 360) lcm = (x * 360) // gcd print(lcm // x)
x = int(input()) if 360 % x == 0: print(360 // x) else: import math gcd = math.gcd(x, 360) lcm = (x * 360) // gcd print(lcm // x)
[["-", 0, 1, 0, 662, 12, 652, 63, 319, 500, 22], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 500, 22]]
5
50
#include <bits/stdc++.h> using namespace std; int main() { bool backFlg = false; int countY = 0; int inputX; cin >> inputX; while (!backFlg) { countY++; if (countY * 180 % inputX == 0) { backFlg = true; } } cout << countY * 180 / inputX << endl; }
#include <bits/stdc++.h> using namespace std; int main() { bool backFlg = false; int countY = 0; int inputX; cin >> inputX; while (!backFlg) { countY++; if (countY * 360 % inputX == 0) { backFlg = true; } } cout << countY * 360 / inputX << endl; }
[["-", 15, 339, 51, 16, 31, 16, 31, 16, 12, 13], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 12, 13], ["-", 0, 16, 31, 16, 12, 16, 31, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 16, 31, 16, 12, 13]]
1
65
X = int(input()) n = 360 while(1): if n%X == 0: print(int(360/X)) break n = n + 360
X = int(input()) n = 360 while(1): if n % X == 0: print(int(n/X)) break n = n + 360
[["-", 3, 4, 0, 652, 3, 4, 0, 657, 31, 612], ["+", 3, 4, 0, 652, 3, 4, 0, 657, 31, 22]]
5
38
#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...
[["+", 12, 16, 31, 23, 0, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 2, 3, 4, 0, 25], ["+", 0, 9, 0, 1, 0, 16, 12, 16, 17, 85], ["+", 0, 9, 0, 1, 0, 16, 12, 16, 12, 22]]
1
199
#include <algorithm> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> #define initdp(a, b) \ for (int i = 0; i <= a; i++) ...
#include <algorithm> #include <cmath> #include <cstring> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> #define initdp(a, b) \ for (int i = 0; i <= a; i++) ...
[["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 22]]
1
322
import math x = int(input()) g = math.gdc(x,360) print(360//g)
import math x = int(input()) g = math.gcd(x,360) print(360//g)
[["-", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22]]
5
26
#include <bits/stdc++.h> #define rep(i, m) for (long long i = 0; i < m; i++) #define per(i, m) for (long long i = m - 1; i >= 0; i--) #define FOR(i, n, m) for (long long i = n; i < m; i++) #define ROF(i, n, m) for (long long i = m - 1; i >= n; i--) #define SORT(v, n) ...
#include <bits/stdc++.h> #define rep(i, m) for (long long i = 0; i < m; i++) #define per(i, m) for (long long i = m - 1; i >= 0; i--) #define FOR(i, n, m) for (long long i = n; i < m; i++) #define ROF(i, n, m) for (long long i = m - 1; i >= n; i--) #define SORT(v, n) ...
[["-", 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
4,698
#include "bits/stdc++.h" #include "math.h" using namespace std; typedef long long ll; typedef vector<ll> vll; typedef vector<vll> vvll; typedef vector<bool> vb; typedef vector<vb> vvb; typedef vector<int> vin; typedef pair<ll, ll> P; typedef vector<P> vp; #define rep(i, a, b) for (ll i = (a); i < (b); ++i) #define dre...
#include "bits/stdc++.h" #include "math.h" using namespace std; typedef long long ll; typedef vector<ll> vll; typedef vector<vll> vvll; typedef vector<bool> vb; typedef vector<vb> vvb; typedef vector<int> vin; typedef pair<ll, ll> P; typedef vector<P> vp; #define rep(i, a, b) for (ll i = (a); i < (b); ++i) #define dre...
[["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 48], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25]]
1
190
#include "bits/stdc++.h" #define ALL(x) x.begin(), x.end() #define rep(i, n) for (ll i = 0; i < n; ++i) #define END(x) (*(x.end() - 1)) using namespace std; typedef long long ll; template <typename T> T gcd(T a, T b) { if (a % b == 0) { return (b); } else { return (gcd(b, a % b)); } } template <typenam...
#include "bits/stdc++.h" #define ALL(x) x.begin(), x.end() #define rep(i, n) for (ll i = 0; i < n; ++i) #define END(x) (*(x.end() - 1)) using namespace std; typedef long long ll; template <typename T> T gcd(T a, T b) { if (a % b == 0) { return (b); } else { return (gcd(b, a % b)); } } template <typenam...
[["-", 0, 14, 8, 9, 0, 37, 0, 16, 17, 85], ["+", 0, 14, 8, 9, 0, 37, 0, 16, 17, 48], ["-", 0, 16, 12, 16, 31, 2, 3, 4, 0, 13], ["-", 0, 16, 12, 16, 31, 2, 3, 4, 0, 21], ["+", 0, 16, 12, 16, 31, 2, 3, 4, 0, 21], ["+", 0, 16, 12, 16, 31, 2, 3, 4, 0, 13]]
1
133
#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; using ll = long long; using ld = long double; #define mp make_pair typedef tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, tree_orde...
#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; using ll = long long; using ld = long double; #define mp make_pair typedef tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, tree_orde...
[["+", 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
280
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; ll x; int main(void) { cin >> x; for (int i = 1; i <= 10000000; i++) { if (x * i % 180 == 0) { cout << i << endl; return 0; } } }
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> P; ll x; int main(void) { cin >> x; for (int i = 1; i <= 10000000; i++) { if (x * i % 360 == 0) { cout << i << endl; return 0; } } }
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13]]
1
71
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int gcd = gcd(n, 360); System.out.println(n * 360 / gcd); } public static int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); } }
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int gcd = gcd(n, 360); System.out.println(360 / gcd); } public static int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); } }
[["-", 0, 492, 3, 4, 0, 16, 31, 16, 31, 22], ["-", 0, 492, 3, 4, 0, 16, 31, 16, 17, 48]]
3
96
import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.UncheckedIOException; import java.io.Writer; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static void ...
import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.UncheckedIOException; import java.io.Writer; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static void ...
[["-", 8, 196, 0, 503, 49, 200, 51, 16, 17, 48], ["-", 0, 503, 49, 200, 51, 16, 12, 23, 0, 24], ["-", 49, 200, 51, 16, 12, 23, 0, 16, 31, 22], ["-", 49, 200, 51, 16, 12, 23, 0, 16, 17, 85], ["-", 49, 200, 51, 16, 12, 23, 0, 16, 12, 22], ["-", 0, 503, 49, 200, 51, 16, 12, 23, 0, 25]]
3
849
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, b, a) for (int i = (b)-1; i >= (a); i--) #define ITER(it, a) \ for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++) #define FILL(a, va...
#include <bits/stdc++.h> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, b, a) for (int i = (b)-1; i >= (a); i--) #define ITER(it, a) \ for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++) #define FILL(a, va...
[["-", 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
238
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int a = 1; int b = 0; int k = 0; while (a == 0) { k += 360; a = k % x; } b = k / x; System.out.print(b); } }
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); int a = 1; int b = 0; int k = 0; while (a != 0) { k += 360; a = k % x; } b = k / x; System.out.print(b); } }
[["-", 8, 196, 0, 52, 15, 15, 0, 16, 17, 60], ["+", 8, 196, 0, 52, 15, 15, 0, 16, 17, 79]]
3
92
#include <bits/stdc++.h> #define lol long long #define gcd(x, y) __gcd(x, y) #define mt make_tuple #define mp make_pair #define fi first #define se second #define fixed fixed << setprecision(14) using namespace std; using pii = pair<int, int>; template <class A, class B> inline bool chmax(A &a, const B &b) { return ...
#include <bits/stdc++.h> #define lol long long #define gcd(x, y) __gcd(x, y) #define mt make_tuple #define mp make_pair #define fi first #define se second #define fixed fixed << setprecision(14) using namespace std; using pii = pair<int, int>; template <class A, class B> inline bool chmax(A &a, const B &b) { return ...
[["-", 0, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 12, 16, 31, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 85], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
290
#include <algorithm> #include <cmath> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; double pie = 3.14159265358979; long long mod = 99...
#include <algorithm> #include <cmath> #include <cstring> #include <fstream> #include <iomanip> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <vector> using namespace std; double pie = 3.14159265358979; long long mod = 99...
[["-", 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
105
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <...
#include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <complex> #include <cstdio> #include <deque> #include <fstream> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <sstream> #include <stack> #include <...
[["+", 0, 16, 31, 16, 12, 16, 31, 2, 63, 22], ["+", 31, 16, 12, 16, 31, 2, 3, 4, 0, 24], ["+", 31, 16, 12, 16, 31, 2, 3, 4, 0, 21], ["+", 31, 16, 12, 16, 31, 2, 3, 4, 0, 22], ["+", 31, 16, 12, 16, 31, 2, 3, 4, 0, 25]]
1
227
#include <bits/stdc++.h> #include <iostream> using namespace std; typedef long long ll; ll n; ll f(ll x, ll y) { if (y == 0) return x; return f(y, x % y); } int main(void) { cin >> n; cout << n * 360 / f(n, 360) << endl; }
#include <bits/stdc++.h> #include <iostream> using namespace std; typedef long long ll; ll n; ll f(ll x, ll y) { if (y == 0) return x; return f(y, x % y); } int main(void) { cin >> n; // cout<<f(90,360)<<endl; cout << n * 360 / f(n, 360) / n << endl; }
[["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 85], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
72
x =int(input()) for k in range(100000): if x*k%360==0: print(k) exit(0)
x =int(input()) for k in range(1,100000): if x*k%360==0: print(k) exit(0)
[["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21]]
5
33
#include <bits/stdc++.h> #define itn int #define REP(i, n) for (ll i = 0; i < n; i++) #define IREP(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i < b + 1; i++) #define all(v) v.begin(), v.end() #define SENTINEL 2000000000 #define NIL -1 using namespace std; typedef long long ll; const ll M...
#include <bits/stdc++.h> #define itn int #define REP(i, n) for (ll i = 0; i < n; i++) #define IREP(i, n) for (ll i = n - 1; i >= 0; i--) #define FOR(i, a, b) for (ll i = a; i < b + 1; i++) #define all(v) v.begin(), v.end() #define SENTINEL 2000000000 #define NIL -1 using namespace std; typedef long long ll; const ll M...
[["-", 0, 52, 8, 9, 0, 1, 0, 11, 17, 108], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 107]]
1
184
#include <bits/stdc++.h> #include <random> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef double ld; //#define ll __int128 //#define int ll //#define int ll //#define char ll #define double ld typedef vector<char> vc; typedef vector<vc> vvc; typedef vector<vvc> vvvc; typedef pair<i...
#include <bits/stdc++.h> #include <random> using namespace std; typedef unsigned long long ull; typedef long long ll; typedef double ld; //#define ll __int128 //#define int ll //#define int ll //#define char ll #define double ld typedef vector<char> vc; typedef vector<vc> vvc; typedef vector<vvc> vvvc; typedef pair<i...
[["-", 49, 50, 51, 16, 12, 2, 3, 4, 0, 13], ["+", 49, 50, 51, 16, 12, 2, 3, 4, 0, 13]]
1
803
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll gcd(ll a, ll b) { if (b == 0) { return a; } return gcd(b, a % b); } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int x; cin >> x; cout << 180 / gcd(x, 180) * 2 << "\n"; return 0; }...
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll gcd(ll a, ll b) { if (b == 0) { return a; } return gcd(b, a % b); } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); int x; cin >> x; cout << 360 / gcd(x, 360) << "\n"; return 0; }
[["-", 0, 16, 31, 16, 12, 16, 31, 16, 31, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 31, 13], ["-", 12, 16, 31, 16, 12, 2, 3, 4, 0, 13], ["+", 31, 16, 12, 16, 12, 2, 3, 4, 0, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 48], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]]
1
97
#include <bits/stdc++.h> //#pragma GCC optimize "Ofast,omit-frame-pointer,inline" using namespace std; typedef long long ll; #define REP(i, n) for (int i = 0; i < int(n); i++) #define FOR(i, m, n) for (int i = int(m); i < int(n); i++) #define ALL(obj) (obj).begin(), (obj).end() #define VI vector<int> #define VP vector...
#include <bits/stdc++.h> //#pragma GCC optimize "Ofast,omit-frame-pointer,inline" using namespace std; typedef long long ll; #define REP(i, n) for (int i = 0; i < int(n); i++) #define FOR(i, m, n) for (int i = int(m); i < int(n); i++) #define ALL(obj) (obj).begin(), (obj).end() #define VI vector<int> #define VP vector...
[["-", 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
263
#include <bits/stdc++.h> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) #define repp(i, n, m) for (int i = m; i < (n); ++i) #define repl(i, n) for (long long i = 0; i < (n); ++i) #d...
#include <bits/stdc++.h> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <stack> #include <string> #include <vector> #define rep(i, n) for (int i = 0; i < (n); ++i) #define repp(i, n, m) for (int i = m; i < (n); ++i) #define repl(i, n) for (long long i = 0; i < (n); ++i) #d...
[["+", 0, 9, 0, 9, 0, 1, 0, 11, 17, 107], ["+", 0, 9, 0, 9, 0, 1, 0, 11, 12, 22], ["+", 8, 9, 0, 9, 0, 9, 0, 1, 0, 35], ["+", 0, 9, 0, 9, 0, 1, 0, 11, 31, 22]]
1
617
#include <bits/stdc++.h> #define all(a) a.begin(), a.end() #define db(a) cout << fixed << #a << " = " << a << endl; using namespace std; typedef long long ll; typedef pair<int, int> pii; const int MAXN = 3000 + 5; const ll MOD = 998244353; ll dp[MAXN][MAXN]; int main() { ios_base::sync_with_stdio(false); cin.tie(...
#include <bits/stdc++.h> #define all(a) a.begin(), a.end() #define db(a) cout << fixed << #a << " = " << a << endl; using namespace std; typedef long long ll; typedef pair<int, int> pii; const int MAXN = 3000 + 5; const ll MOD = 998244353; ll dp[MAXN][MAXN]; int main() { ios_base::sync_with_stdio(false); cin.tie(...
[["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
299
#include <iostream> using namespace std; typedef long long ll; const int N = 3010; const int mod = 998244353; int f[N][N]; int main() { int a, b, c, d; cin >> a >> b >> c >> d; f[a][b] = 1; for (int i = a; i <= c; i++) { for (int j = b; j <= d; j++) { if (i == a && j == b) continue; f[i...
#include <iostream> using namespace std; typedef long long ll; const int N = 3010; const int mod = 998244353; ll f[N][N]; int main() { int a, b, c, d; cin >> a >> b >> c >> d; f[a][b] = 1; for (int i = a; i <= c; i++) { for (int j = b; j <= d; j++) { if (i == a && j == b) continue; f[i]...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78]]
1
212
# -*- coding: utf-8 -*- ############# # Libraries # ############# import sys input = sys.stdin.readline import math #from math import gcd import bisect import heapq from collections import defaultdict from collections import deque from collections import Counter from functools import lru_cache ############# # Cons...
# -*- coding: utf-8 -*- ############# # Libraries # ############# import sys input = sys.stdin.readline import math #from math import gcd import bisect import heapq from collections import defaultdict from collections import deque from collections import Counter from functools import lru_cache ############# # Cons...
[["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 21], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 612]]
5
1,221
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<ll> vi; typedef vector<vi> vvi; #define INF (1e9) ll MOD = 998244353; int main() { int A, B, C, D; cin >> A >> B >> C >> D; vvi DP(C + 1, vi(D + 1)); DP[A][B] = 1; for (int i = A + 1; i <= C; i++) { ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef vector<ll> vi; typedef vector<vi> vvi; #define INF (1e9) ll MOD = 998244353; int main() { ll A, B, C, D; cin >> A >> B >> C >> D; vvi DP(C + 1, vi(D + 1)); DP[A][B] = 1; for (int i = A + 1; i <= C; i++) { ...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 12, 16, 12, 16, 31, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 16, 31, 23, 0, 16, 31, 22], ["+", 12, 16, 12, 16, 31, 16, 31, 23, 0, 25]]
1
291
#include <bits/stdc++.h> #include <tr1/unordered_map> #define ri register int #define ptf printf using namespace std; typedef double db; typedef long double ld; typedef long long ll; typedef vector<int> poly; typedef pair<int, int> pii; typedef pair<ll, int> pli; typedef pair<int, ll> pil; typedef pair<ll, ll> pll; typ...
#include <bits/stdc++.h> #include <tr1/unordered_map> #define ri register int #define ptf printf using namespace std; typedef double db; typedef long double ld; typedef long long ll; typedef vector<int> poly; typedef pair<int, int> pii; typedef pair<ll, int> pli; typedef pair<int, ll> pil; typedef pair<ll, ll> pll; typ...
[["-", 26, 34, 12, 34, 31, 2, 3, 4, 0, 22], ["+", 0, 7, 26, 34, 12, 2, 3, 4, 0, 22], ["-", 8, 9, 0, 7, 26, 34, 12, 34, 0, 21], ["-", 0, 7, 26, 34, 12, 34, 12, 27, 17, 29], ["-", 0, 7, 26, 34, 12, 34, 12, 27, 28, 22]]
1
1,158
#include <cmath> #include <cstdio> #include <cstring> #include <iostream> #define T 10000 #define inf 0x7fffffff using namespace std; #define int long long const int mod = 998244353; int dp[3005][3005]; signed main() { int a, b, c, d; cin >> a >> b >> c >> d; dp[a][b] = 1; for (int i = a; i <= c; i++) for (...
#include <cmath> #include <cstdio> #include <cstring> #include <iostream> #define T 10000 #define inf 0x7fffffff using namespace std; #define int long long const int mod = 998244353; int dp[3005][3005]; signed main() { int a, b, c, d; cin >> a >> b >> c >> d; dp[a][b] = 1; for (int i = a; i <= c; i++) for (...
[["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22]]
1
195
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int mod = 998244353; int a, b, c, d; ll dp[3005][3005]; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> a >> b >> c >> d; dp[a][b] = 1; for (int i = a + 1; i <= c; i++) dp[i][b] = dp[i - 1][b] * b % ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int mod = 998244353; int a, b, c, d; ll dp[3005][3005]; int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> a >> b >> c >> d; dp[a][b] = 1; for (int i = a + 1; i <= c; i++) dp[i][b] = dp[i - 1][b] * b % ...
[["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 25], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22]]
1
269
#include <bits/stdc++.h> using namespace std; const int md = 998244353; int a, b, c, d, i, j, k, cur; long long f[3003][3003][2]; int main() { scanf("%d%d%d%d", &a, &b, &c, &d); f[a][b][1] = 1; for (i = a; i <= c; i++) for (j = b; j <= d; j++) for (k = 0; k < 2; k++) if (f[i][j][k]) { ...
#include <bits/stdc++.h> using namespace std; const int md = 998244353; int a, b, c, d, i, j, k, cur; long long f[3003][3003][2]; int main() { scanf("%d%d%d%d", &a, &b, &c, &d); f[a][b][1] = 1; for (i = a; i <= c; i++) for (j = b; j <= d; j++) for (k = 0; k < 2; k++) if (f[i][j][k]) { ...
[["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 24], ["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 25], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 17, 109], ["+", 3, 4, 0, 2, 3, 4, 0, 16, 12, 22]]
1
268
#include <bits/stdc++.h> int ri() { int n; scanf("%d", &n); return n; } int main() { int x = ri(); std::cout << std::gcd(x, 360) / x << std::endl; return 0; }
#include <bits/stdc++.h> int ri() { int n; scanf("%d", &n); return n; } int main() { int x = ri(); std::cout << 360 / std::gcd(x, 360) << std::endl; return 0; }
[["+", 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, 17, 85], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
59
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; const ll MOD = 998244353; const ll INF = 1ll << 60; #define FOR(i, a, b) for (ll i = (a); i < (ll)(b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(v) (v).begin(), (v).end() #define DEBUG(x) ; #define DEBUG(x) std::cerr <<...
#include <bits/stdc++.h> using namespace std; using ll = long long; using P = pair<ll, ll>; const ll MOD = 998244353; const ll INF = 1ll << 60; #define FOR(i, a, b) for (ll i = (a); i < (ll)(b); ++i) #define REP(i, n) FOR(i, 0, n) #define ALL(v) (v).begin(), (v).end() #define DEBUG(x) ; #define DEBUG(x) std::cerr <<...
[["+", 0, 30, 0, 43, 49, 50, 51, 83, 0, 45], ["+", 0, 30, 0, 43, 49, 50, 51, 83, 0, 46], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
316
#include <bits/stdc++.h> //#include "atcoder/all" typedef long long int ll; using namespace std; // using namespace atcoder; #define mod 998244353 #define MAXC 3001 #define MAXD 3001 ll dp[MAXC][MAXD]; int main() { ll a, b, c, d; cin >> a >> b >> c >> d; memset(dp, 0, sizeof(dp)); dp[a][b] = 1; for (int i = a...
#include <bits/stdc++.h> //#include "atcoder/all" typedef long long int ll; using namespace std; // using namespace atcoder; #define mod 998244353 #define MAXC 3001 #define MAXD 3001 ll dp[MAXC][MAXD]; int main() { ll a, b, c, d; cin >> a >> b >> c >> d; memset(dp, 0, sizeof(dp)); dp[a][b] = 1; for (int i = a...
[["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
203
#include <bits/stdc++.h> using namespace std; long long a, b, c, d, e, i, j, ii, jj, zx, xc, mod = 998244353LL, dp[3009][3009]; int main() { ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); cin >> a >> b >> c >> d; dp[a][b] = 1; for (i = a; i <= c; i++) {...
#include <bits/stdc++.h> using namespace std; long long a, b, c, d, e, i, j, ii, jj, zx, xc, mod = 998244353LL, dp[3009][3009]; int main() { ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0); cin >> a >> b >> c >> d; dp[a][b] = 1; for (i = a; i <= c; i++) {...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]]
1
287
#include <bits/stdc++.h> using namespace std; #define int long long #define forinc(a, b, c) for (int a = b, _c = c; a <= _c; ++a) #define fordec(a, b, c) for (int a = b, _c = c; a >= _c; --a) #define forv(a, b) for (auto &a : b) #define forb(a, b) \ for (i...
#include <bits/stdc++.h> using namespace std; #define int long long #define forinc(a, b, c) for (int a = b, _c = c; a <= _c; ++a) #define fordec(a, b, c) for (int a = b, _c = c; a >= _c; --a) #define forv(a, b) for (auto &a : b) #define forb(a, b) \ for (i...
[["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22]]
1
344
#define _CRT_SECURE_NO_DEPRECATE #pragma GCC optimize("O3") #pragma GCC target("sse4") #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 int #define SYNC ...
#define _CRT_SECURE_NO_DEPRECATE #pragma GCC optimize("O3") #pragma GCC target("sse4") #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 int #define SYNC ...
[["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 72], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 12, 22], ["+", 0, 11, 12, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 11, 12, 16, 12, 16, 31, 23, 0, 25], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 17, 109], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 12, 22]]
1
651
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define MOD 998244353 ll dp[3005][3005]; int main() { ll a, b, c, d; cin >> a >> b >> c >> d; dp[a][b] = 1; for (ll i = a; i <= c; i++) { for (ll j = b; j <= d; j++) { if (i == a) { if (j == b) continue; dp[i...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define MOD 998244353 ll dp[3005][3005]; int main() { ll a, b, c, d; cin >> a >> b >> c >> d; dp[a][b] = 1; for (ll i = a; i <= c; i++) { for (ll j = b; j <= d; j++) { if (i == a) { if (j == b) continue; dp[i...
[["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 25], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 22]]
1
234
#include <bits/stdc++.h> #define mod 998244353 #define int long long using namespace std; const int N = 3100; int a, b, c, d, dp[N][N][2]; signed main() { scanf("%lld%lld%lld%lld", &a, &b, &c, &d); if (a == c && b == d) { printf("1\n"); return 0; } if (a == c) { int ans = 1; for (int i = b; i <=...
#include <bits/stdc++.h> #define mod 998244353 #define int long long using namespace std; const int N = 3100; int a, b, c, d, dp[N][N][2]; signed main() { scanf("%lld%lld%lld%lld", &a, &b, &c, &d); if (a == c && b == d) { printf("1\n"); return 0; } if (a == c) { int ans = 1; for (int i = b; i < ...
[["-", 0, 57, 64, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 57, 64, 9, 0, 7, 15, 16, 17, 18]]
1
485
#include <stdio.h> #include <stdlib.h> #define ll long long #define MD 998244353 #define mod(n) ((n % MD + MD) % MD) #define max(x, y) (x > y ? x : y) #define min(x, y) (x < y ? x : y) #define mul3(x, y, z) (mod(mod(x * y) * z)) #define ARG_MAX 3010 ll Y(ll, ll, ll, ll); static ll memo_X[ARG_MAX][ARG_MAX]; static ll ...
#include <stdio.h> #include <stdlib.h> #define ll long long #define MD 998244353 #define mod(n) ((n % MD + MD) % MD) #define max(x, y) (x > y ? x : y) #define min(x, y) (x < y ? x : y) #define mul3(x, y, z) (mod(mod(x * y) * z)) #define ARG_MAX 3010 ll Y(ll, ll, ll, ll); static ll memo_X[ARG_MAX][ARG_MAX]; static ll ...
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 106], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 98]]
0
560
#include <bits/stdc++.h> #define ll long long #define rep(A, B, C) for (A = B; A < C; ++A) #define repd(A, B, C) for (A = (ll)C - 1; A >= B; ++A) #define pii pair<int, int> #define pll pair<ll, ll> template <typename T> void mxin(T &a, T b) { if (a < b) a = b; } template <typename T> void mnin(T &a, T b) { if ...
#include <bits/stdc++.h> #define ll long long #define rep(A, B, C) for (A = B; A < C; ++A) #define repd(A, B, C) for (A = (ll)C - 1; A >= B; ++A) #define pii pair<int, int> #define pll pair<ll, ll> template <typename T> void mxin(T &a, T b) { if (a < b) a = b; } template <typename T> void mnin(T &a, T b) { if ...
[["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 24], ["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 25], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 109], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22]]
1
303
#include <bits/stdc++.h> using namespace std; const long MOD = 998244353; long dp[3010][3010][2]; int main() { int A, B, C, D; cin >> A >> B >> C >> D; dp[A][B][1] = 1; for (int i = A; i <= C; i++) { for (int j = B; j <= D; j++) { if (i == A && j == B) continue; dp[i][j][0] = ((dp[i - ...
#include <bits/stdc++.h> using namespace std; const long long MOD = 998244353; long long dp[3010][3010][2]; int main() { int A, B, C, D; cin >> A >> B >> C >> D; dp[A][B][1] = 1; for (int i = A; i <= C; i++) { for (int j = B; j <= D; j++) { if (i == A && j == B) continue; dp[i][j][0] =...
[["+", 36, 36, 0, 30, 0, 43, 39, 86, 0, 96], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
227
#include <bits/stdc++.h> #define fi first #define se second #define mp make_pair #define pb push_back #define eb emplace_back #define ar array using namespace std; typedef long long ll; typedef pair<int, int> ii; const int mod = 998244353, maxn = 3005; int f[maxn][maxn][2]; int A, B, C, D; signed main(void) { io...
#include <bits/stdc++.h> #define fi first #define se second #define mp make_pair #define pb push_back #define eb emplace_back #define ar array using namespace std; typedef long long ll; typedef pair<int, int> ii; const int mod = 998244353, maxn = 3005; int f[maxn][maxn][2]; int A, B, C, D; signed main(void) { io...
[["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25]]
1
422
#pragma GCC optimize("Ofast", "unroll-loops", "omit-frame-pointer", \ "inline") // Optimization flags #pragma GCC option("arch=native", "tune=native", "no-zero-upper") // Enable AVX #pragma GCC target("avx2") // Enable AVX #include <bits/stdc++.h> ...
#pragma GCC optimize("Ofast", "unroll-loops", "omit-frame-pointer", \ "inline") // Optimization flags #pragma GCC option("arch=native", "tune=native", "no-zero-upper") // Enable AVX #pragma GCC target("avx2") // Enable AVX #include <bits/stdc++.h> ...
[["+", 0, 7, 8, 1, 0, 11, 12, 16, 17, 109], ["+", 0, 7, 8, 1, 0, 11, 12, 16, 12, 22]]
1
732
#include <bits/stdc++.h> using namespace std; #define REP(i, s) for (int i = 0; i < s; ++i) #define ALL(v) (v).begin(), (v).end() #define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl #define EACH(i, s) \ for (__typeof__((s).begin()...
#include <bits/stdc++.h> using namespace std; #define REP(i, s) for (int i = 0; i < s; ++i) #define ALL(v) (v).begin(), (v).end() #define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl #define EACH(i, s) \ for (__typeof__((s).begin()...
[["+", 0, 1, 0, 11, 12, 16, 12, 16, 17, 109], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 12, 22]]
1
822
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) #define REP(i, k, n) for (long long i = k; i < (long long)(n); i++) #define all(a) a.begin(), a.end() #define pb emplace_back #define eb emplace_back #define lb(v, k) (lower_bound(all(v), k) - v.begin()) #defi...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (long long i = 0; i < (long long)(n); i++) #define REP(i, k, n) for (long long i = k; i < (long long)(n); i++) #define all(a) a.begin(), a.end() #define pb emplace_back #define eb emplace_back #define lb(v, k) (lower_bound(all(v), k) - v.begin()) #defi...
[["-", 0, 7, 8, 9, 0, 1, 0, 11, 17, 108], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 31, 22], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 48], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
1,031
#include <bits/stdc++.h> using namespace std; #define int long long const int p = 998244353; const int maxn = 3e3 + 5; int dp[maxn][maxn]; int po(int a, int b) { if (b == 0) return 1; if (b == 1) return a; if (b % 2 == 0) { int u = po(a, b / 2); return (u * u) % p; } if (b % 2 == 1) { int...
#include <bits/stdc++.h> using namespace std; #define int long long const int p = 998244353; const int maxn = 3e3 + 5; int dp[maxn][maxn]; int po(int a, int b) { if (b == 0) return 1; if (b == 1) return a; if (b % 2 == 0) { int u = po(a, b / 2); return (u * u) % p; } if (b % 2 == 1) { int...
[["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 16, 12, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 25], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 12, 22]]
1
344
#include <algorithm> #include <iostream> #include <vector> int const nmax = 3000; int const modulo = 998244353; int dp[5 + nmax][5 + nmax]; int main() { int n, m, q, p; std::cin >> n >> m >> p >> q; dp[p][q] = 1; for (int i = p; n <= i; i--) for (int j = q; m <= j; j--) dp[i][j] += (modulo + 1LL * ...
#include <algorithm> #include <iostream> #include <vector> int const nmax = 3000; int const modulo = 998244353; int dp[5 + nmax][5 + nmax]; int main() { int n, m, q, p; std::cin >> n >> m >> p >> q; dp[p][q] = 1; for (int i = p; n <= i; i--) for (int j = q; m <= j; j--) dp[i][j] += (modulo + 1LL * ...
[["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 22]]
1
170
mod = 998244353 a, b, c, d = map(int, input().split()) dp0 = [0] * (c-a+1) dp1 = [1] for i in range(c-a): dp1.append(dp1[-1] * b % mod) for j in range(1, d-b+1): new_dp0 = [(dp0[0] * a + dp1[0]) % mod] new_dp1 = [dp1[0] * (a-1) % mod] for i in range(1, c-a+1): new_dp0.append((dp0[i] * (a+i) +...
mod = 998244353 a, b, c, d = map(int, input().split()) dp0 = [0] * (c-a+1) dp1 = [1] for i in range(c-a): dp1.append(dp1[-1] * b % mod) for j in range(1, d-b+1): new_dp0 = [(dp0[0] * a + dp1[0]) % mod] new_dp1 = [dp1[0] * (a-1) % mod] for i in range(1, c-a+1): new_dp0.append((dp0[i] * (a+i) + ...
[["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 25], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]]
5
198
/* Name: Author: xiaruize Date: */ #pragma GCC optimize(2) #include <bits/stdc++.h> using namespace std; #define ull unsigned long long #define MOD 998244353 #define ALL(a) (a).begin(), (a).end() #define forn(i, n) for (int i = 0; i < int(n); i++) #define ll long long #define form(i, j, n) for (...
/* Name: Author: xiaruize Date: */ #pragma GCC optimize(2) #include <bits/stdc++.h> using namespace std; #define ull unsigned long long #define MOD 998244353 #define ALL(a) (a).begin(), (a).end() #define forn(i, n) for (int i = 0; i < int(n); i++) #define ll long long #define form(i, j, n) for (...
[["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78], ["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
347
#include <bits/stdc++.h> using namespace std; typedef long long ll; // int:2*10**9 typedef long double ld; typedef pair<ll, ll> P; #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPS(i, n) for (ll i = 1; i <= (ll)(n); i++) #define REPD(i, n) for (ll i = (ll)(n)-1; i >= 0; i--) #define FOR(i, a, b) for (ll i...
#include <bits/stdc++.h> using namespace std; typedef long long ll; // int:2*10**9 typedef long double ld; typedef pair<ll, ll> P; #define REP(i, n) for (ll i = 0; i < (ll)(n); i++) #define REPS(i, n) for (ll i = 1; i <= (ll)(n); i++) #define REPD(i, n) for (ll i = (ll)(n)-1; i >= 0; i--) #define FOR(i, a, b) for (ll i...
[["-", 36, 36, 36, 36, 0, 30, 0, 58, 51, 59], ["-", 36, 36, 36, 36, 0, 30, 0, 58, 0, 148], ["-", 36, 36, 36, 36, 0, 30, 0, 58, 141, 22]]
1
429
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using vvl = vector<vl>; using vb = vector<bool>; using vvb = vector<vb>; using pii = pair<int, int>; using pli = pair<ll, int>; using pll = pair<ll, ll>; using vpii = vector<pii>; u...
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vi>; using vl = vector<ll>; using vvl = vector<vl>; using vb = vector<bool>; using vvb = vector<vb>; using pii = pair<int, int>; using pli = pair<ll, int>; using pll = pair<ll, ll>; using vpii = vector<pii>; u...
[["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
405
#include <algorithm> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unordered_map> #include <utility> #include <vector> long long dp[3004][3004]; int main() { int A, B, C, D; ...
#include <algorithm> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stack> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unordered_map> #include <utility> #include <vector> long long dp[3004][3004]; int main() { int A, B, C, D; ...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 20], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 47], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
362
#pragma GCC optimize("O2") #pragma GCC target("avx2") //#include<bits/stdc++.h> #include <algorithm> #include <iostream> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i <= (n); i++) #define co(x) cout << (x) << "\n" #define cosp(x) cout << ...
#pragma GCC optimize("O2") #pragma GCC target("avx2") //#include<bits/stdc++.h> #include <algorithm> #include <iostream> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i <= (n); i++) #define co(x) cout << (x) << "\n" #define cosp(x) cout << ...
[["-", 12, 16, 31, 2, 3, 4, 0, 16, 17, 72], ["-", 12, 16, 31, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["+", 0, 16, 31, 23, 0, 16, 12, 16, 17, 48]]
1
332
#include <bits/stdc++.h> #define pb push_back #define fi first #define se second #define eb emplace_back using namespace std; typedef pair<int, int> ii; typedef long long ll; const int M = 998244353; ll memo[3007][3007][2]; int n, m; int a, b, c, d; ll solve(int a, int b, int last = 0) { if (a == n and b == m) ...
#include <bits/stdc++.h> #define pb push_back #define fi first #define se second #define eb emplace_back using namespace std; typedef pair<int, int> ii; typedef long long ll; const int M = 998244353; ll memo[3007][3007][2]; int n, m; int a, b, c, d; ll solve(int a, int b, int last = 0) { if (a == n and b == m) ...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 355], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 355], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22]]
1
361
#include <bits/stdc++.h> #define LOCAL using namespace std; #define X first #define Y second #define pb push_back #define mp make_pair #define all(a) a.begin(), a.end() #define rep(i, st, n) for (int i = (st); i < (n); ++i) #define repinv(i, st, n) for (int i = ((n)-1); i >= (st); --i) #define MEM(a, b) memset(a, b, s...
#include <bits/stdc++.h> #define LOCAL using namespace std; #define X first #define Y second #define pb push_back #define mp make_pair #define all(a) a.begin(), a.end() #define rep(i, st, n) for (int i = (st); i < (n); ++i) #define repinv(i, st, n) for (int i = ((n)-1); i >= (st); --i) #define MEM(a, b) memset(a, b, s...
[["+", 12, 16, 12, 16, 31, 16, 31, 16, 17, 109], ["+", 12, 16, 12, 16, 31, 16, 31, 16, 12, 22], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 17, 109], ["+", 0, 1, 0, 11, 12, 16, 12, 16, 12, 22]]
1
715
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll P = 998244353; ll DP[3001][3001] = {0}; int main() { int A, B, C, D; std::cin >> A >> B >> C >> D; DP[A][B] = 1; for (int a = A + 1; a <= C; a++) DP[a][B] = DP[a - 1][B] * B % P; for (int b = B + 1; b <= D; b++) DP[A][b] = DP[A]...
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll P = 998244353; ll DP[3001][3001] = {0}; int main() { int A, B, C, D; std::cin >> A >> B >> C >> D; DP[A][B] = 1; for (int a = A + 1; a <= C; a++) DP[a][B] = DP[a - 1][B] * B % P; for (int b = B + 1; b <= D; b++) DP[A][b] = DP[A]...
[["+", 31, 23, 0, 16, 31, 16, 31, 16, 31, 22], ["+", 31, 23, 0, 16, 31, 16, 31, 16, 17, 72], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 22]]
1
253
#include <bits/stdc++.h> using namespace std; long long mod = 998244353; int main() { long long A, B, C, D; cin >> A >> B >> C >> D; C = C - A; D = D - B; vector<vector<long long>> dp(C + 1, vector<long long>(D + 1, 0)); dp[C][D] = 1; long long kp; for (int i = C - 1; i >= 0; i--) { kp = 0; ...
#include <bits/stdc++.h> using namespace std; long long mod = 998244353; int main() { long long A, B, C, D; cin >> A >> B >> C >> D; C = C - A; D = D - B; vector<vector<long long>> dp(C + 1, vector<long long>(D + 1, 0)); dp[C][D] = 1; long long kp; for (int i = C - 1; i >= 0; i--) { kp = 0; ...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
359
#include <algorithm> #include <climits> #include <iostream> using namespace std; // 入力 long long a, b, c, d; long long p, q, r; long long mod = 998244353; long long dp[3001][3001][2]; int main() { cin >> a >> b >> c >> d; dp[a][b][0] = 1; for (int j = b + 1; j <= d; ++j) { dp[a][j][0] = dp[a][j - 1][0] *...
#include <algorithm> #include <climits> #include <iostream> using namespace std; // 入力 long long a, b, c, d; long long p, q, r; long long mod = 998244353; long long dp[3001][3001][2]; int main() { cin >> a >> b >> c >> d; dp[a][b][0] = 1; for (int j = b + 1; j <= d; ++j) { dp[a][j][0] = dp[a][j - 1][0] *...
[["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25]]
1
333
#include <bits/stdc++.h> const int mod = 998244353; const int max_N = 3005; using LL = long long; int A, B, C, D; LL dp[max_N][max_N]; int main() { scanf("%d%d%d%d", &A, &B, &C, &D); dp[A][B] = 1; for (int i = A; i <= C; ++i) { for (int j = B; j <= D; ++j) { if (i == A && j == B) { continu...
#include <bits/stdc++.h> const int mod = 998244353; const int max_N = 3005; using LL = long long; int A, B, C, D; LL dp[max_N][max_N]; int main() { scanf("%d%d%d%d", &A, &B, &C, &D); dp[A][B] = 1; for (int i = A; i <= C; ++i) { for (int j = B; j <= D; ++j) { if (i == A && j == B) { continu...
[["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 24], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 17, 72], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 25], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 109], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22]]
1
195
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define int ll typedef vector<int> vi; #define endl '\n' #define fo(i, a, b) for (int i = a; i <= b; i++) #define rf(i, a, b) for (int i = a; i >= b; i--) #define fast_io ios_base::sync_with_stdio(0); #define show(x) cout << x << endl; #define pret(x) ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define int ll typedef vector<int> vi; #define endl '\n' #define fo(i, a, b) for (int i = a; i <= b; i++) #define rf(i, a, b) for (int i = a; i >= b; i--) #define fast_io ios_base::sync_with_stdio(0); #define show(x) cout << x << endl; #define pret(x) ...
[["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 2, 3, 4, 0, 25], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 17, 72], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 109], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 22]]
1
294
#include <bits/stdc++.h> using namespace std; #define int long long int dp[3006][3006]; #define mod 998244353 int a, b, c, d; int f(int x, int y) { if (dp[x][y] != -1) return dp[x][y]; if (x == a) { if (y == b) { return dp[x][y] = 1; } else return dp[x][y] = (f(x, y - 1) * x) % mod; } el...
#include <bits/stdc++.h> using namespace std; #define int long long int dp[3006][3006]; #define mod 998244353 int a, b, c, d; int f(int x, int y) { if (dp[x][y] != -1) return dp[x][y]; if (x == a) { if (y == b) { return dp[x][y] = 1; } else return dp[x][y] = (f(x, y - 1) * x) % mod; } el...
[["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 2, 3, 4, 0, 25], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]]
1
278
#include <bits/stdc++.h> #define MAXN 3007 #define MOD 998244353 using namespace std; long long dp[MAXN][MAXN]; int main() { int a, b, c, d; cin >> a >> b >> c >> d; dp[a][b] = 1; for (int i = a; i <= c; i++) for (int j = b; j <= d; j++) if (a != i || b != j) dp[i][j] = (i * dp[i][j - 1] + j *...
#include <bits/stdc++.h> #define MAXN 3007 #define MOD 998244353 using namespace std; long long dp[MAXN][MAXN]; int main() { int a, b, c, d; cin >> a >> b >> c >> d; dp[a][b] = 1; for (int i = a; i <= c; i++) for (int j = b; j <= d; j++) if (a != i || b != j) dp[i][j] = (i * dp[i][j - 1] + j *...
[["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["-", 12, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["-", 12, 16, 31, 16, 12, 23, 0, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 23, 0, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25], ["+", 31, 23, 0, 16, 31, 16, 12, 16, 17, 109], ...
1
167
#include <bits/stdc++.h> using namespace std; #define int long long int mod = 998244353; int dp[3005][3005]; main() { #ifdef HOME freopen("input.txt", "r", stdin); #endif // HOME ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int a, b, c, d; cin >> a >> b >> c >> d; dp[a][b] = 1; for (int i =...
#include <bits/stdc++.h> using namespace std; #define int long long int mod = 998244353; int dp[3005][3005]; main() { #ifdef HOME freopen("input.txt", "r", stdin); #endif // HOME ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int a, b, c, d; cin >> a >> b >> c >> d; dp[a][b] = 1; for (int i =...
[["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 31, 22], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 48], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 22]]
1
216
/* be name khoda */ // #define long_enable #include <algorithm> #include <cstring> #include <fstream> #include <iostream> #include <map> #include <numeric> #include <set> #include <vector> using namespace std; #ifdef long_enable typedef long long int ll; #else typedef int ll; #endif typedef pair<ll, ll> pii; typedef...
/* be name khoda */ // #define long_enable #include <algorithm> #include <cstring> #include <fstream> #include <iostream> #include <map> #include <numeric> #include <set> #include <vector> using namespace std; #ifdef long_enable typedef long long int ll; #else typedef int ll; #endif typedef pair<ll, ll> pii; typedef...
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
613
/* Loading:{ https://codeforces.com/problemset/problem/1234/F https://atcoder.jp/contests/agc046/tasks/agc046_c } */ #include <bits/stdc++.h> using namespace std; #define ll long long #define endl '\n' const int N = 1e6 + 5; ll a[305]; ll dp[305][305][305]; // id, used to donate, used to receive; ll m...
/* Loading:{ https://codeforces.com/problemset/problem/1234/F https://atcoder.jp/contests/agc046/tasks/agc046_c } */ #include <bits/stdc++.h> using namespace std; #define ll long long #define endl '\n' const int N = 1e6 + 5; ll a[305]; ll dp[305][305][305]; // id, used to donate, used to receive; ll m...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["-", 0, 30, 0, 43, 49, 50, 51, 16, 17, 72], ["-", 0, 30, 0, 43, 49, 50, 51, 16, 12, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13]]
1
615
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stack> #include <stdio.h> #include <string> #include <unor...
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cstdio> #include <cstdlib> #include <cstring> #include <deque> #include <iostream> #include <map> #include <math.h> #include <queue> #include <random> #include <set> #include <stack> #include <stdio.h> #include <string> #include <unor...
[["-", 0, 7, 8, 9, 0, 7, 15, 16, 17, 19], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 22]]
1
841
#include <algorithm> #include <cassert> #include <cstdio> #include <iostream> #include <numeric> #include <set> #include <string> #include <utility> #include <vector> using namespace std; const int mod = (int)1e9 + 7; // a^n % mod long long modpow(long long a, long long n, long long mod) { long long ret = 1; wh...
#include <algorithm> #include <cassert> #include <cstdio> #include <iostream> #include <numeric> #include <set> #include <string> #include <utility> #include <vector> using namespace std; const int mod = (int)1e9 + 7; // a^n % mod long long modpow(long long a, long long n, long long mod) { long long ret = 1; wh...
[["+", 0, 11, 12, 16, 31, 16, 31, 16, 17, 109], ["+", 0, 11, 12, 16, 31, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22]]
1
511
#include <bits/stdc++.h> using namespace std; const long long md = 1e9 + 7; long long pw(long long x, long long y) { long long ans = 1; while (y) { if (y & 1) { ans *= x; ans %= md; } x *= x; x %= md; y >>= 1; } return ans; } long long ff[2020202], fff[2020202], n, ans; string s;...
#include <bits/stdc++.h> using namespace std; const long long md = 1e9 + 7; long long pw(long long x, long long y) { long long ans = 1; while (y) { if (y & 1) { ans *= x; ans %= md; } x *= x; x %= md; y >>= 1; } return ans; } long long ff[2020202], fff[2020202], n, ans = 1; strin...
[["+", 36, 36, 0, 30, 0, 43, 49, 50, 0, 32], ["+", 36, 36, 0, 30, 0, 43, 49, 50, 51, 13]]
1
312
#include <algorithm> #include <bitset> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <unordered_set> #include <vector> using namespace std; using ll = long long; using ull = unsigned long long; ...
#include <algorithm> #include <bitset> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <random> #include <set> #include <unordered_set> #include <vector> using namespace std; using ll = long long; using ull = unsigned long long; ...
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
1,032
#include <bits/stdc++.h> using namespace std; const int N = 2000005; const long long int mod = 1e9 + 7; long long int f[N], inv[N], p[N], q[N], ans = 0; long long int modpow(long long int x, long long int n) { long res = 1; for (; n > 0; n >>= 1) { if (n & 1) res = res * x % mod; x = x * x % mod; ...
#include <bits/stdc++.h> using namespace std; const int N = 2000005; const long long int mod = 1e9 + 7; long long int f[N], inv[N], p[N], q[N], ans = 0; long long int modpow(long long int x, long long int n) { long res = 1; for (; n > 0; n >>= 1) { if (n & 1) res = res * x % mod; x = x * x % mod; ...
[["+", 31, 16, 31, 69, 341, 342, 0, 16, 31, 22], ["+", 31, 16, 31, 69, 341, 342, 0, 16, 17, 33], ["-", 31, 16, 12, 69, 341, 342, 0, 16, 31, 22], ["-", 31, 16, 12, 69, 341, 342, 0, 16, 17, 33]]
1
360
#include <algorithm> #include <iostream> #include <math.h> #include <stdlib.h> #include <string> #define ll long long using namespace std; const ll mod = 1000000007; const ll maxn = 2000005; ll fun[maxn]; ll infun[maxn]; ll qp(ll a, ll b) { ll res = 1; a %= mod; if (a == 0) return 0; while (b) { if (...
#include <algorithm> #include <iostream> #include <math.h> #include <stdlib.h> #include <string> #define ll long long using namespace std; const ll mod = 1000000007; const ll maxn = 2000005; ll fun[maxn]; ll infun[maxn]; ll qp(ll a, ll b) { ll res = 1; a %= mod; if (a == 0) return 0; while (b) { if (...
[["+", 0, 11, 12, 16, 31, 16, 12, 23, 0, 24], ["+", 0, 11, 12, 16, 31, 16, 12, 23, 0, 25]]
1
410
K = int(input()) S = input() m = 1000000007 result = 0 t = pow(26, K, m) u = pow(26, -1, m) * 25 % m l = len(S) for i in range(K + 1): # result += pow(26, K - i, m) * mcomb(len(S) - 1 + i, i) * pow(25, i, m) result += (result + t) % m t = (t * u) % m * (l + i) %m * pow(i + 1, -1, m) % m print(result)
K = int(input()) S = input() m = 1000000007 result = 0 t = pow(26, K, m) u = pow(26, m - 2, m) * 25 % m l = len(S) for i in range(K + 1): # result += pow(26, K - i, m) * mcomb(len(S) - 1 + i, i) * pow(25, i, m) result = (result + t) % m t = (t * u) % m * (l + i) % m * pow(i + 1, m - 2, m) % m print(result...
[["+", 31, 657, 31, 652, 3, 4, 0, 657, 31, 22], ["-", 31, 657, 31, 652, 3, 4, 0, 664, 28, 612], ["+", 31, 657, 31, 652, 3, 4, 0, 657, 12, 612], ["-", 0, 7, 8, 196, 0, 1, 0, 677, 17, 107], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 31, 657, 12, 652, 3, 4, 0, 657, 31, 22], ["-", 31, 657, 12, 652, 3, 4, 0, 664, 28, 6...
5
105
K = int(input()) S = input() m = 1000000007 result = 0 t = pow(26, K, m) u = pow(26, -1, m) * 25 % m l = len(S) for i in range(K + 1): # result += pow(26, K - i, m) * mcomb(len(S) - 1 + i, i) * pow(25, i, m) result += (result + t) % m t = (t * u) % m * (l + i) %m * pow(i + 1, -1, m) % m print(result)
K = int(input()) S = input() m = 1000000007 result = 0 t = pow(26, K, m) u = pow(26, -1, m) * 25 % m l = len(S) for i in range(K + 1): # result += pow(26, K - i, m) * mcomb(len(S) - 1 + i, i) * pow(25, i, m) result = (result + t) % m t = (t * u) % m * (l + i) * pow(i + 1, -1, m) % m print(result)
[["-", 0, 7, 8, 196, 0, 1, 0, 677, 17, 107], ["+", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["-", 0, 662, 12, 657, 31, 657, 31, 657, 17, 109], ["-", 0, 662, 12, 657, 31, 657, 31, 657, 12, 22]]
5
105
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define INF 1LL << 62 #define inf 1000000007 const int MAX = 510000; const int MOD = 1000000007; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define INF 1LL << 62 #define inf 1000000007 const int MAX = 5100000; const int MOD = 1000000007; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2;...
[["-", 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, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
410
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readline mod = 10 ** 9 +7 K = int(readline()) S = readline().decode() s = len(S)-1 ### nCrの前処理 n = s+K fact = [1] * (n+1) fact_inv = [1] * (n+1) for i in range(1,n+1): fact[i] = fact[i-1] * i % mod fact...
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines mod = 10 ** 9 +7 K = int(readline()) S = readline().decode().rstrip() s = len(S)-1 n = s+K fact = [1] * (n+1) fact_inv = [1] * (n+1) for i in range(1,n+1): fact[i] = fact[i-1] * i % mod fact_i...
[["-", 0, 656, 0, 1, 0, 662, 12, 319, 319, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 319, 319, 22], ["+", 12, 652, 63, 319, 500, 652, 3, 4, 0, 24], ["+", 12, 652, 63, 319, 500, 652, 3, 4, 0, 25], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 0, 131], ["+", 0, 1, 0, 662, 12, 652, 63, 319, 319, 22]]
5
247
import sys,bisect,string,math,time,functools,random,fractions from heapq import heappush,heappop,heapify from collections import deque,defaultdict,Counter from itertools import permutations,combinations,groupby rep=range def Golf():n,*t=map(int,open(0).read().split()) def I():return int(input()) def S_():return input()...
import sys,bisect,string,math,time,functools,random,fractions from heapq import heappush,heappop,heapify from collections import deque,defaultdict,Counter from itertools import permutations,combinations,groupby rep=range def Golf():n,*t=map(int,open(0).read().split()) def I():return int(input()) def S_():return input()...
[["-", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 662, 12, 652, 3, 4, 0, 657, 12, 612]]
5
2,756
#include <bits/stdc++.h> #define ll long long #define ld long double using namespace std; const int maxn = 1e7 + 5; const ll mod = 1e9 + 7; const ll inf = 0x3f3f3f3f; const ld pi = acos(-1.0); ll F[maxn], Finv[maxn], inv[maxn]; // F是阶乘,Finv是阶乘的逆元 void init() { F[0] = Finv[0] = inv[1] = 1; for (int i = 2; i < maxn;...
#include <bits/stdc++.h> #define ll long long #define ld long double using namespace std; const int maxn = 2e6 + 5; const ll mod = 1e9 + 7; const ll inf = 0x3f3f3f3f; const ld pi = acos(-1.0); ll F[maxn], Finv[maxn], inv[maxn]; // FÊǽ׳ˣ¬FinvÊǽ׳˵ÄÄæÔª void init() { F[0] = Finv[0] = inv[1] = 1; for (int i = 2;...
[["-", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["+", 0, 30, 0, 43, 49, 50, 51, 16, 31, 13], ["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 78], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25]]
1
438
#define _CRT_SECURE_NO_WARNINGS #pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <ctime> #include <deque> #include <fstream> #include <func...
#define _CRT_SECURE_NO_WARNINGS #pragma GCC target("avx") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include <algorithm> #include <bitset> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <ctime> #include <deque> #include <fstream> #include <func...
[["+", 31, 16, 31, 16, 31, 16, 31, 16, 17, 109], ["+", 31, 16, 31, 16, 31, 16, 31, 16, 12, 22]]
1
8,997
mod = 10**9 + 7 K = int(input()) S = input() n = len(S) tmp = pow(26, K, mod) waru = pow(26, -1, mod) ans = tmp for i in range(1, K+1): tmp = (tmp * 25 // waru)%mod tmp = (tmp * (i + n -1) // pow(i, -1, mod))%mod ans = (ans+tmp)%mod print(ans%mod)
mod = 10**9 + 7 K = int(input()) S = input() n = len(S) tmp = pow(26, K, mod) waru = pow(26, -1, mod) ans = tmp for i in range(1, K+1): tmp = (tmp * 25 * waru)%mod tmp = (tmp * (i + n -1) * pow(i, -1, mod))%mod ans = (ans+tmp)%mod print(ans%mod)
[["-", 0, 662, 12, 657, 31, 23, 0, 657, 17, 676], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 17, 48]]
5
113
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using vll = vector<ll>; using vi = vector<int>; using vb = vector<bool>; using vs = vector<string>; using pll = pair<ll, ll>; using pii = pair<int, int>; using vpii = vector<pii>; using vpll = vector<pll>; const ll LIN...
#include <bits/stdc++.h> using namespace std; using ll = long long; using ull = unsigned long long; using vll = vector<ll>; using vi = vector<int>; using vb = vector<bool>; using vs = vector<string>; using pll = pair<ll, ll>; using pii = pair<int, int>; using vpii = vector<pii>; using vpll = vector<pll>; const ll LIN...
[["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 78]]
1
1,841
#include <bits/stdc++.h> using namespace std; const int MAX = 5100000; const int MOD = 1000000007; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MO...
#include <bits/stdc++.h> using namespace std; const int MAX = 5100000; const int MOD = 1000000007; long long fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++) { fac[i] = fac[i - 1] * i % MOD; inv[i] = MO...
[["+", 0, 1, 0, 11, 12, 16, 31, 16, 17, 109], ["+", 0, 1, 0, 11, 12, 16, 31, 16, 12, 22]]
1
390