problem_id stringlengths 6 6 | language stringclasses 2
values | original_status stringclasses 3
values | original_src stringlengths 19 243k | changed_src stringlengths 19 243k | change stringclasses 3
values | i1 int64 0 8.44k | i2 int64 0 8.44k | j1 int64 0 8.44k | j2 int64 0 8.44k | error stringclasses 270
values | stderr stringlengths 0 226k |
|---|---|---|---|---|---|---|---|---|---|---|---|
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPi(i, a, b) for (int i = int(a); i < int(b); i++)
#define MEMS(a, b) memset(a, b, sizeof(a))
#define mp make_pair
template <class T> bool chmax(T &a, const T &b) ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPi(i, a, b) for (int i = int(a); i < int(b); i++)
#define MEMS(a, b) memset(a, b, sizeof(a))
#define mp make_pair
template <class T> bool chmax(T &a, const T &b) ... | insert | 67 | 67 | 67 | 68 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long int ll;
typedef vector<ll> vint;
typedef vector<vector<ll>> vvint;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repf(i, f, n) for (ll i = f; i < n; i++)
#define repr(i, n) for (ll i = n - 1; i >= 0; i--)
#define mp make_pair
#define mt make_tuple
#def... | #include <bits/stdc++.h>
using namespace std;
typedef long int ll;
typedef vector<ll> vint;
typedef vector<vector<ll>> vvint;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repf(i, f, n) for (ll i = f; i < n; i++)
#define repr(i, n) for (ll i = n - 1; i >= 0; i--)
#define mp make_pair
#define mt make_tuple
#def... | insert | 260 | 260 | 260 | 261 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define REP(i, a, n) for (int i = (a); i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define FOR(it, c) \
for (__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).... | #include <bits/stdc++.h>
using namespace std;
#define REP(i, a, n) for (int i = (a); i < (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define FOR(it, c) \
for (__typeof((c).begin()) it = (c).begin(); it != (c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).... | replace | 150 | 151 | 150 | 151 | 0 | |
p02616 | C++ | Runtime Error | /**
* created: 06.07.2020 17:35:12
**/
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using bint = boost::multiprecision::cpp_int;
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s... | /**
* created: 06.07.2020 17:35:12
**/
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using bint = boost::multiprecision::cpp_int;
using namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s... | replace | 128 | 129 | 128 | 129 | 0 | |
p02616 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define rep(i, s, n) for (int i = s; i < n; i++)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define all_acc(x) (x).begin(), (x).end(), 0LL
#define int long long
#define absSort(v) \
sort(a.begin()... | #include <bits/stdc++.h>
#define rep(i, s, n) for (int i = s; i < n; i++)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define all_acc(x) (x).begin(), (x).end(), 0LL
#define int long long
#define absSort(v) \
sort(a.begin()... | insert | 70 | 70 | 70 | 71 | TLE | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long i... | #include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef pair<int, int> pii;
typedef vector<pii> vpii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long i... | replace | 49 | 50 | 49 | 50 | 0 | |
p02616 | C++ | Runtime Error | #ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
// #pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;... | #ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
// #pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;... | replace | 248 | 249 | 248 | 249 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int main() {
long long n, k;
cin >> n >> k;
vector<long long> a(n);
vector<long long> pos; // 0以上の数を受け取る
vector<long long> neg; // 負の値を受け取る
for (long long i = 0; i < n; i++) {
long long x;
cin >> x;
a[i] = x;
if (x ... | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int main() {
long long n, k;
cin >> n >> k;
vector<long long> a(n);
vector<long long> pos; // 0以上の数を受け取る
vector<long long> neg; // 負の値を受け取る
for (long long i = 0; i < n; i++) {
long long x;
cin >> x;
a[i] = x;
if (x ... | replace | 62 | 64 | 62 | 64 | -11 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define F_OR(i, a, b, s) \
for (int i = (a); ((s) > 0 ? i < (b) : i > (b)); i += (s))
#define F_... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define F_OR(i, a, b, s) \
for (int i = (a); ((s) > 0 ? i < (b) : i > (b)); i += (s))
#define F_... | replace | 63 | 65 | 63 | 65 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int N = 200010;
ll a[N];
int n, m;
int main() {
int t;
// while(){
int k;
scanf("%d%d", &n, &k);
vector<ll> v, v1;
ll mod = 1e9 + 7;
for (int i = 0; i < n; ++i) {
scanf("%lld", a + i);
if (a[i] >= 0) ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const int N = 200010;
ll a[N];
int n, m;
int main() {
int t;
// while(){
int k;
scanf("%d%d", &n, &k);
vector<ll> v, v1;
ll mod = 1e9 + 7;
for (int i = 0; i < n; ++i) {
scanf("%lld", a + i);
if (a[i] >= 0) ... | insert | 25 | 25 | 25 | 35 | 0 | |
p02616 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <bitset>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <stdint.h>
#include <string>
#include <tim... | #include <algorithm>
#include <array>
#include <bitset>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <stdint.h>
#include <string>
#include <tim... | replace | 71 | 72 | 71 | 72 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int mod = 1e9 + 7;
int a[111111];
int cmp(int a, int b) { return abs(b) > abs(a); }
int32_t main() {
ios::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
int t, sn = 0;
int n, k;
cin >> n >> k;
sn += n;
bool zero = 0;
fo... | #include <bits/stdc++.h>
#define int long long
using namespace std;
const int mod = 1e9 + 7;
int a[3 * 100000];
int cmp(int a, int b) { return abs(b) > abs(a); }
int32_t main() {
ios::sync_with_stdio(0);
cin.tie(NULL);
cout.tie(NULL);
int t, sn = 0;
int n, k;
cin >> n >> k;
sn += n;
bool zero = 0;
... | replace | 6 | 7 | 6 | 7 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INFLL LLONG_MAX // 9223372036854775807
#define EPS 1e-9
#define rep(i, n) for (ll i = 0, i##_len = (ll)(n); i < i##_len; i++)
#define repf(i, n) for (ll i = 1, i##_len = (ll)(n + 1); i < i##_len; i++)
#define all(v) v.begin(), v.end()
#define... | #include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INFLL LLONG_MAX // 9223372036854775807
#define EPS 1e-9
#define rep(i, n) for (ll i = 0, i##_len = (ll)(n); i < i##_len; i++)
#define repf(i, n) for (ll i = 1, i##_len = (ll)(n + 1); i < i##_len; i++)
#define all(v) v.begin(), v.end()
#define... | replace | 83 | 87 | 83 | 89 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define loop(k) rep(author_is_masa, k)
#define chmin(a, b) \
if ((a)... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define loop(k) rep(author_is_masa, k)
#define chmin(a, b) \
if ((a)... | replace | 91 | 92 | 91 | 92 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// namespace mp = boost::multiprecision;
using namespace std;
const double PI = 3.14159265358979323846;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
// #define rep(i, n) for (ll i = 0; i < (n); ++... | #include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// namespace mp = boost::multiprecision;
using namespace std;
const double PI = 3.14159265358979323846;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
// #define rep(i, n) for (ll i = 0; i < (n); ++... | replace | 116 | 117 | 116 | 117 | -11 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(ri, n) for (int ri = (int)(n - 1); ri >= 0; ri--)
#define rep2(i, x, n) for (int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri, x, n) for (int ri = (int)(n - 1); ri >= (int)(x); ri--)
#define repit(itr, x) for (auto itr = x.b... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(ri, n) for (int ri = (int)(n - 1); ri >= 0; ri--)
#define rep2(i, x, n) for (int i = (int)(x); i < (int)(n); i++)
#define rrep2(ri, x, n) for (int ri = (int)(n - 1); ri >= (int)(x); ri--)
#define repit(itr, x) for (auto itr = x.b... | replace | 87 | 88 | 87 | 88 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
#include <cstring>
#include <iostream>
#define pie acos(-1)
#define si(a) scanf("%d", &a)
#define sii(a, b) scanf("%d %d", &a, &b)
#define siii(a, b, c) scanf("%d %d %d", &a, &b, &c)
#define sl(a) scanf("%lld", ... | #include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
#include <cstring>
#include <iostream>
#define pie acos(-1)
#define si(a) scanf("%d", &a)
#define sii(a, b) scanf("%d %d", &a, &b)
#define siii(a, b, c) scanf("%d %d %d", &a, &b, &c)
#define sl(a) scanf("%lld", ... | replace | 245 | 246 | 245 | 246 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
#define debug(x) \
cout << "DEBUG" \
<< " " << #x << ":" << x << '\n'
#define rep(i, n) \
for (int_... | #include <bits/stdc++.h>
#define debug(x) \
cout << "DEBUG" \
<< " " << #x << ":" << x << '\n'
#define rep(i, n) \
for (int_... | insert | 232 | 232 | 232 | 240 | 0 | |
p02616 | C++ | Runtime Error | #include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#... | #include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#... | replace | 135 | 136 | 135 | 136 | 0 | |
p02616 | Python | Runtime Error | n, k = map(int, input().split())
a = list(map(int, input().split()))
MOD = 10**9 + 7
plus = []
minus = []
zero = []
for i in range(n):
if a[i] < 0:
minus.append(abs(a[i]))
elif a[i] > 0:
plus.append(a[i])
else:
zero.append(0)
len_p = len(plus)
len_m = len(minus)
len_z = len(zero)
... | n, k = map(int, input().split())
a = list(map(int, input().split()))
MOD = 10**9 + 7
plus = []
minus = []
zero = []
for i in range(n):
if a[i] < 0:
minus.append(abs(a[i]))
elif a[i] > 0:
plus.append(a[i])
else:
zero.append(0)
len_p = len(plus)
len_m = len(minus)
len_z = len(zero)
... | insert | 56 | 56 | 56 | 58 | 0 | |
p02616 | Python | Runtime Error | N, K = map(int, input().split())
A = tuple(map(int, input().split()))
MOD = 10**9 + 7
if K == N:
ans = 1
for x in A:
ans = (ans * x) % MOD
print(ans)
exit()
plus, minus = [], []
for a in A:
if a >= 0:
plus.append(a)
else:
minus.append(a)
plus.sort(reverse=True)
minus.s... | N, K = map(int, input().split())
A = tuple(map(int, input().split()))
MOD = 10**9 + 7
if K == N:
ans = 1
for x in A:
ans = (ans * x) % MOD
print(ans)
exit()
plus, minus = [], []
for a in A:
if a >= 0:
plus.append(a)
else:
minus.append(a)
plus.sort(reverse=True)
minus.s... | insert | 36 | 36 | 36 | 38 | 0 | |
p02616 | Python | Runtime Error | # AFTER EDITORIAL, WIP
def solve(ls, k, debug=0):
modulo = 10**9 + 7
n = len(ls)
n_neg = 0
for i in range(n):
n_neg += ls[i] < 0
n_pos = n - n_neg
# Sort by abs
ls_abs = [abs(x) for x in ls]
ls_abs_argsort = sorted(list(range(n)), key=lambda i: -ls_abs[i])
# Check if posi... | # AFTER EDITORIAL, WIP
def solve(ls, k, debug=0):
modulo = 10**9 + 7
n = len(ls)
n_neg = 0
for i in range(n):
n_neg += ls[i] < 0
n_pos = n - n_neg
# Sort by abs
ls_abs = [abs(x) for x in ls]
ls_abs_argsort = sorted(list(range(n)), key=lambda i: -ls_abs[i])
# Check if posi... | replace | 58 | 60 | 58 | 60 | 0 | |
p02616 | Python | Time Limit Exceeded | import sys
import heapq
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
def main():
N, K = map(int, input().split())
A = list(map(int, input().split()))
MOD = 10**9 + 7
pos = []
neg = []
for a in A:
if a >= 0:
pos.append(a)
else:
neg.append(a)... | import sys
import heapq
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
def main():
N, K = map(int, input().split())
A = list(map(int, input().split()))
MOD = 10**9 + 7
pos = []
neg = []
for a in A:
if a >= 0:
pos.append(a)
else:
neg.append(a)... | replace | 26 | 27 | 26 | 28 | TLE | |
p02616 | Python | Runtime Error | n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
ans = 1
mod = 10**9 + 7
c = 0
z = 0
for i in a:
if i < 0:
c += 1
elif i == 0:
z += 1
if c == n and k & 1:
a.reverse()
for i in range(k):
ans *= -a[i]
ans %= mod
print(-ans % mod)
elif c == n... | n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
ans = 1
mod = 10**9 + 7
c = 0
z = 0
for i in a:
if i < 0:
c += 1
elif i == 0:
z += 1
if c == n and k & 1:
a.reverse()
for i in range(k):
ans *= -a[i]
ans %= mod
print(-ans % mod)
elif c == n... | insert | 23 | 23 | 23 | 28 | 0 | |
p02616 | Python | Runtime Error | MOD = 10**9 + 7
def main():
n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort(key=lambda x: abs(x), reverse=True)
res = 1
if max(a) < 0:
if k % 2 == 1:
for i in range(n - k, n):
res *= a[i]
res %= MOD
else:
... | MOD = 10**9 + 7
def main():
n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort(key=lambda x: abs(x), reverse=True)
res = 1
if k == n:
for e in a:
res *= e
res %= MOD
elif max(a) < 0:
if k % 2 == 1:
for i in range(n ... | replace | 10 | 11 | 10 | 15 | 0 | |
p02616 | Python | Runtime Error | N, K = map(int, input().split())
A = list(map(int, input().split()))
MOD = 10**9 + 7
X = sorted([a for a in A if a > 0])
Y = sorted([a for a in A if a < 0], key=lambda x: abs(x))
if 2 * (min(K, len(Y)) // 2) + len(X) >= K:
ans = 1
if K % 2 == 1:
ans *= X.pop()
K -= 1
XX = [(x1 * x2) for x... | N, K = map(int, input().split())
A = list(map(int, input().split()))
MOD = 10**9 + 7
X = sorted([a for a in A if a >= 0])
Y = sorted([a for a in A if a < 0], key=lambda x: abs(x))
if 2 * (min(K, len(Y)) // 2) + len(X) >= K:
ans = 1
if K % 2 == 1:
ans *= X.pop()
K -= 1
XX = [(x1 * x2) for ... | replace | 4 | 5 | 4 | 5 | 0 | |
p02616 | Python | Runtime Error | N, K = map(int, input().split())
X = list(map(int, input().split()))
MOD = 10**9 + 7
if K % 2 == 1 and all(v < 0 for v in X):
# Minimize abs
X.sort(key=lambda x: -x)
ans = 1
for i in range(K):
ans = ans * X[i] % MOD
print(ans)
else:
pos = sorted(v for v in X if v >= 0)
neg = sorted... | N, K = map(int, input().split())
X = list(map(int, input().split()))
MOD = 10**9 + 7
if K % 2 == 1 and all(v < 0 for v in X):
# Minimize abs
X.sort(key=lambda x: -x)
ans = 1
for i in range(K):
ans = ans * X[i] % MOD
print(ans)
elif K == N:
ans = 1
for i in range(K):
ans = a... | insert | 8 | 8 | 8 | 13 | 0 | |
p02616 | C++ | Runtime Error | #include <algorithm>
#include <cstdio>
#include <iostream>
#define int long long
using namespace std;
typedef long long LL;
const int N = 100010, mod = 1000000007;
int a[N];
signed main() {
int n, k;
scanf("%lld%lld", &n, &k);
for (int i = 0; i < n; i++)
scanf("%lld", &a[i]);
sort(a, a + n);
LL res = ... | #include <algorithm>
#include <cstdio>
#include <iostream>
#define int long long
using namespace std;
typedef long long LL;
const int N = 200010, mod = 1000000007;
int a[N];
signed main() {
int n, k;
scanf("%lld%lld", &n, &k);
for (int i = 0; i < n; i++)
scanf("%lld", &a[i]);
sort(a, a + n);
LL res = ... | replace | 7 | 8 | 7 | 8 | 0 | |
p02616 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef pair<LL, LL> PLL;
typedef vector<PLL> VPLL;
typedef priority_queue... | #include "bits/stdc++.h"
using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef pair<LL, LL> PLL;
typedef vector<PLL> VPLL;
typedef priority_queue... | replace | 121 | 122 | 121 | 124 | 0 | |
p02616 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
#define SZ(a) (int)((a).size())
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<int, int> Pii;
typedef pair<ll, int> Pli;
typedef unsigned long long ul... | #include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
#define SZ(a) (int)((a).size())
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<int, int> Pii;
typedef pair<ll, int> Pli;
typedef unsigned long long ul... | insert | 45 | 45 | 45 | 46 | TLE | |
p02616 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdarg>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
using namespace std;
#define INF 2e9 + 9
#define MOD 1000000007
#define ALL(v) v.begin(), v.end()
#define Int int64_t
#define pll pair<Int, Int>
template <cla... | #include <algorithm>
#include <cmath>
#include <cstdarg>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
using namespace std;
#define INF 2e9 + 9
#define MOD 1000000007
#define ALL(v) v.begin(), v.end()
#define Int int64_t
#define pll pair<Int, Int>
template <cla... | replace | 275 | 276 | 275 | 276 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
typedef long long ll;
vector<ll> v[3];
ll ans = 1;
int K;
ll solve() {
reverse(v[2].begin(), v[2].end());
int cnt1 = 0, cnt2 = 0;
while (cnt1 + 1 < (int)(v[0].size()) && cnt2 + 1 < (int)(v[2].size()) &&
cnt1 + cnt2 + 2 <= K) {
if ... | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
typedef long long ll;
vector<ll> v[3];
ll ans = 1;
int K;
ll solve() {
reverse(v[2].begin(), v[2].end());
int cnt1 = 0, cnt2 = 0;
while (cnt1 + 1 < (int)(v[0].size()) && cnt2 + 1 < (int)(v[2].size()) &&
cnt1 + cnt2 + 2 <= K) {
if ... | replace | 13 | 14 | 13 | 14 | 0 | |
p02616 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <... | #define _CRT_SECURE_NO_WARNINGS
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <... | insert | 238 | 238 | 238 | 240 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int mod = 1e9 + 7;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n, k;
cin >> n >> k;
vector<pair<int, int>> v;
bool ok = false;
int cnt_zero = 0;
for (int i = 0; i < n; i++) {
int a;
... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int mod = 1e9 + 7;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int n, k;
cin >> n >> k;
vector<pair<int, int>> v;
bool ok = false;
int cnt_zero = 0;
for (int i = 0; i < n; i++) {
int a;
... | insert | 75 | 75 | 75 | 82 | 0 | |
p02616 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
vector<ll> a, b, c;
bool cmp(ll a, ll b) { return a > b; }
int main() {
int n, k;
ll x, ans = 1;
cin >> n >> k;
for (int i = 1; i <= n; ++i) {
cin >> x;
if (x > 0)
a.push_... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
vector<ll> a, b, c;
bool cmp(ll a, ll b) { return a > b; }
int main() {
int n, k;
ll x, ans = 1;
cin >> n >> k;
for (int i = 1; i <= n; ++i) {
cin >> x;
if (x > 0)
a.push_... | delete | 81 | 82 | 81 | 81 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define VS vector<string>
#define VB vector<bool>
#define VP vector<pair<ll, ll>>
#define VVL vector<vector<ll>>
#define VVP vector<vector<pair<ll, ll>>... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define VS vector<string>
#define VB vector<bool>
#define VP vector<pair<ll, ll>>
#define VVL vector<vector<ll>>
#define VVP vector<vector<pair<ll, ll>>... | insert | 47 | 47 | 47 | 55 | 0 | exp
|
p02616 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
template <class S, class T>
ostream &op... | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
template <class S, class T>
ostream &op... | replace | 84 | 168 | 84 | 194 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
#define drep(i, cc, n) for (int i = (cc); i <= (n); ++i)
#define rep(i, n) drep(i, 0, n - 1)
#define drrep(i, cc, n) for (int i = (cc); i >= (n); --i)
#define rrep(i, n) drrep(i, 0, n - 1)
#define sz(s) (int)(s.size())
#define vecprint(v) ... | #include <bits/stdc++.h>
#define drep(i, cc, n) for (int i = (cc); i <= (n); ++i)
#define rep(i, n) drep(i, 0, n - 1)
#define drrep(i, cc, n) for (int i = (cc); i >= (n); --i)
#define rrep(i, n) drrep(i, 0, n - 1)
#define sz(s) (int)(s.size())
#define vecprint(v) ... | insert | 132 | 132 | 132 | 138 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
#define REP(k, n) for (ll k = 0; k < (ll)(n); ++k)
#define REPREV(k, n) for (ll k... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
#define REP(k, n) for (ll k = 0; k < (ll)(n); ++k)
#define REPREV(k, n) for (ll k... | insert | 99 | 99 | 99 | 118 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MOD = 1000000007;
// const ll MOD = 998244353;
const ll INF = MOD * MOD;
const long double EPS = 1e-12;
struct mint {
ll x;
mint(ll x = 0) : x((x % MOD + MOD) % MOD) {}
mint operator-() const { return mint(-x); }... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MOD = 1000000007;
// const ll MOD = 998244353;
const ll INF = MOD * MOD;
const long double EPS = 1e-12;
struct mint {
ll x;
mint(ll x = 0) : x((x % MOD + MOD) % MOD) {}
mint operator-() const { return mint(-x); }... | replace | 2,079 | 2,081 | 2,079 | 2,086 | 0 | |
p02616 | C++ | Runtime Error | // https://atcoder.jp/contests/abc173/tasks/abc173_e
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
using P ... | // https://atcoder.jp/contests/abc173/tasks/abc173_e
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
using ll = long long;
using P ... | replace | 203 | 204 | 203 | 204 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll mod = 1000000007;
int main() {
int N, K;
cin >> N >> K;
vector<ll> a, b;
for (int i = 0; i < N; i++) {
int x;
cin >> x;
if (x >= 0)
a.push_back(x);
else
b.push_back(x);
}
sort(a.begin(), a.end(), greater<ll>... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll mod = 1000000007;
int main() {
int N, K;
cin >> N >> K;
vector<ll> a, b;
for (int i = 0; i < N; i++) {
int x;
cin >> x;
if (x >= 0)
a.push_back(x);
else
b.push_back(x);
}
sort(a.begin(), a.end(), greater<ll>... | replace | 60 | 61 | 60 | 62 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, m, n) for (int(i) = (int)(m); i < (int)(n); ++i)
#define rep2(i, m, n) for (int(i) = (int)(n)-1; i >= (int)(m); --i)
#define REP(i, n) rep(i, 0, n)
#define REP2(i, n) rep2(i, 0, n)
#define all(hoge) (hoge).begin(), (hoge).end()
#define en '\n'
using ll = lon... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, m, n) for (int(i) = (int)(m); i < (int)(n); ++i)
#define rep2(i, m, n) for (int(i) = (int)(n)-1; i >= (int)(m); --i)
#define REP(i, n) rep(i, 0, n)
#define REP2(i, n) rep2(i, 0, n)
#define all(hoge) (hoge).begin(), (hoge).end()
#define en '\n'
using ll = lon... | replace | 181 | 182 | 181 | 182 | 0 | |
p02616 | C++ | Runtime Error | #define _USE_MATH_DEFIMES
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <ioman... | #define _USE_MATH_DEFIMES
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <ioman... | replace | 119 | 121 | 119 | 124 | 0 | |
p02616 | C++ | Runtime Error | #include <algorithm>
#include <cassert>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
#d... | #include <algorithm>
#include <cassert>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
#d... | insert | 118 | 118 | 118 | 119 | 0 | |
p02616 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits.h>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <random>
#... | #include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits.h>
#include <map>
#include <math.h>
#include <numeric>
#include <queue>
#include <random>
#... | replace | 216 | 217 | 216 | 217 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using Int = long long; // clang-format off
#define REP_(i, a_, b_, a, b, ...) for (Int i = (a), lim##i = (b); i < lim##i; i++)
#define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
struct SetupIO { SetupIO() { std::cin.tie(nullptr), std::ios::sync_with_stdio(false), std::cout <<... | #include <bits/stdc++.h>
using Int = long long; // clang-format off
#define REP_(i, a_, b_, a, b, ...) for (Int i = (a), lim##i = (b); i < lim##i; i++)
#define REP(i, ...) REP_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
struct SetupIO { SetupIO() { std::cin.tie(nullptr), std::ios::sync_with_stdio(false), std::cout <<... | insert | 120 | 120 | 120 | 122 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
lint Power(lint n, lint x, lint mod) {
if (x == 0)
return 1;
lint res = Power(n, x / 2, mod);
res = res * res % mod;
if (x & 1)
res = res * n % mod;
return res;
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
... | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
lint Power(lint n, lint x, lint mod) {
if (x == 0)
return 1;
lint res = Power(n, x / 2, mod);
res = res * res % mod;
if (x & 1)
res = res * n % mod;
return res;
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
... | replace | 59 | 60 | 59 | 60 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uint = unsigned;
using pcc = pair<char, char>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using tuplis = array<ll, 3>;
template <class T> using p... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uint = unsigned;
using pcc = pair<char, char>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using tuplis = array<ll, 3>;
template <class T> using p... | replace | 554 | 555 | 554 | 555 | 0 | |
p02616 | C++ | Runtime Error | #pragma target("avx")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
constexpr ll INF = 1e9, MOD = 1e9... | #pragma target("avx")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
constexpr ll INF = 1e9, MOD = 1e9... | delete | 140 | 141 | 140 | 140 | 0 | |
p02616 | C++ | Runtime Error | #pragma GCC target("avx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#includ... | #pragma GCC target("avx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#includ... | replace | 227 | 229 | 227 | 231 | 0 | |
p02616 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
const int M = 1000000007;
int main() {
int n, k;
cin >> n >> k;
long long a[n];
for (int i = 0; i < n; i++)
cin >> a[i];
if (n == k) {
long long ans = 1;
for (int i = 0; i < n; i++)
ans = ans * a[i] % M;
i... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
const int M = 1000000007;
int main() {
int n, k;
cin >> n >> k;
long long a[n];
for (int i = 0; i < n; i++)
cin >> a[i];
if (n == k) {
long long ans = 1;
for (int i = 0; i < n; i++)
ans = ans * a[i] % M;
i... | replace | 52 | 58 | 52 | 61 | 0 | |
p02616 | C++ | Runtime Error |
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <iostream>
#include <map>
#include <math.h>
#include <memory.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <vector>
using namespace std... |
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <iostream>
#include <map>
#include <math.h>
#include <memory.h>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <vector>
using namespace std... | replace | 23 | 24 | 23 | 24 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using i128 = boost::multiprecision::int128_t;
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using ld = long double;
using V = vector<int>;
using Vll = vector<ll>;
using Vld = vector<ld>;
using Vbo = vector<bool>;
using VV = v... | #include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// using i128 = boost::multiprecision::int128_t;
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using ld = long double;
using V = vector<int>;
using Vll = vector<ll>;
using Vld = vector<ld>;
using Vbo = vector<bool>;
using VV = v... | replace | 195 | 196 | 195 | 196 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REPR(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define FORR(i, m, n) for (ll i = m; i >= n; i--)
#define REPO(i, n) for (ll i = 1; i <= n; i++)
#define ll long long
#define INF (ll... | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REPR(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define FORR(i, m, n) for (ll i = m; i >= n; i--)
#define REPO(i, n) for (ll i = 1; i <= n; i++)
#define ll long long
#define INF (ll... | replace | 43 | 44 | 43 | 44 | 0 | |
p02616 | C++ | Runtime Error | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<long long> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
long long mod = 1000000007;
vector<long long> b(0), c(0);
for (int i = 0; i < n; i++) {
if (a[i] < 0) {
... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<long long> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
long long mod = 1000000007;
vector<long long> b(0), c(0);
for (int i = 0; i < n; i++) {
if (a[i] < 0) {
... | replace | 49 | 50 | 49 | 50 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <functional>
using namespace std;
using ll = long long;
int main() {
ll n, k;
cin >> n >> k;
if (k == 1) {
ll ans = -1e10;
for (int i = 0; i < n; i++) {
ll x;
cin >> x;
ans = max(ans, x);
}
cout << ans << endl;
return 0;
}
const ll MOD =... | #include <bits/stdc++.h>
#include <functional>
using namespace std;
using ll = long long;
int main() {
ll n, k;
cin >> n >> k;
if (k == 1) {
ll ans = -1e10;
for (int i = 0; i < n; i++) {
ll x;
cin >> x;
ans = max(ans, x);
}
cout << ans << endl;
return 0;
}
const ll MOD =... | insert | 88 | 88 | 88 | 91 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
int main() {
int n, k;
cin >> n >> k;
multiset<long long int> a, b;
for (int i = 0; i < n; i++) {
long long int num;
cin >> num;
if (num >= 0)
a.insert(num);
if (num < 0)
b.insert(-num);
}
int neg... | #include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
int main() {
int n, k;
cin >> n >> k;
multiset<long long int> a, b;
for (int i = 0; i < n; i++) {
long long int num;
cin >> num;
if (num >= 0)
a.insert(num);
if (num < 0)
b.insert(-num);
}
int neg... | replace | 21 | 22 | 21 | 35 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef LOCAL
#include "debug_print.hpp"
#else
void debug(...) {}
#endif
const int mod = 1000000007;
// const int mod = 998244353;
struct mint {
ll x;
ll cnt;
mint(ll x = 0) : x((x % mod + mod) % mod), cnt(0) {}
mint operator-() const { retur... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef LOCAL
#include "debug_print.hpp"
#else
void debug(...) {}
#endif
const int mod = 1000000007;
// const int mod = 998244353;
struct mint {
ll x;
ll cnt;
mint(ll x = 0) : x((x % mod + mod) % mod), cnt(0) {}
mint operator-() const { retur... | replace | 98 | 99 | 98 | 99 | 0 | |
p02616 | C++ | Runtime Error | /*ver 5*/
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
void init() {
cin.tie(0);
ios::sync_... | /*ver 5*/
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
void init() {
cin.tie(0);
ios::sync_... | replace | 273 | 324 | 273 | 320 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define rep2(i, m, n) for (int(i) = (m); (i) < (n); (i)++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
c... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define rep2(i, m, n) for (int(i) = (m); (i) < (n); (i)++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
c... | insert | 91 | 91 | 91 | 96 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
const long long MOD = 1e9 + 7;
const long double Pi = acos(-1);
using P = pair<ll, ll>;
ll gcd(ll a, ll b) { // aとbの最大公約数を返す//計算量は0(log(max(a,b))
if (a % b == 0) {
return b;
} else {
return gcd(b, a % b);
}
}
ll lcm(... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
const long long MOD = 1e9 + 7;
const long double Pi = acos(-1);
using P = pair<ll, ll>;
ll gcd(ll a, ll b) { // aとbの最大公約数を返す//計算量は0(log(max(a,b))
if (a % b == 0) {
return b;
} else {
return gcd(b, a % b);
}
}
ll lcm(... | replace | 255 | 263 | 255 | 288 | 0 | |
p02616 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
// #include<unordered_map>
using namespace std;
#define ll long long
#define dd cout << endl
const long long int inf = 1e18 + 7... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
// #include<unordered_map>
using namespace std;
#define ll long long
#define dd cout << endl
const long long int inf = 1e18 + 7... | replace | 58 | 59 | 58 | 59 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for (int i = 0; i < int(N); ++i)
#define rep1(i, N) for (int i = 1; i < int(N); ++i)
#define all(a) (a).begin(), (a).end()
#define print(v) \
{ ... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, N) for (int i = 0; i < int(N); ++i)
#define rep1(i, N) for (int i = 1; i < int(N); ++i)
#define all(a) (a).begin(), (a).end()
#define print(v) \
{ ... | replace | 115 | 116 | 115 | 116 | 0 | |
p02616 | C++ | Runtime Error | #include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define rep3(i, m, n) for (int(i) = m; (i) <= (n); (i)++)
#define rep3rev(i, m, n) for (int(i) = m; (i) >= (n); (i)--)
#define all(a) (a.begin()), (a.end())
#define rall(a) (a.rbegin()), (a.rend())
#define fi first
#defi... | #include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define rep3(i, m, n) for (int(i) = m; (i) <= (n); (i)++)
#define rep3rev(i, m, n) for (int(i) = m; (i) >= (n); (i)--)
#define all(a) (a.begin()), (a.end())
#define rall(a) (a.rbegin()), (a.rend())
#define fi first
#defi... | replace | 68 | 69 | 68 | 69 | 0 | |
p02616 | C++ | Runtime Error | #include <algorithm>
#include <cmath>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace s... | #include <algorithm>
#include <cmath>
#include <cstring>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace s... | replace | 101 | 104 | 101 | 102 | 0 | |
p02616 | C++ | Runtime Error | #include <algorithm>
#include <array>
#include <assert.h>
#include <bitset>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#inclu... | #include <algorithm>
#include <array>
#include <assert.h>
#include <bitset>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#inclu... | replace | 178 | 180 | 178 | 180 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long long ll;
vector<ll> v1, v2, u;
ll n, k, a, cnt1, cnt2, N, MOD = 1000000007, ans = 1;
int main(void) {
cin >> n >> k;
for (int i = 0; i < n; i++) {
cin >> a;
if (a < 0) {
cnt2++;
v2.push_back(-a);
} else {
cn... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long long ll;
vector<ll> v1, v2, u;
ll n, k, a, cnt1, cnt2, N, MOD = 1000000007, ans = 1;
int main(void) {
cin >> n >> k;
for (int i = 0; i < n; i++) {
cin >> a;
if (a < 0) {
cnt2++;
v2.push_back(-a);
} else {
cn... | replace | 22 | 23 | 22 | 23 | 0 | |
p02616 | C++ | Runtime Error | // C++(GCC 9.2.1)
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using P = pair<LL, LL>;
#define repex(i, a, b, c) for (int i = a; i < b; i += c)
#define repx(i, a, b) repex(i, a, b, 1)
#define rep(i, n) repx(i, 0, n)
#define repr(i, a, b) for (int i = a; i >= b; i--)
#define pb push_back
#define a... | // C++(GCC 9.2.1)
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using P = pair<LL, LL>;
#define repex(i, a, b, c) for (int i = a; i < b; i += c)
#define repx(i, a, b) repex(i, a, b, 1)
#define rep(i, n) repx(i, 0, n)
#define repr(i, a, b) for (int i = a; i >= b; i--)
#define pb push_back
#define a... | replace | 184 | 187 | 184 | 190 | 0 | |
p02616 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
/*
... | #include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
/*
... | replace | 185 | 186 | 185 | 186 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;
#define SIZE 100005
struct MOD_INT {
MOD_INT(ll arg_value) {
value = arg_value;
value %=... | #include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;
#define SIZE 200005
struct MOD_INT {
MOD_INT(ll arg_value) {
value = arg_value;
value %=... | replace | 9 | 10 | 9 | 10 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << ": " << (x) << endl
#define INF (int)1e9
#define EPS (double)1e-9
#define MOD ((int)1e9 + 7)
using namespace std;
typedef long long llong;
typedef vector<int> vi;
typedef vector<... | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << ": " << (x) << endl
#define INF (int)1e9
#define EPS (double)1e-9
#define MOD ((int)1e9 + 7)
using namespace std;
typedef long long llong;
typedef vector<int> vi;
typedef vector<... | insert | 40 | 40 | 40 | 48 | 0 | |
p02616 | C++ | Runtime Error | #include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include ... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include ... | replace | 330 | 332 | 330 | 347 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define rep(i, n) repd(i, 0, n)
using namespace std;
using ll = long long;
using ul = unsigned long long;
using ld = long double;
ll mod = 1000000007;
int main() {
ll n, k;
cin >> n >... | #include <bits/stdc++.h>
#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define rep(i, n) repd(i, 0, n)
using namespace std;
using ll = long long;
using ul = unsigned long long;
using ld = long double;
ll mod = 1000000007;
int main() {
ll n, k;
cin >> n >... | replace | 65 | 66 | 65 | 73 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int ll
#define ll long long
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
// #define MOD 998244353
#define MEM_SIZE 101010
#define DEBUG_OUT true
#define ALL(x) (x)... | #include <bits/stdc++.h>
using namespace std;
#define int ll
#define ll long long
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
// #define MOD 998244353
#define MEM_SIZE 101010
#define DEBUG_OUT true
#define ALL(x) (x)... | replace | 192 | 196 | 192 | 201 | 0 | |
p02616 | C++ | Runtime Error | // AtCoder.cpp : このファイルには 'main'
// 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//
// AtCoder.cpp : このファイルには 'main'
// 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//
#ifndef ONLINE_JUDGE
#endif
#define _USE_MATH_DEFINES
#include <math.h>
// #include<cmath>
#include <algorithm>
#include <array>
#include <assert.h>
#include <bitset>
... | // AtCoder.cpp : このファイルには 'main'
// 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//
// AtCoder.cpp : このファイルには 'main'
// 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//
#ifndef ONLINE_JUDGE
#endif
#define _USE_MATH_DEFINES
#include <math.h>
// #include<cmath>
#include <algorithm>
#include <array>
#include <assert.h>
#include <bitset>
... | replace | 358 | 359 | 358 | 359 | 0 | |
p02616 | C++ | Runtime Error | // Let's join Kaede Takagaki Fan Club !!
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> P1;
typedef pair<P,... | // Let's join Kaede Takagaki Fan Club !!
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> P1;
typedef pair<P,... | replace | 132 | 135 | 132 | 139 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define Max(a, b) (a > b ? a : b)
#define Min(a, b) (a < b ? a : b)
#define ii pair<int, int>
#define fi first
#define se second
const int MAX = 200000; // 2 * 10^5
const int MOD = 1000000007; // 10^9 + 7
const int OO = 0x3f3f3f3f; // 0x3f3f3f3f;
... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define Max(a, b) (a > b ? a : b)
#define Min(a, b) (a < b ? a : b)
#define ii pair<int, int>
#define fi first
#define se second
const int MAX = 200000; // 2 * 10^5
const int MOD = 1000000007; // 10^9 + 7
const int OO = 0x3f3f3f3f; // 0x3f3f3f3f;
... | replace | 73 | 74 | 73 | 74 | 0 | |
p02616 | C++ | Runtime Error | #ifdef MY_LOCAL
#define MY_NAMESPACE(ns) namespace ns {
#define MY_NAMESPACE_ }
#define MY_DEBUG(s) s
#else
#define MY_NAMESPACE(ns)
#define MY_NAMESPACE_
#define MY_DEBUG(s)
#endif
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <... | #ifdef MY_LOCAL
#define MY_NAMESPACE(ns) namespace ns {
#define MY_NAMESPACE_ }
#define MY_DEBUG(s) s
#else
#define MY_NAMESPACE(ns)
#define MY_NAMESPACE_
#define MY_DEBUG(s)
#endif
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <... | replace | 113 | 115 | 113 | 114 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define mod 1000000007
#define deb(x) cerr << "\n" << #x << "=" << x << "\n";
#define deb2(x, y) \
cerr << "\n" << #x << "=" << x << "\n" << #y << "=" << y << "\n";
#define w(x) ... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define mod 1000000007
#define deb(x) cerr << "\n" << #x << "=" << x << "\n";
#define deb2(x, y) \
cerr << "\n" << #x << "=" << x << "\n" << #y << "=" << y << "\n";
#define w(x) ... | replace | 59 | 60 | 59 | 60 | 0 | |
p02616 | C++ | Time Limit Exceeded | /// Find the maximum product of subsequences of size k
#include <bits/stdc++.h>
#define ll long long int
#define mod 1000000007
#define pb push_back
#define inf 1000000000000000000
using namespace std;
int main() {
ll i, j, k, n, s = 0;
cin >> n;
cin >> k;
ll K = k;
vector<ll> neg, pos, zero;
vector<pair<l... | /// Find the maximum product of subsequences of size k
#include <bits/stdc++.h>
#define ll long long int
#define mod 1000000007
#define pb push_back
#define inf 1000000000000000000
using namespace std;
int main() {
ll i, j, k, n, s = 0;
cin >> n;
cin >> k;
ll K = k;
vector<ll> neg, pos, zero;
vector<pair<l... | replace | 55 | 56 | 55 | 56 | TLE | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
using LL = long long;
using LD = long double;
using PII = pair<int, int>;
using PLI = pair<long long, int>;
using PLL = pair<long long, long long>;
using TI = tuple<int, int, int>;
mt19937 mrand(random_device{}());
int rnd(int x) { return mrand() % x; }
template <class A, c... | #include <bits/stdc++.h>
using namespace std;
using LL = long long;
using LD = long double;
using PII = pair<int, int>;
using PLI = pair<long long, int>;
using PLL = pair<long long, long long>;
using TI = tuple<int, int, int>;
mt19937 mrand(random_device{}());
int rnd(int x) { return mrand() % x; }
template <class A, c... | replace | 214 | 216 | 214 | 221 | 0 | |
p02616 | C++ | Runtime Error | // g++ -std=c++14 test.cpp -o test.out
#include <algorithm>
#include <bitset>
#include <cassert>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdlib.h>
#include <string.h>
#include <unordered... | // g++ -std=c++14 test.cpp -o test.out
#include <algorithm>
#include <bitset>
#include <cassert>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stack>
#include <stdlib.h>
#include <string.h>
#include <unordered... | replace | 119 | 120 | 119 | 121 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define pli pair<ll, int>
#define pil pair<int, ll>
#define pll pair<ll, ll>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define r... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define pli pair<ll, int>
#define pil pair<int, ll>
#define pll pair<ll, ll>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define r... | replace | 108 | 109 | 108 | 110 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (long long i = 0; i < (n); ++i)
#define orep(i, n) for (long long i = 1; i <= (n); ++i) // one rep
#define drep(i, n) for (long long i = (n)-1; i >= 0; --i) // down rep
#define srep(i, s, t) for (long long i = (s); i < (t); ++i) // set rep
#define rng(x) (x).begin(),... | #include <bits/stdc++.h>
#define rep(i, n) for (long long i = 0; i < (n); ++i)
#define orep(i, n) for (long long i = 1; i <= (n); ++i) // one rep
#define drep(i, n) for (long long i = (n)-1; i >= 0; --i) // down rep
#define srep(i, s, t) for (long long i = (s); i < (t); ++i) // set rep
#define rng(x) (x).begin(),... | replace | 162 | 163 | 162 | 163 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPr(i, n) for (int i = (n)-1; i >= 0; --i)
#define FORq(i, m, n) for (int i = (m); i <= (n); ++i)
#define FORqr(i, m, n) for (int i = (n); i >= (m); --i)
#define M... | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPr(i, n) for (int i = (n)-1; i >= 0; --i)
#define FORq(i, m, n) for (int i = (m); i <= (n); ++i)
#define FORqr(i, m, n) for (int i = (n); i >= (m); --i)
#define M... | replace | 182 | 194 | 182 | 195 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define maxn 100005
#define mod 1000000007
typedef pair<int, int> pii;
typedef map<int, int> mii;
typedef vector<int> vi;
typedef vector<vector<int>> vii;
typedef vector<long long> vll;
typedef vector<bool> vb;
typedef set<int> ... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define maxn 100005
#define mod 1000000007
typedef pair<int, int> pii;
typedef map<int, int> mii;
typedef vector<int> vi;
typedef vector<vector<int>> vii;
typedef vector<long long> vll;
typedef vector<bool> vb;
typedef set<int> ... | insert | 64 | 64 | 64 | 66 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for (ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for (ll i = (n)-1; i >= 0; i--)
#define rreps(i, e, n) for (ll i = (n)-1; i >= (e); i--)
#defin... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for (ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for (ll i = (n)-1; i >= 0; i--)
#define rreps(i, e, n) for (ll i = (n)-1; i >= (e); i--)
#defin... | insert | 105 | 105 | 105 | 110 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ALL(x) (x).begin(), (x).end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
typedef pair<int, int> PI;
typedef pair<int, pair<int, int>> PII;
static const int INF = 1010000000000000017LL;
static const double eps = 1... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define ALL(x) (x).begin(), (x).end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
typedef pair<int, int> PI;
typedef pair<int, pair<int, int>> PII;
static const int INF = 1010000000000000017LL;
static const double eps = 1... | replace | 71 | 75 | 71 | 81 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPP(i, n) for (int i = 1; i <= n; i++)
#define ALL(obj) (obj).begin(), (obj).end()... | #include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPP(i, n) for (int i = 1; i <= n; i++)
#define ALL(obj) (obj).begin(), (obj).end()... | replace | 78 | 79 | 78 | 79 | 0 | |
p02616 | C++ | Runtime Error | #include <bits/stdc++.h>
#ifdef LOCAL_DEBUG
#define DEBUG 1
#define CERR \
if (DEBUG) \
cerr
#define MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, NAME, ...) NAME
#define pr(...) ... | #include <bits/stdc++.h>
#ifdef LOCAL_DEBUG
#define DEBUG 1
#define CERR \
if (DEBUG) \
cerr
#define MACRO(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, NAME, ...) NAME
#define pr(...) ... | replace | 136 | 137 | 136 | 141 | 0 | |
p02617 | C++ | Runtime Error | #include <bits/stdc++.h>
#define del(a, i) memset(a, i, sizeof(a))
#define ll long long
#define inl inline
#define il inl void
#define it inl int
#define ill inl ll
#define re register
#define ri re int
#define rl re ll
#define mid ((l + r) >> 1)
#define lowbit(x) (x & (-x))
#define INF 0x3f3f3f3f
using namespace std;
... | #include <bits/stdc++.h>
#define del(a, i) memset(a, i, sizeof(a))
#define ll long long
#define inl inline
#define il inl void
#define it inl int
#define ill inl ll
#define re register
#define ri re int
#define rl re ll
#define mid ((l + r) >> 1)
#define lowbit(x) (x & (-x))
#define INF 0x3f3f3f3f
using namespace std;
... | replace | 57 | 58 | 57 | 58 | 0 | 0.029827 |
p02617 | C++ | Runtime Error | #ifdef LOCAL
#include <header.hpp>
#else
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/priority_queue.hpp>
#endif
#define lp(i, l, r) for (auto i = regu(l); i <= decltype(i)(r); ++i)
#define rp(i, r, l) for (auto i = regu(r); i >= decltype(i)(l); --i)
#define lv(i, a) for (int i ... | #ifdef LOCAL
#include <header.hpp>
#else
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/priority_queue.hpp>
#endif
#define lp(i, l, r) for (auto i = regu(l); i <= decltype(i)(r); ++i)
#define rp(i, r, l) for (auto i = regu(r); i >= decltype(i)(l); --i)
#define lv(i, a) for (int i ... | replace | 188 | 189 | 188 | 190 | 0 | |
p02617 | C++ | Runtime Error | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, x, n) for (int i = x; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(X) (X).begin(), (X).end()
#define X first
#define Y second
#define pb push_back
#define eb emplace_back
using namespace std;
type... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, x, n) for (int i = x; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(X) (X).begin(), (X).end()
#define X first
#define Y second
#define pb push_back
#define eb emplace_back
using namespace std;
type... | replace | 84 | 85 | 84 | 85 | 0 | |
p02617 | C++ | Time Limit Exceeded | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <iterator>
#include <limits.h>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <stack>
#include <time.h>
using namespace std;
#define rep_1(i, m, n) for (int i = m; i <= n; i++)
#define mem... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <iterator>
#include <limits.h>
#include <map>
#include <ostream>
#include <queue>
#include <set>
#include <stack>
#include <time.h>
using namespace std;
#define rep_1(i, m, n) for (int i = m; i <= n; i++)
#define mem... | replace | 41 | 44 | 41 | 46 | TLE | |
p02617 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int M = 1000000007;
signed main() {
int N;
cin >> N;
vector<vector<int>> A(N, vector<int>(0));
for (int i = 0; i < N - 1; i++) {
int n, m;
cin >> n >> m;
A[n - 1].push_back(m - 1);
A[m - 1].push_back(n - 1);
}
int ans ... | #include <bits/stdc++.h>
using namespace std;
#define int long long
const int M = 1000000007;
signed main() {
int N;
cin >> N;
vector<vector<int>> A(N, vector<int>(0));
for (int i = 0; i < N - 1; i++) {
int n, m;
cin >> n >> m;
A[n - 1].push_back(m - 1);
A[m - 1].push_back(n - 1);
}
int ans ... | replace | 14 | 24 | 14 | 22 | TLE | |
p02617 | C++ | Runtime Error | // https://atcoder.jp/contests/abc173/tasks/abc173_f
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, b, e) for (int i = (b); i <= (int)(e); i++)
#define DEBUG 1
#if DEBUG
#define _GLIBCXX_DEBUG
#define DUMP(a) ... | // https://atcoder.jp/contests/abc173/tasks/abc173_f
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, b, e) for (int i = (b); i <= (int)(e); i++)
#define DEBUG 1
#if DEBUG
#define _GLIBCXX_DEBUG
#define DUMP(a) ... | replace | 34 | 35 | 34 | 35 | 0 | |
p02617 | C++ | Runtime Error | #include <bits/stdc++.h>
using namespace std;
const int N = 200005;
pair<long long, long long> a[N];
long long n, seg[N], lazy[N];
vector<long long> adj[N];
void prop(long long idx, long long start, long long end) {
if (start > end)
return;
seg[idx] += lazy[idx] * (end - start + 1);
if (start != end) {
la... | #include <bits/stdc++.h>
using namespace std;
const int N = 200005;
pair<long long, long long> a[N];
long long n, seg[4 * N], lazy[4 * N];
vector<long long> adj[N];
void prop(long long idx, long long start, long long end) {
if (start > end)
return;
seg[idx] += lazy[idx] * (end - start + 1);
if (start != end) ... | replace | 4 | 5 | 4 | 5 | 0 | |
p02618 | C++ | Runtime Error | #define _CRT_SECURE_NO_WARNINGS
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <... | #define _CRT_SECURE_NO_WARNINGS
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <... | replace | 142 | 144 | 142 | 144 | -8 | |
p02618 | C++ | Time Limit Exceeded | #include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
using ld = long double;
#define repd(i, a, b) for (int i = a; i < int(b); i++)
#define rep(i, n) repd(i, 0, n)
#define VARNAME(v) #v
using P = pair<int, int>;
i... | #include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
using ll = long long;
using ld = long double;
#define repd(i, a, b) for (int i = a; i < int(b); i++)
#define rep(i, n) repd(i, 0, n)
#define VARNAME(v) #v
using P = pair<int, int>;
i... | replace | 15 | 16 | 15 | 16 | TLE |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.