prompt
string
response
string
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const long long mod = 1e9 + 7; long long n, m; long long qpow(long long a, long long b) { long long ans = 1; while (b) { if (b & 1) ans = ans * a % mod; a = a * a % mod; b >>= 1; } return ans; } signed main() { scanf("%lld%lld", &n, &m); cout << (n +...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int size1 = 4e5; const int INF = 1e9; const long long mod = 1e9 + 7; long long binpow(long long a, long long deg) { if (deg == 0) { return 1; } if (deg == 1) { return a % mod; } long long res = binpow(a, deg / 2); res = (res * res) % mod; if (deg...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const long long M = 1e9 + 7; long long n, m; long long ksm(long long x, long long y) { long long ans = 1; for (; y; y >>= 1, x = x * x % M) if (y & 1) (ans *= x) %= M; return ans; } signed main() { scanf("%lld%lld", &n, &m); printf("%lld\n", (n + 1 - ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; inline long long ksm(long long a, long long b) { long long ans = 1ll; while (b) { if (b & 1) (ans *= a) %= 1000000007; (a = a * a) %= 1000000007; b = b >> 1; } return ans; } int main(void) { int n, m; cin >> n >> m; long long ans = ksm(2 * n + 2, m...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> const int mod = 1e9 + 7; inline int read() { register int x = 0, f = 1; register char s = getchar(); while (s > '9' || s < '0') { if (s == '-') f = -1; s = getchar(); } while (s >= '0' && s <= '9') { x = x * 10 + s - '0'; s = getchar(); } return x * f; } inline int...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int Mo = 1e9 + 7; int pwr(int x, int y) { int z = 1; for (; y; y >>= 1, x = (long long)x * x % Mo) if (y & 1) z = (long long)z * x % Mo; return z; } int main() { int n, m; scanf("%d%d", &n, &m); printf("%d\n", (long long)pwr(2 * n + 2, m) * (n - m + 1)...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; int readint() { char c; while (c = getchar(), (c < '0' || c > '9') && c != '-') ; bool flag = (c == '-'); if (flag) c = getchar(); int x = 0; while (c >= '0' && c <= '9') { x = x * 10 + c - 48; c = getchar(); } return flag ? -x : x; } inline stri...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; inline void Read(int &x) { int f = 1; char c = getchar(); x = 0; while (c < '0' || c > '9') { if (c == '-') f = -1; c = getchar(); } while (c >= '0' && c <= '9') { x = (x << 3) + (x << 1) + c - '0'; c = getchar(); } x *= f; } const int p = 10...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const long long inf = 1e18; const long long mod = 1e9 + 7; inline long long read() { long long num = 0, fu = 1; char c = getchar(); while (c != '-' && (c > '9' || c < '0')) c = getchar(); if (c == '-') fu = -1, c = getchar(); while (c >= '0' && c <= '9') num =...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
mod = 1000000007 def power(a, p): res = 1 while p > 0: if p % 2 == 1: res = (res * a) % mod a = (a * a) % mod p //= 2 return res n, m = map(int, input().split()) n += 1 res = (power(n * 2, m - 1)) * (n - m) * 2 print((res % mod))
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; const double eps = 1e-8; const int maxn = 6e5 + 5; const long long mod = 1e9 + 7; inline long long read() { long long ans = 0; char ch = getchar(), last = ' '; while (!isdigit(ch)) { last = ch; ch = getchar(); } while (isdigit(c...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int mod = 1000000007; int ksm(int x, int y) { int re = 1; for (; y; y >>= 1, x = 1LL * x * x % mod) if (y & 1) re = 1LL * re * x % mod; return re; } int n, m, ans; int main() { scanf("%d%d", &n, &m); ans = 1LL * ksm(n + n + 2, m) * (n + 1 - m) % mod * ks...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int mod = 1000000007; inline int qp(int a, int b) { int res = 1; while (b) { if (b & 1) res = 1ll * res * a % mod; a = 1ll * a * a % mod; b >>= 1; } return res; } int main() { int n, m; scanf("%d%d", &n, &m); printf("%d\n", (int)(1ll...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; template <class T> void dbg(const char *xn, T x) { cerr << xn << ": " << x << "\n"; } template <class T, class... TA> void dbg(const char *xn, T x, TA... t) { while (*xn != ',') cerr << *xn++; cerr << ": " << x << ","; dbg(xn + 1, t...); } template <class T> inline ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> inline long long FP(long long x, int k) { long long t = 1; for (; k; k >>= 1, x = x * x % (1000000007)) if (k & 1) t = t * x % (1000000007); return t; } int main() { int n, m; scanf("%d%d", &n, &m); printf("%I64d\n", 1ll * FP(2, m) * FP(n + 1, m - 1) % (1000000007) * ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const long long mod = 1000000007; long long n, m; long long poww(long long a, long long b) { long long ans = 1, base = a; while (b) { if (b & 1) ans = ans * base % mod; base = base * base % mod; b >>= 1; } return ans; } signed main() { scanf("%lld%lld"...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int mod = 1000000007; long long ksm(long long a, long long b) { long long x = 1; while (b != 0) { if (b & 1) { x *= a; x %= mod; } a *= a; a %= mod; b >>= 1; } return x; } int n, m; int main() { cin >> n >> m; long long ans ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> const int mod = 1e9 + 7; int po(int x, int k) { int sum = 1; while (k) { if (k & 1) { sum = 1LL * sum * x % mod; } x = 1LL * x * x % mod; k >>= 1; } return sum; } int main() { int n, m; scanf("%d%d", &n, &m); printf("%d\n", 1LL * po(n + 1, m - 1) * (n - m + 1...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; int md = 1e9 + 7, n, m; int pow(int b, int e) { int rtn = 1; while (e) { if (e & 1) rtn = (long long)rtn * b % md; e /= 2, b = (long long)b * b % md; } return rtn; } int main() { cin >> n >> m; cout << (2 * (n + 1 - m) * (long long)pow(2 * n + 2, m - 1) ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int mo = 1e9 + 7; int n, m, ans; int quick(int x, int y) { if (!y) return 1; int s = quick(x, y >> 1); s = (long long)s * s % mo; if (y & 1) s = (long long)s * x % mo; return s; } int main() { scanf("%d%d", &n, &m); ans = (long long)quick(2 * n + 2, m) *...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const long long mod = 1e9 + 7; long long qmod(long long a, long long b) { long long res = 1; while (b) { if (b & 1) res = res * a % mod; a = a * a % mod; b >>= 1; } return res; } int main() { long long n, m; cin >> n >> m; long long ans = qmod(2, m...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; int read() { int x = 0, pos = 1; char ch = getchar(); for (; !isdigit(ch); ch = getchar()) if (ch == '-') pos = 0; for (; isdigit(ch); ch = getchar()) x = (x << 1) + (x << 3) + ch - '0'; return pos ? x : -x; } const int mod = 1e9 + 7; int n, m; int ksm(int a, ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int p = 1e9 + 7; inline int qpow(int A, int B) { int res = 1; while (B) { if (B & 1) res = (long long)res * A % p; A = (long long)A * A % p, B >>= 1; } return res; } int main() { int n, m; scanf("%d%d", &n, &m); printf("%I64d\n", (long long)qpow(...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int p = 1e9 + 7; template <typename T> inline T read() { register T sum = 0; register char cc = getchar(); int sym = 1; while (cc != '-' && (cc > '9' || cc < '0')) cc = getchar(); if (cc == '-') sym = -1, cc = getchar(); sum = sum * 10 + cc - '0'; cc = g...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> inline int read() { register int x = 0; register int y = 1; register char c = getchar(); while (c < '0' || c > '9') y &= (c != '-'), c = getchar(); while (c >= '0' && c <= '9') x = x * 10 + (c ^ 48), c = getchar(); return y ? x : -x; } inline long long power(long long a, long long b...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; template <typename _T> inline void _DBG(const char *s, _T x) { cerr << s << " = " << x << "\n"; } template <typename _T, typename... args> void _DBG(const char *s, _T x, args... a) { while (*s != ',') cerr << *s++; cerr << " = " << x << ','; _DBG(s + 1, a...); } con...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> namespace Main { namespace Source { static inline const unsigned int qpow(unsigned int b, unsigned int e, const unsigned int mod) { unsigned int r(1); while (e) { if (e bitand 1) r = 1ull * r * b % mod; b = 1ull * b * b % mod, e >>= 1; } ret...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; int n, m; inline long long power(long long x, int k) { register long long ans = 1; while (k) { if (k & 1) ans = x * ans % mod; x = x * x % mod, k >>= 1; } return ans; } int main() { scanf("%d%d", &n, &m); printf("%lld\n", (n + 1 ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int MOD = 1000000007; struct Sync_stdio { Sync_stdio() { cin.tie(NULL); ios_base::sync_with_stdio(false); } } _sync_stdio; struct FAIL { FAIL() { cout << "CHANGE!!!" << "\n"; } }; bool next(vector<int> &v, int m) { int j = v.size() - 1; ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; inline int read() { int out = 0, fh = 1; char jp = getchar(); while ((jp > '9' || jp < '0') && jp != '-') jp = getchar(); if (jp == '-') fh = -1, jp = getchar(); while (jp >= '0' && jp <= '9') out = out * 10 + jp - '0', jp = getchar(); return out * fh; } const i...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int MAXN = 1000005; const int MOD = 1e9 + 7; int n, m; long long Read() { long long x = 0, f = 1; char c = getchar(); while (c > '9' || c < '0') { if (c == '-') f = -1; c = getchar(); } while (c >= '0' && c <= '9') { x = (x * 10) + (c ^ 48); ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; int n, m; long long ans; long long qpow(long long x, int have) { long long rnt = 1; while (have) { if (have & 1) rnt = rnt * x % 1000000007; x = x * x % 1000000007, have >>= 1; } return rnt; } void work() { scanf("%d%d", &n, &m); ans = qpow(2 * (n + 1), ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; inline int read() { char c = getchar(); int x = 0; bool f = 0; for (; !isdigit(c); c = getchar()) f ^= !(c ^ 45); for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48); if (f) x = -x; return x; } struct modint { int x; modint(int o = 0) { x ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; void Print(int _x) { printf("%d\n", _x); } void Print(long long _x) { printf("%lld\n", _x); } template <typename T> void Print(T _a[], int _s, int _t) { for (int i = _s; i <= _t; i++) cout << _a[i] << " "; cout << endl; } struct InputReader { static const int bs = 100...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; const int maxn = 1000000; const long double Pi = acos(-1.0); const double eps = 1e-7; template <class T> void read(T &x) { x = 0; int f = 0; char ch = getchar(); while (!isdigit(ch)) { f |= (ch == '-'); ch = getchar(); } while (i...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const long long mod = 1000000007; inline long long power(long long, long long); int main() { int n, m; scanf("%d %d", &n, &m); printf("%lld\n", power((n + 1) << 1, m) * (n + 1 - m) % mod * power(n + 1, mod - 2) % mod); return 0; } inline long ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int P = 1e9 + 7; int qp(int a, int b) { int r = 1; for (; b; b >>= 1, a = a * 1ll * a % P) if (b & 1) r = r * 1ll * a % P; return r; } int main() { int n, m; scanf("%d%d", &n, &m), printf("%lld", qp(2 * (n + 1), m - 1) * 2ll * (n + 1 - m) % P); r...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; long long n, m, hh, p = 1e9 + 7; long long ksm(long long x, long long y) { int xlh = 1; while (y) { if (y & 1) xlh = xlh * x % p; x = x * x % p; y /= 2; } return xlh; } int main() { scanf("%lld%lld", &n, &m); hh = ksm(2 * (n + 1), m); hh = hh * (n ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int N = 1e6 + 13, P = 1e9 + 7; int n, m; namespace Sub1 { const int NN = 10 + 13; bool vis[NN]; int ans; void dfs(int k) { if (k == m + 1) { ++ans; return; } for (int i = 1; i <= n; ++i) { int l = i, r = i; while (l && vis[l]) --l; while (r <...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int MAXN = 2e6 + 10; const int mod = 1e9 + 7; int n, m; int fpow(int base, int top) { int ret = 1; for (; top; top >>= 1) { if (top & 1) ret = 1ll * ret * base % mod; base = 1ll * base * base % mod; } return ret; } inline void init(void) { scanf("%d%d"...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; template <typename T> T read1() { T t = 0; char k; bool vis = 0; do (k = getchar()) == '-' && (vis = 1); while ('0' > k || k > '9'); while ('0' <= k && k <= '9') t = (t << 3) + (t << 1) + (k ^ '0'), k = getchar(); return vis ? -t : t; } int qkpow(long long...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const long long Mod = 1000000007; int n, m; long long pw(long long x, long long y) { long long res = 1; while (y) { if (y & 1) { res = res * x % Mod; } x = x * x % Mod; y >>= 1; } return res; } int main() { scanf("%d%d", &n, &m); long long ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; long long n, m, ans; int main() { cin >> n >> m; ans = n + 1 - m; for (int i = 1; i <= m; i++) ans = (ans * 2) % 1000000007; for (int i = 1; i < m; i++) ans = (ans * (n + 1)) % 1000000007; cout << ans << endl; }
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int Mod = 1e9 + 7; int add(int a, const int b) { a += b; if (a >= Mod) a -= Mod; return a; } int sub(int a, const int b) { a -= b; if (a < 0) a += Mod; return a; } int mul(const int a, const int b) { return (long long)a * b % Mod; } int power(int x, int cs...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const long long N = 600, mod = 1e9 + 7; long long n, m; long long qpow(long long a, long long b) { long long res = 1; while (b) { if (b & 1) res = res * a % mod; a = a * a % mod; b >>= 1; } return res; } signed main() { scanf("%lld%lld", &n, &m); cou...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int jly = 1000000007; inline int ksm(int u, int v) { int w = 1; for (; v; u = (long long)u * u % jly, v >>= 1) if (v & 1) w = (long long)u * w % jly; return w; } int main() { int n, m; scanf("%d%d", &n, &m); printf("%lld", (long long)(n - m + 1) * ksm(...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; inline int read() { char c; int res = 0, f = 1; while (c = getchar(), !isdigit(c)) if (c == '-') f *= -1; while (isdigit(c)) res = res * 10 + c - '0', c = getchar(); return res * f; } const long long mod = 1e9 + 7; long long n, m; inline long long lpow(long lo...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; inline int read() { int s = 0, w = 1; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') w = -1; ch = getchar(); } while (ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar(); return s * w; } const long long p = 1000000007; long ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; int n, m; inline int pw(int a, int x) { int ans = 1, tmp = a % 1000000007; for (; x; x >>= 1, tmp = (long long)tmp * tmp % 1000000007) if (x & 1) ans = (long long)ans * tmp % 1000000007; return ans; } int main() { scanf("%d%d", &n, &m); int ans = (long long)(n...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; int read() { int s = 0, w = 1; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') w = -1; ch = getchar(); } while (ch >= '0' && ch <= '9') s = (s << 3) + (s << 1) + (ch ^ 48), ch = getchar(); return s * w; } int n, m; int ksm(int x, i...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; long long mmul(long long a, long long b) { return a * b % mod; } long long mpow(long long a, int b) { if (!b) return 1; if (b & 1) return mmul(a, mpow(a, b - 1)); return mpow(mmul(a, a), b / 2); } int main() { int n, m; scanf("%d%d", &m, &...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; long long read() { long long __x = 0, __y = 1; char __c = ' '; while (__c < '0' || __c > '9') { __c = getchar(); if (__c == '-') { __c = getchar(); break; } } while (__c >= '0' && __c <= '9') __x = __x * 10 + __c - '0', __c = getchar(); r...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const long long mod = 1e9 + 7; inline long long Pow(long long a, long long b) { long long Ans = 1; for (; b; b >>= 1) { if (b & 1) Ans = Ans * a % mod; a = a * a % mod; } return Ans; } long long n, m; signed main() { scanf("%lld%lld", &n, &m); printf("%l...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; int read() { int x = 0, f = 1, ch = getchar(); while (!isdigit(ch)) { if (ch == '-') f = -1; ch = getchar(); } while (isdigit(ch)) x = (x << 1) + (x << 3) + ch - '0', ch = getchar(); return x * f; } int n, m; int pw(int a, int b) {...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; int mpow(int x, int n) { int res = 1; while (n) { if (n & 1) res = 1LL * res * x % MOD; x = 1LL * x * x % MOD; n >>= 1; } return res; } int main() { int n, m; scanf("%d%d", &n, &m); int ans = 1LL * mpow(2 * (n + 1), m) * (n...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; inline int read() { int x = 0, f = 1; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); } while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar(); } return x * f; } int pow(int x, int k) {...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const long long mod = 1e9 + 7; long long qmod(long long a, long long b) { long long res = 1; while (b) { if (b & 1) res = res * a % mod; a = a * a % mod; b >>= 1; } return res; } int main() { long long n, m; scanf("%lld %lld", &n, &m); long long an...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> inline long long FP(long long x, int k) { long long t = 1; for (; k; k >>= 1, x = x * x % (1000000007)) if (k & 1) t = t * x % (1000000007); return t; } int main() { int n, m; scanf("%d%d", &n, &m); printf("%I64d\n", 1ll * FP(2, m) * FP(n + 1, m - 1) % (1000000007) * ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; int main() { int m; long long n, ans = 2; cin >> n >> m; for (int i = 1; i < m; i++) { ans = (ans * 2 * (n + 1)) % 1000000007; } ans = (ans * (1 + n - m)) % 1000000007; cout << ans << endl; return 0; }
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; long long read() { long long as = 0, fu = 1; char c = getchar(); while (c < '0' || c > '9') { if (c == '-') fu = -1; c = getchar(); } while (c >= '0' && c <= '9') { as = as * 10 + c - '0'; c = getchar(); } return as * fu; } long long ksm(long l...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int mo = int(1e9) + 7; int quickpow(int x, int k) { int ret = 1; while (k > 0) { if (k & 1) ret = 1ll * ret * x % mo; x = 1ll * x * x % mo; k >>= 1; } return ret; } int n, m; int main() { scanf("%d%d", &n, &m); printf("%I64d\n", 1ll * quickpow(...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; long long fpow(long long a, long long b) { long long x = 1; while (b) { if (1 & b) { (x *= a) %= mod; } (a = (a * a)) %= mod; b = b >> 1; } return x; } int n, m; int main() { cin >> n >> m; long long ans = fpow(2 * ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; void file(string s) { freopen((s + ".in").c_str(), "r", stdin); freopen((s + ".out").c_str(), "w", stdout); } template <typename Tp> void read(Tp &x) { int fh = 1; char c = getchar(); x = 0; while (c > '9' || c < '0') { if (c == '-') { fh = -1; } ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const long long mod = 1e9 + 7; const double PI = acos(-1); const double EPS = 1e-6; const int INF = 0x3f3f3f3f; inline int readint() { int sum = 0; char c = getchar(); bool f = 0; while (c < '0' || c > '9') { if (c == '-') f = 1; c = getchar(); } while (...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> const int MOD = 1000000007; int n, m, ans = 1; inline int qpow(int x, int p) { int ret = 1; while (p) { if (p & 1) ret = 1ll * ret * x % MOD; p >>= 1, x = 1ll * x * x % MOD; } return ret; } int main() { scanf("%d%d", &n, &m); ans = 2 * (n + 1 - m); ans = 1ll * ans * qpow(2...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 50, INF = 0x3f3f3f3f, mod = 1e9 + 7; inline int read() { register int x = 0, w = 1; register char ch = getchar(); for (; ch < '0' || ch > '9'; ch = getchar()) if (ch == '0') w = -1; for (; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; inline long long read() { long long x = 0, w = 1; char ch = getchar(); while (ch > '9' || ch < '0') { if (ch == '-') w = -1; ch = getchar(); } while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar(); return x * w; } inline void write(int x) ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const long long mod = 1e9 + 7; long long ksm(long long x, long long n) { long long ret = 1; while (n) { if (n & 1) ret = ret * x % mod; n >>= 1; x = x * x % mod; } return ret; } long long n, m; int main() { cin >> n >> m; cout << ksm(2LL * (n + 1), m...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> const int mod = 1e9 + 7; int pow(int x, int k) { if (k == 0) return 1; int ans = 1; if (k & 1) ans = x; int y = pow(x, k >> 1); y = 1ll * y * y % mod; return 1ll * y * ans % mod; } int main() { int n, m; scanf("%i%i", &n, &m); printf("%i\n", 1ll * pow(n + 1, m - 1) * (n - m + ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int MOD = 1e9 + 7; int power(int x, int t) { int ret = 1; while (t > 0) { if (t & 1) ret = 1LL * ret * x % MOD; x = 1LL * x * x % MOD; t >>= 1; } return ret; } int main() { int n, m; scanf("%d%d", &n, &m); int ans = 1LL * power(n + 1, m - 1) ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; int read() { char c = getchar(); int x = 0; while (c < '0' || c > '9') c = getchar(); while (c >= '0' && c <= '9') x = x * 10 + c - 48, c = getchar(); return x; } const int mod = 1e9 + 7; int qpow(int x, int y) { int ans = 1; while (y) { if (y & 1) ans = 1...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; void exgcd(int a, int b, int& x, int& y) { if (!b) { x = 1, y = 0; } else { exgcd(b, a % b, y, x); y -= (a / b) * x; } } int inv(int a, int n) { int x, y; exgcd(a, n, x, y); return (x < 0) ? (x + n) : (x); } const int Mod = 1e9 + 7; template <const i...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; void hk() {} long long solve(long long x, int k) { long long t = 1; for (; k; k >>= 1, x = x * x % 1000000007) { if (k % 2 == 1) t = t * x % 1000000007; } return t; } int main() { { int n, m, a, b, c, d, e, f, res; cin >> n >> m; a = solve(2, m); ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; long long n, m; inline long long read() { long long x = 0, f = 1; char ch = getchar(); while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); } while (ch >= '0' && ch <= '9') { x = (x << 3) + (x << 1) + ch - '0'; ch = getchar(); } ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const int mod = 1000000007; long long ksm(long long a, long long b) { long long x = 1; while (b != 0) { if (b & 1) { x *= a; x %= mod; } a *= a; a %= mod; b >>= 1; } return x; } int n, m; int main() { cin >> n >> m; long long ans ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; const long long NNN = 1e9 + 7; long long n, m; long long read() { long long x = 0, t = 1; char c = getchar(); while ((c > '9' || c < '0') && c != '-') c = getchar(); if (c == '-') t = -1, c = getchar(); while (c >= '0' && c <= '9') x = x * 10 + c - 48, c = getchar...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; template <typename T> inline T gi() { T f = 1, x = 0; char c = getchar(); while (c < '0' || c > '9') { if (c == '-') f = -1; c = getchar(); } while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar(); return f * x; } const int INF = 0x3f3f3f3f, N ...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> const int mod = 1e9 + 7; int n, m; inline long long ksm(register int y, register int p) { long long x = y, now = 1; while (p) { if (p & 1) now = now * x % mod; x = x * x % mod, p >>= 1; } return now; } int main() { scanf("%d%d", &n, &m); printf("%lld", ksm(2, m) % mod * ksm(...
Problem: There is an airplane which has n rows from front to back. There will be m people boarding this airplane. This airplane has an entrance at the very front and very back of the plane. Each person has some assigned seat. It is possible for multiple people to have the same assigned seat. The people will then boar...
#include <bits/stdc++.h> using namespace std; template <typename T> inline int Chkmax(T &a, T b) { return a < b ? a = b, 1 : 0; } template <typename T> inline int Chkmin(T &a, T b) { return a > b ? a = b, 1 : 0; } inline void proc_status() { ifstream t("/proc/self/status"); cerr << string(istreambuf_iterator<ch...
Problem: This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each ...
#!/usr/bin/python3 k = int(input()) a = set(map(int, input().split())) c = 1 while len(a) < 25: if c not in a: a.add(c) else: c += 1 b = list(a) b.sort() ans = 0 y = 0 for x in b: ans += x - y - 1 y = x print(ans)
Problem: This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each ...
import java.util.*; import java.io.*; public class Program { public static void main (String[] args) { InputReader in = new InputReader(System.in); OutputWriter out = new OutputWriter(System.out); int n = in.readInt(); int[] a = new int[n]; for (int i=0;i<n;i++) ...
Problem: This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each ...
k = int(input()) r = list(map(int, input().split())) m = max(r) if m < 25: print(0) else: print(m - 25)
Problem: This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each ...
#include <bits/stdc++.h> using namespace std; int bitt = 0; int main() { int n; cin >> n; int maxi = 0; int x; for (int i = 0; i < n; i++) { cin >> x; maxi = max(maxi, x); } cout << max(0, maxi - 25) << endl; }
Problem: This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each ...
import java.io.*; import java.math.BigInteger; import java.util.Arrays; import java.util.Locale; import java.util.StringTokenizer; import java.util.stream.IntStream; import java.util.stream.Stream; public class _Solution implements Runnable { private static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_...
Problem: This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> a; for (int i = 0; i < n; ++i) { int tmp; cin >> tmp; a.push_back(tmp); } sort(a.begin(), a.end()); if (a[n - 1] > 25) cout << a[n - 1] - 25; else cout << 0; }
Problem: This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each ...
k = int(input()) l = [int(i) for i in input().split()] l.sort() s = l[0] - 1 for i in range(1, k): s = s + l[i]-l[i-1]-1 print(max(0, s + k - 25))
Problem: This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each ...
n=int(input()) x=input() a=x.split( ) for i in range(0,n): a[i]=int(a[i]) a.sort() if a[n-1]>25: print(a[n-1]-25) else: print(0)
Problem: This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each ...
n=int(input()) a=list(map(int,input().split())) b=max(a) if b<=25: print(0) else: print(b-25)
Problem: This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each ...
k = input() r = [int(x) for x in raw_input().split(" ")] if max(r) <= 25: print 0 else: print max(r) - 25
Problem: This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each ...
k = int(input()) r = input().split(' ') for i in range(0, k): r[i] = int(r[i]) r.sort() ans = 0 prev = 0 for i in range(0, k - 1): ans += r[i + 1] - r[i] - 1 prev = r[i] ans += r[0] - 1 result = ans - (25 - k) if result <= 0: print(0) else: print(result)
Problem: This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each ...
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; public class A { public static void main(String[] args) throws IOExcepti...
Problem: This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each ...
import java.util.Scanner; import java.util.Vector; public class A { static int max =0; static int K; public static void main(String[] args) { readInput(); answer(); } private static void answer() { if(max<=25) max=25; System.out.println(max-25); } private st...
Problem: This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each ...
n = int(raw_input()) arr = map(int,raw_input().split()) m = max(arr) if m >= 25: print m - 25 else: print 0
Problem: This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each ...
#include <bits/stdc++.h> using namespace std; int main() { int k, x, maxx = 0, i; cin >> k; for (i = 1; i <= k; i++) { cin >> x; if (x > maxx) maxx = x; } if (maxx > 25) cout << (maxx - 25) << endl; else cout << "0" << endl; return 0; }
Problem: This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each ...
#include <bits/stdc++.h> int main() { int N, M = 0; int may = 0; scanf("%d", &N); int aux; for (int i = 0; i < N; i++) { scanf("%d", &aux); if (aux > 25) { may++; if (aux > M) M = aux; } } int r = 0; if (may > 0) { r = M - 25; } printf("%d", r); }
Problem: This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each ...
a = int(input()) c = list(map(int,input().split())) if max(c)-25 < 0: print(0) else: print(max(c)-25)
Problem: This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each ...
import java.util.*; public class Solution { static Scanner sc = new Scanner(System.in); public static int solve() { int n = sc.nextInt(); int max = 0; for(int i=0;i<n;i++) { max = Math.max(max, sc.nextInt()); } return (max <= 25) ? 0 : max-25; } public static void main(String args[]) { System.ou...
Problem: This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each ...
#include <bits/stdc++.h> using namespace std; const long double PI = acos(-1.0); template <typename T> T abs(T x) { return x > 0 ? x : -x; } template <typename T> T sqr(T x) { return x * x; } template <typename T> bool chmin(T &x, T y) { if (x > y) { x = y; return true; } return false; } template <typ...
Problem: This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each ...
input();print(max(0,max(map(int,input().split()))-25))
Problem: This year, as in previous years, MemSQL is inviting the top 25 competitors from the Start[c]up qualification round to compete onsite for the final round. Not everyone who is eligible to compete onsite can afford to travel to the office, though. Initially the top 25 contestants are invited to come onsite. Each ...
n = int(input()) mx = max([int(x) for x in input().split()]) print(max(0, mx - 25))