buggy_code stringlengths 11 625k | fixed_code stringlengths 17 625k | bug_type stringlengths 2 4.45k | language int64 0 8 | token_count int64 5 200k | change_count int64 0 100 |
|---|---|---|---|---|---|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt(), m[] = new int[n], l[] = new int[n], c = 0;
boolean[] t = new boolean[n];
for (int i = 0; i < n; i++) {
m[i] = sc.nextInt();
}
for (int i = 0;... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt(), m[] = new int[n], l[] = new int[n], c = 0;
boolean[] t = new boolean[n];
for (int i = 0; i < n; i++) {
m[i] = sc.nextInt();
}
for (int i = 0;... | [["-", 8, 498, 0, 195, 8, 196, 0, 514, 51, 22], ["+", 8, 498, 0, 195, 8, 196, 0, 514, 51, 22]] | 3 | 225 | 2 |
#include <cstring>
#include <iostream>
#include <vector>
using namespace std;
constexpr int MAX = 100000;
int res;
int num[MAX], visited[MAX];
void dfs(int v, int c, const vector<int> &a) {
visited[v] = 0;
num[v] = c;
int to = (v + a[v]) % a.size();
if (visited[to] == -1) {
dfs(to, c + 1, a);
} else i... | #include <cstring>
#include <iostream>
#include <vector>
using namespace std;
constexpr int MAX = 100000;
int res;
int num[MAX], visited[MAX];
void dfs(int v, int c, const vector<int> &a) {
visited[v] = 0;
num[v] = c;
int to = (v + a[v]) % a.size();
if (visited[to] == -1) {
dfs(to, c + 1, a);
} else i... | [["-", 75, 76, 0, 57, 64, 9, 0, 37, 0, 38], ["-", 75, 76, 0, 57, 64, 9, 0, 37, 0, 35]] | 1 | 256 | 2 |
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int n, a[100009];
bool cycle[100009], vis1[100009], vis2[100009];
int main() {
cin >> n;
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = 0; i < n; i++) {
vector<int> w;
int p = i;
while (!vis1[p]) {
p = (p ... | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int n, a[100009];
bool cycle[100009], vis1[100009], vis2[100009];
int main() {
cin >> n;
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = 0; i < n; i++) {
vector<int> w;
int p = i;
while (!vis1[p]) {
p = (p ... | [["+", 0, 11, 31, 69, 341, 342, 0, 69, 28, 22], ["+", 31, 69, 341, 342, 0, 69, 341, 342, 0, 70], ["+", 31, 69, 341, 342, 0, 69, 341, 342, 0, 73]] | 1 | 252 | 3 |
#include <algorithm>
#include <array>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
typedef ... | #include <algorithm>
#include <array>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
typedef ... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 1,037 | 2 |
#include <cstring>
#include <iostream>
using namespace std;
void yaku(int a, int b) {
for (int i = 2; i <= a && i <= b; i++) {
if (a % i == 0 && b % i == 0) {
a /= i;
b /= i;
}
}
cout << a << '/' << b << endl;
}
int main(void) {
char s[9];
cin >> s;
int k = 10, x = 0, l = strlen(s), i;
... | #include <cstring>
#include <iostream>
using namespace std;
void yaku(int a, int b) {
for (int i = 2; i <= a && i <= b; i++) {
if (a % i == 0 && b % i == 0) {
a /= i;
b /= i;
i = 2;
}
}
cout << a << '/' << b << endl;
}
int main(void) {
char s[9];
cin >> s;
int k = 10, x = 0, l = st... | [["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 57, 64, 9, 0, 1, 0, 35]] | 1 | 279 | 4 |
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>
typedef long long ll;
using namespace std;
#define debug(x) c... | #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>
typedef long long ll;
using namespace std;
#define debug(x) c... | [["-", 8, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["+", 8, 1, 0, 11, 31, 69, 341, 342, 0, 22]] | 1 | 804 | 2 |
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
const LL INF = 1e18;
int W, H;
vector<vector<LL>> S;
LL score(int i, int j) {
auto L = S[i + 1][j] - S[i + 1][0];
auto R = S[i + 1][W] - S[i + 1][j];
return ((i + j) & 1) ? L - R : R - L;
}
LL dfs(int i, int j) {
static vector<vector<LL>> m... | #include <bits/stdc++.h>
using namespace std;
using LL = long long;
const LL INF = 1e18;
int W, H;
vector<vector<LL>> S;
LL score(int i, int j) {
auto L = S[i + 1][j] - S[i + 1][0];
auto R = S[i + 1][W] - S[i + 1][j];
return ((i + j) & 1) ? L - R : R - L;
}
LL dfs(int i, int j) {
static vector<vector<LL>> m... | [["+", 0, 1, 0, 16, 31, 16, 12, 2, 63, 22], ["+", 0, 16, 31, 16, 12, 2, 3, 4, 0, 24], ["+", 12, 2, 3, 4, 0, 2, 3, 4, 0, 25]] | 1 | 351 | 3 |
#include <algorithm>
#include <cfloat>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <time.h>
#include <vector>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 100000... | #include <algorithm>
#include <cfloat>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <stdio.h>
#include <string>
#include <time.h>
#include <vector>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 100000... | [["+", 0, 52, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32]] | 1 | 477 | 2 |
#include <bits/stdc++.h>
using namespace std;
typedef pair<string, string> P;
int N, F, ans = 0;
map<P, int> mp;
int main() {
cin >> N >> F;
for (int i = 0; i < N; i++) {
int K;
cin >> K;
vector<string> v(K);
for (int j = 0; j < K; j++) {
cin >> v[j];
for (int k = 0; k < j; k++) {
... | #include <bits/stdc++.h>
using namespace std;
typedef pair<string, string> P;
int N, F, ans = 0;
map<P, int> mp;
int main() {
cin >> N >> F;
for (int i = 0; i < N; i++) {
int K;
cin >> K;
vector<string> v(K);
for (int j = 0; j < K; j++) {
cin >> v[j];
for (int k = 0; k < j; k++) {
... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]] | 1 | 244 | 2 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int(i) = 0; (i) < (int)(n); ++(i))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define fi first
#define se second
using ps = pair<string, string>;
int main() {
int n, f;
cin >> n >> f;
vector<string> name;... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int(i) = 0; (i) < (int)(n); ++(i))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define fi first
#define se second
using ps = pair<string, string>;
int main() {
int n, f;
cin >> n >> f;
vector<string> name;... | [["-", 0, 14, 8, 9, 0, 43, 39, 344, 141, 78], ["+", 0, 14, 8, 9, 0, 43, 39, 344, 141, 78], ["-", 0, 57, 64, 1, 0, 2, 63, 118, 119, 120], ["+", 0, 57, 64, 1, 0, 2, 63, 118, 119, 120]] | 1 | 289 | 4 |
#include <stdbool.h>
#include <stdio.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
bool flag[4000000];
int main(void) {
int i, j, k, n;
scanf("%d", &n);
rep(i, 4000000) flag[i] = false;
rep(i, n) {
int a, b;
scanf("%d%d", &a, &b);
a += b;
if (!flag[a])
flag[a] = true;
else {
... | #include <stdbool.h>
#include <stdio.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
bool flag[4000000];
int main(void) {
int i, j, k, n;
scanf("%d", &n);
rep(i, 4000000) flag[i] = false;
rep(i, n) {
int a, b;
scanf("%d%d", &a, &b);
a += b;
if (!flag[a])
flag[a] = true;
else {
... | [["-", 75, 76, 0, 9, 0, 7, 10, 11, 31, 22], ["+", 75, 76, 0, 9, 0, 7, 10, 11, 31, 22], ["-", 75, 76, 0, 9, 0, 7, 26, 27, 28, 22], ["+", 75, 76, 0, 9, 0, 7, 26, 27, 28, 22], ["-", 0, 57, 15, 339, 51, 69, 341, 342, 0, 22], ["+", 0, 57, 15, 339, 51, 69, 341, 342, 0, 22], ["-", 64, 1, 0, 11, 31, 69, 341, 342, 0, 22], ["+",... | 1 | 173 | 10 |
#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const double EPS = 1e-15;
using ll = long long;
using ull = unsigned long long;
const int inf = 2e9;
const ll INF = 2e18;
const ll MOD = 1e9 + 7;
const ll MOD1 = 998244353;
typedef pair<int, int> P;
#define REP(i, n) for (int i = 0; i < (n); i+... | #include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const double EPS = 1e-15;
using ll = long long;
using ull = unsigned long long;
const int inf = 2e9;
const ll INF = 2e18;
const ll MOD = 1e9 + 7;
const ll MOD1 = 998244353;
typedef pair<int, int> P;
#define REP(i, n) for (int i = 0; i < (n); i+... | [["-", 8, 9, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 14, 8, 9, 0, 43, 39, 78], ["-", 0, 14, 8, 9, 0, 57, 64, 9, 0, 45], ["-", 0, 14, 8, 9, 0, 57, 64, 9, 0, 46], ["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["-", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]] | 1 | 219 | 6 |
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
using namespace std;
typedef long long ll;
int main() {
int n;
cin >> n;
vector<ll> vec(n);
rep(i, n) cin >> vec[i];
ll sum = 0;
map<int, int> mp;
int maxi = 0;
mp[0] = 0;
rep(i, n) {
sum +... | #include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
using namespace std;
typedef long long ll;
int main() {
int n;
cin >> n;
vector<ll> vec(n);
rep(i, n) cin >> vec[i];
ll sum = 0;
map<ll, int> mp;
int maxi = 0;
mp[0] = -1;
rep(i, n) {
sum +... | [["-", 0, 43, 39, 344, 3, 347, 0, 77, 39, 40], ["+", 0, 43, 39, 344, 3, 347, 0, 77, 39, 78], ["-", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13]] | 1 | 145 | 4 |
#include <algorithm>
#include <iostream>
#include <map>
using namespace std;
int d[1 << 18];
map<long, long> M;
main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> d[i];
}
long s = 0, ans = 0;
for (long i = 0; i < n; i++) {
s += d[i];
if (!s)
ans = max(ans, i + 1);
if (M[s])... | #include <algorithm>
#include <iostream>
#include <map>
using namespace std;
int d[1 << 18];
map<long, long> M;
main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> d[i];
}
long s = 0, ans = 0;
for (long i = 0; i < n; i++) {
s += d[i];
if (!s)
ans = max(ans, i + 1);
if (M[s])... | [["+", 0, 11, 12, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13], ["+", 75, 76, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 75, 76, 0, 1, 0, 11, 12, 16, 12, 13]] | 1 | 144 | 4 |
#include "bits/stdc++.h"
#define REP(i, n) for (ll i = 0; i < n; ++i)
#define RREP(i, n) for (ll i = n - 1; i >= 0; --i)
#define FOR(i, m, n) for (ll i = m; i < n; ++i)
#define RFOR(i, m, n) for (ll i = n - 1; i >= m; --i)
#define ALL(v) (v).begin(), (v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end());
#defin... | #include "bits/stdc++.h"
#define REP(i, n) for (ll i = 0; i < n; ++i)
#define RREP(i, n) for (ll i = n - 1; i >= 0; --i)
#define FOR(i, m, n) for (ll i = m; i < n; ++i)
#define RFOR(i, m, n) for (ll i = n - 1; i >= m; --i)
#define ALL(v) (v).begin(), (v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end());
#defin... | [["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]] | 1 | 390 | 4 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define pb push_back
#define rep(i, a, n) for (int i = (a); i < (n); i++)
#define dep(i, a, n) for (int i = (a); i >= (n); i--)
#define mod 1e9 + 7
__attribute__((constructor)) void initial() {
cin.tie(0);
ios::sync_wi... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define pb push_back
#define rep(i, a, n) for (int i = (a); i < (n); i++)
#define dep(i, a, n) for (int i = (a); i >= (n); i--)
#define mod 1e9 + 7
__attribute__((constructor)) void initial() {
cin.tie(0);
ios::sync_wi... | [["-", 15, 339, 51, 2, 3, 4, 0, 69, 28, 22], ["-", 51, 2, 3, 4, 0, 69, 341, 342, 0, 70], ["-", 51, 2, 3, 4, 0, 69, 341, 342, 0, 22], ["-", 51, 2, 3, 4, 0, 69, 341, 342, 0, 73], ["+", 0, 57, 15, 339, 51, 2, 3, 4, 0, 22]] | 1 | 208 | 5 |
#include <map>
#include <stdio.h>
#include <utility>
using namespace std;
typedef pair<int, int> pi;
#define F first
#define S second
#define MP make_pair
int main() {
int n, ans = 0;
long long int now = 0, temp;
map<long long int, int> m;
scanf("%d", &n);
m.insert(MP(0, -1));
for (int i = 0; i < n; i++) {
... | #include <map>
#include <stdio.h>
#include <utility>
using namespace std;
typedef pair<int, int> pi;
#define F first
#define S second
#define MP make_pair
int main() {
int n, ans = 0;
long long int now = 0, temp;
map<long long int, int> m;
scanf("%d", &n);
m.insert(MP(0, -1));
for (int i = 0; i < n; i++) {
... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 17, 72], ["-", 0, 11, 12, 2, 3, 4, 0, 16, 12, 13]] | 1 | 166 | 4 |
#include <bits/stdc++.h>
using namespace std;
#define MAX_V 1000
int V;
int n;
vector<int> G[MAX_V];
int match[MAX_V];
int Match[MAX_V];
int used[MAX_V];
int L[MAX_V], R[MAX_V];
int C = 0;
void add_edge(int u, int v) {
G[u].push_back(v);
G[v].push_back(u);
}
bool dfs(int v) {
used[v] = C;
for (int i = 0; i <... | #include <bits/stdc++.h>
using namespace std;
#define MAX_V 1000
int V;
int n;
vector<int> G[MAX_V];
int match[MAX_V];
int Match[MAX_V];
int used[MAX_V];
int L[MAX_V], R[MAX_V];
int C = 0;
void add_edge(int u, int v) {
G[u].push_back(v);
G[v].push_back(u);
}
bool dfs(int v) {
used[v] = C;
for (int i = 0; i <... | [["+", 0, 7, 8, 9, 0, 1, 0, 27, 28, 22], ["+", 0, 7, 8, 9, 0, 1, 0, 27, 17, 29], ["+", 8, 9, 0, 7, 8, 9, 0, 1, 0, 35], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]] | 1 | 617 | 7 |
#include <bits/stdc++.h>
using namespace std;
#define MAX_V 1000
int N, a, cc = 1;
vector<int> G[MAX_V];
int match[MAX_V];
bool used[MAX_V];
bool dfs(int v) {
used[v] = cc;
for (int i = 0; i < (int)G[v].size(); i++) {
int u = G[v][i], w = match[u];
if (w < 0 || (used[w] != cc && dfs(w))) {
match[u] ... | #include <bits/stdc++.h>
using namespace std;
#define MAX_V 1000
int N, a, cc = 1;
vector<int> G[MAX_V];
int match[MAX_V];
int used[MAX_V];
bool dfs(int v) {
used[v] = cc;
for (int i = 0; i < (int)G[v].size(); i++) {
int u = G[v][i], w = match[u];
if (w < 0 || (used[w] != cc && dfs(w))) {
match[u] =... | [["-", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40], ["+", 36, 36, 36, 36, 0, 30, 0, 43, 39, 40]] | 1 | 431 | 2 |
import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
System.out.println(num * 4);
}
}
| import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
System.out.println(num * 32);
}
}
| [["-", 0, 1, 0, 492, 3, 4, 0, 16, 12, 499], ["+", 0, 1, 0, 492, 3, 4, 0, 16, 12, 499]] | 3 | 54 | 2 |
#include <bits/stdc++.h>
using namespace std;
const unsigned mod = 1e9 + 7;
unsigned power[234567], lad[26][234567];
struct SegmentTree {
vector<unsigned> hashed;
vector<int> lazy;
int sz;
SegmentTree(int n) {
sz = 1;
while (sz < n)
sz <<= 1;
hashed.assign(2 * sz - 1, 0);
lazy.assign(2... | #include <bits/stdc++.h>
using namespace std;
const unsigned mod = 1e9 + 7;
unsigned power[234567], lad[26][234567];
struct SegmentTree {
vector<unsigned> hashed;
vector<int> lazy;
int sz;
SegmentTree(int n) {
sz = 1;
while (sz < n)
sz <<= 1;
hashed.assign(2 * sz - 1, 0);
lazy.assign(2... | [["+", 0, 1, 0, 11, 12, 69, 28, 69, 28, 22], ["+", 0, 11, 12, 69, 28, 69, 341, 342, 0, 70], ["+", 0, 11, 12, 69, 28, 69, 341, 342, 0, 73], ["+", 0, 1, 0, 11, 12, 69, 341, 342, 0, 70], ["+", 0, 1, 0, 11, 12, 69, 341, 342, 0, 13], ["+", 0, 1, 0, 11, 12, 69, 341, 342, 0, 73]] | 1 | 1,152 | 6 |
#include <algorithm>
#include <array>
#include <chrono>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>... | #include <algorithm>
#include <array>
#include <chrono>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>... | [["-", 0, 57, 64, 9, 0, 37, 0, 16, 17, 33], ["+", 0, 57, 64, 9, 0, 37, 0, 16, 17, 72]] | 1 | 800 | 2 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int ans = sc.nextInt() / sc.nextInt();
System.out.println(ans);
}
}
| import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int ans = sc.nextInt() + sc.nextInt();
System.out.println(ans / 2);
}
}
| [["-", 8, 196, 0, 503, 49, 200, 51, 16, 17, 85], ["+", 8, 196, 0, 503, 49, 200, 51, 16, 17, 72], ["+", 0, 1, 0, 492, 3, 4, 0, 16, 17, 85], ["+", 0, 1, 0, 492, 3, 4, 0, 16, 12, 499]] | 3 | 59 | 4 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String[] input = sc.nextLine().split(" ");
int a = Integer.parseInt(input[0]);
int b = Integer.parseInt(input[1]);
System.out.println(a + b / 2);
}
}
| import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String[] input = sc.nextLine().split(" ");
int a = Integer.parseInt(input[0]);
int b = Integer.parseInt(input[1]);
System.out.println((a + b) / 2);
}
}
| [["+", 0, 492, 3, 4, 0, 16, 31, 23, 0, 24], ["+", 0, 492, 3, 4, 0, 16, 31, 23, 0, 25]] | 3 | 92 | 2 |
#include <stdio.h>
int main(void) {
int a, b;
int ans;
scanf("%d %d", &a, &b);
ans = a + b / 2;
printf("%d\n", ans);
return 0;
}
| #include <stdio.h>
int main(void) {
int a, b;
int ans;
scanf("%d %d", &a, &b);
ans = (a + b) / 2;
printf("%d\n", ans);
return 0;
}
| [["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25]] | 1 | 51 | 2 |
#include <iostream>
using namespace std;
main() {
int a, b;
cin >> a >> b;
cout << (a + b) << endl;
}
| #include <iostream>
using namespace std;
main() {
int a, b;
cin >> a >> b;
cout << (a + b) / 2 << endl;
}
| [["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 85], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]] | 1 | 32 | 2 |
#include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
cout << a + b / 2 << endl;
}
| #include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
cout << (a + b) / 2 << endl;
}
| [["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25]] | 1 | 33 | 2 |
#include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
cout << a + b / 2 << endl;
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
cout << (a + b) / 2 << endl;
return 0;
}
| [["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25]] | 1 | 36 | 2 |
#include <iostream>
using namespace std;
int main() {
int b = 0;
int a = 0;
int c = 0;
cin >> a;
cin >> b;
c = a + b / 2;
cout << c << endl;
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int b = 0;
int a = 0;
int c = 0;
cin >> a;
cin >> b;
c = a + b;
c = c / 2;
cout << c << endl;
return 0;
}
| [["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22]] | 1 | 52 | 4 |
#include <stdio.h>
int main(void) {
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
if (a >= c) {
printf("0\n");
} else if ((a + b) <= c) {
printf("NA\n");
} else {
printf("%d\n", c - a);
}
return 0;
}
| #include <stdio.h>
int main(void) {
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
if (a >= c) {
printf("0\n");
} else if ((a + b) < c) {
printf("NA\n");
} else {
printf("%d\n", c - a);
}
return 0;
}
| [["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 18]] | 1 | 87 | 2 |
#include <iostream>
using namespace std;
int main() {
int m, f, b;
cin >> m >> f >> b;
int x = b - m;
if (x < 0)
cout << '0' << endl;
else if (f > x)
cout << x << endl;
else if (m + f < b)
cout << "NA" << endl;
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int m, f, b;
cin >> m >> f >> b;
int x = b - m;
if (x < 0)
cout << '0' << endl;
else if (f >= x)
cout << x << endl;
else if (m + f < b)
cout << "NA" << endl;
return 0;
}
| [["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 81 | 2 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define ll long long
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define ROF(i, a, b) for (int i = b - 1; i >= a; i--)
using namespace std;
//
const int inf = 1e9 + 7;
cons... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define ll long long
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define ROF(i, a, b) for (int i = b - 1; i >= a; i--)
using namespace std;
//
const int inf = 1e9 + 7;
cons... | [["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 246 | 2 |
#include <iostream>
using namespace std;
int m, f, b;
int main() {
cin >> m >> f >> b;
if (m >= b)
cout << 0 << endl;
else if (m + f <= b)
cout << b - m << endl;
else
cout << "NA" << endl;
return 0;
}
| #include <iostream>
using namespace std;
int m, f, b;
int main() {
cin >> m >> f >> b;
if (m >= b)
cout << 0 << endl;
else if (m + f >= b)
cout << b - m << endl;
else
cout << "NA" << endl;
return 0;
}
| [["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 19], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 68 | 2 |
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int main(void) {
int m, f, b;
cin >> m >> f >> b;
if (m + f < b)
cout << "NA" << endl;
else {
if (m >= b)
cout << 0 << endl;
else
cout << f - m << endl;
}
}
| #include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int main(void) {
int m, f, b;
cin >> m >> f >> b;
if (m + f < b)
cout << "NA" << endl;
else {
if (m >= b)
cout << 0 << endl;
else
cout << b - m << endl;
}
}
| [["-", 0, 1, 0, 16, 31, 16, 12, 16, 31, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 31, 22]] | 1 | 72 | 2 |
#include <iostream>
using namespace std;
int main() {
int m, f, b;
cin >> m >> f >> b;
if (b < m + f)
if (b <= m)
cout << 0 << endl;
else
cout << b - m << endl;
else
cout << "NA" << endl;
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int m, f, b;
cin >> m >> f >> b;
if (b <= m + f)
if (b <= m)
cout << 0 << endl;
else
cout << b - m << endl;
else
cout << "NA" << endl;
return 0;
}
| [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 68 | 2 |
#include <iostream>
using namespace std;
int m, f, b, k, n;
int main() {
cin >> m >> f >> b;
k = m - b;
n = (m + f) - b;
if (k > 0) {
cout << 0 << endl;
} else if (n > 0) {
cout << b - m << endl;
} else {
cout << "NA" << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int m, f, b, k, n;
int main() {
cin >> m >> f >> b;
k = m - b;
n = (m + f) - b;
if (k > 0) {
cout << 0 << endl;
} else if (n >= 0) {
cout << b - m << endl;
} else {
cout << "NA" << endl;
}
return 0;
}
| [["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 92 | 2 |
#include <iostream>
using namespace std;
int main() {
int m, f, b;
cin >> m >> f >> b;
if (m > b)
cout << 0 << endl;
else if ((m + f) > b)
cout << b - m << endl;
else
cout << "NA" << endl;
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int m, f, b;
cin >> m >> f >> b;
if (m >= b)
cout << 0 << endl;
else if ((m + f) >= b)
cout << b - m << endl;
else
cout << "NA" << endl;
return 0;
}
| [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 70 | 4 |
#include <iostream>
using namespace std;
int main() {
int m, f, b;
cin >> m >> f >> b;
// 本を購入できないとき
if (b > m + f)
cout << "NA" << endl;
// 本を購入できるとき
else if (b <= m)
cout << 0 << endl; // 自分で購入するとき
else
cout << f - m << endl; // 友達から借りたとき
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int m, f, b;
cin >> m >> f >> b;
// 本を購入できないとき
if (b > m + f)
cout << "NA" << endl;
// 本を購入できるとき
else if (b <= m)
cout << 0 << endl; // 自分で購入するとき
else
cout << b - m << endl; // 友達から借りたとき
return 0;
}
| [["-", 0, 1, 0, 16, 31, 16, 12, 16, 31, 22], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 31, 22]] | 1 | 72 | 11 |
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
if (b > a + c)
cout << "NA" << endl;
else
cout << max(b - a, 0) << endl;
} | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
if (c > a + b)
cout << "NA" << endl;
else
cout << max(c - a, 0) << endl;
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22], ["-", 31, 16, 12, 2, 3, 4, 0, 16, 31, 22], ["+", 31, 16, 12, 2, 3, 4, 0, 16, 31, 22]] | 1 | 59 | 6 |
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int m, f, b;
cin >> m >> f >> b;
if (m >= b)
cout << "0\n";
else if (m + f >= b)
cout << m + f - b << endl;
else
cout << "NA\n";
} | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
int m, f, b;
cin >> m >> f >> b;
if (m >= b)
cout << "0\n";
else if (m + f >= b)
cout << b - m << endl;
else
cout << "NA\n";
} | [["-", 0, 16, 31, 16, 12, 16, 31, 16, 31, 22], ["-", 0, 16, 31, 16, 12, 16, 31, 16, 17, 72], ["-", 0, 16, 31, 16, 12, 16, 31, 16, 12, 22], ["-", 64, 1, 0, 16, 31, 16, 12, 16, 17, 33], ["+", 64, 1, 0, 16, 31, 16, 12, 16, 17, 33], ["+", 64, 1, 0, 16, 31, 16, 12, 16, 12, 22]] | 1 | 69 | 6 |
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
if (a >= c) {
cout << 0;
} else if (a + b >= c) {
cout << a + b - c;
} else {
cout << "NA";
}
cout << endl;
} | #include <algorithm>
#include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
if (a >= c) {
cout << 0;
} else if (a + b >= c) {
cout << c - a;
} else {
cout << "NA";
}
cout << endl;
} | [["-", 0, 1, 0, 16, 12, 16, 31, 16, 31, 22], ["-", 0, 1, 0, 16, 12, 16, 31, 16, 17, 72], ["-", 0, 1, 0, 16, 12, 16, 31, 16, 12, 22], ["-", 64, 9, 0, 1, 0, 16, 12, 16, 17, 33], ["+", 64, 9, 0, 1, 0, 16, 12, 16, 17, 33], ["+", 64, 9, 0, 1, 0, 16, 12, 16, 12, 22]] | 1 | 73 | 6 |
#include <cstdio>
using namespace std;
int main() {
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
if (b >= c)
printf("0\n");
else if (a + b >= c)
printf("%d\n", c - b);
else
printf("NA");
return 0;
} | #include <cstdio>
using namespace std;
int main() {
int a, b, c;
scanf("%d %d %d", &b, &a, &c);
if (b >= c)
printf("0\n");
else if (a + b >= c)
printf("%d\n", c - b);
else
printf("NA\n");
return 0;
} | [["-", 0, 1, 0, 2, 3, 4, 0, 66, 28, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 66, 28, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]] | 1 | 81 | 5 |
#include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
if (a >= c)
cout << 0 << endl;
else if (a + b < c)
cout << "NA" << endl;
else
cout << a - c << endl;
return 0;
} | #include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
if (a >= c)
cout << 0 << endl;
else if (a + b < c)
cout << "NA" << endl;
else
cout << c - a << endl;
return 0;
} | [["-", 0, 1, 0, 16, 31, 16, 12, 16, 31, 22], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 33], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 33], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]] | 1 | 68 | 4 |
#include <iostream>
#include <stdio.h>
using namespace std;
#include <math.h>
int main() {
int m, f, b;
cin >> m >> f >> b;
if (m >= f)
cout << "0" << endl;
else {
if (m + f >= b)
cout << b - m << endl;
else
cout << "NA" << endl;
}
return 0;
}
| #include <iostream>
#include <stdio.h>
using namespace std;
#include <math.h>
int main() {
int m, f, b;
cin >> m >> f >> b;
if (m >= b)
cout << "0" << endl;
else {
if (m + f >= b)
cout << b - m << endl;
else
cout << "NA" << endl;
}
return 0;
}
| [["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]] | 1 | 76 | 2 |
#include <iostream>
using namespace std;
int main() {
int m, f, b;
cin >> m >> f >> b;
if (b - m > f) {
cout << "NO" << endl;
} else {
cout << max(b - m, 0) << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int m, f, b;
cin >> m >> f >> b;
if (b - m > f) {
cout << "NA" << endl;
} else {
cout << max(b - m, 0) << endl;
}
return 0;
}
| [["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]] | 1 | 64 | 2 |
#include <iostream>
using namespace std;
int main() {
int m, f, b;
cin >> m >> f >> b;
if (m + f > b) {
if (m > b) {
cout << "0" << endl;
} else
cout << (b - m) << endl;
}
if (m + f < b) {
cout << "NA" << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int m, f, b;
cin >> m >> f >> b;
if (m + f >= b) {
if (m > b) {
cout << "0" << endl;
} else
cout << (b - m) << endl;
}
if (m + f < b) {
cout << "NA" << endl;
}
return 0;
}
| [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 85 | 2 |
#include <bits/stdc++.h>
#define syosu(x) fixed << setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd... | #include <bits/stdc++.h>
#define syosu(x) fixed << setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]] | 1 | 258 | 2 |
#include <algorithm>
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
if (a >= c)
cout << 0 << endl;
else {
if (b + a >= c)
cout << b - a << endl;
else
cout << "NA" << endl;
}
return 0;
}
| #include <algorithm>
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
if (a >= c)
cout << 0 << endl;
else {
if (b + a >= c)
cout << c - a << endl;
else
cout << "NA" << endl;
}
return 0;
}
| [["-", 64, 1, 0, 16, 31, 16, 12, 16, 31, 22], ["+", 64, 1, 0, 16, 31, 16, 12, 16, 31, 22]] | 1 | 78 | 2 |
#include <iostream>
using namespace std;
int main() {
int a, f, b;
cin >> a >> f >> b;
if (a + b < f) {
cout << "NA" << endl;
} else if (a = b | a > b) {
cout << "0" << endl;
} else {
cout << b - a << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int a, f, b;
cin >> a >> f >> b;
if (a + f < b) {
cout << "NA" << endl;
} else if (a == b | a > b) {
cout << "0" << endl;
} else {
cout << b - a << endl;
}
return 0;
}
| [["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["-", 75, 76, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 60]] | 1 | 80 | 6 |
#include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
if (a >= b) {
cout << 0 << endl;
} else {
if (a + b >= c) {
cout << c - a << endl;
} else {
cout << "NA" << endl;
}
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
if (a >= c) {
cout << 0 << endl;
} else {
if (a + b >= c) {
cout << c - a << endl;
} else {
cout << "NA" << endl;
}
}
return 0;
}
| [["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]] | 1 | 76 | 2 |
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <st... | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <stdlib.h>
#include <st... | [["-", 0, 16, 31, 16, 12, 16, 31, 16, 31, 22], ["-", 0, 16, 31, 16, 12, 16, 31, 16, 17, 33], ["-", 64, 1, 0, 16, 31, 16, 12, 16, 17, 72], ["+", 64, 1, 0, 16, 31, 16, 12, 16, 17, 33]] | 1 | 138 | 4 |
#include <iostream>
using namespace std;
int main() {
int m, f, b;
cin >> m >> f >> b;
if (m >= f)
cout << "0" << endl;
else {
if (m + f < b)
cout << "NA" << endl;
else
cout << abs(m - f) << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int m, f, b;
cin >> m >> f >> b;
if (m >= b)
cout << "0" << endl;
else {
if (m + f < b)
cout << "NA" << endl;
else
cout << abs(m - b) << endl;
}
return 0;
}
| [["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22], ["-", 31, 16, 12, 2, 3, 4, 0, 16, 12, 22], ["+", 31, 16, 12, 2, 3, 4, 0, 16, 12, 22]] | 1 | 75 | 4 |
a, b, c = gets.split.map(&:to_i)
puts a >= c ? 0 : a + b >= c ? a + b - c : 'NA'
| a, b, c = gets.split.map(&:to_i)
puts a >= c ? 0 : a + b >= c ? c - a : 'NA'
| [["-", 0, 754, 75, 754, 64, 738, 31, 738, 31, 22], ["-", 0, 754, 75, 754, 64, 738, 31, 738, 17, 72], ["-", 0, 754, 75, 754, 64, 738, 31, 738, 12, 22], ["-", 3, 4, 0, 754, 75, 754, 64, 738, 17, 33], ["+", 3, 4, 0, 754, 75, 754, 64, 738, 17, 33], ["+", 3, 4, 0, 754, 75, 754, 64, 738, 12, 22]] | 4 | 37 | 6 |
a=int(input())
print((a-30)/2)
| a=int(input())
print((a-30)//2)
| [["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 85], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 676]] | 5 | 18 | 2 |
print((int(input())-30)/2)
| print(int((int(input())-30)/2))
| [["+", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 0, 652, 3, 4, 0, 652, 3, 4, 0, 25]] | 5 | 15 | 3 |
import java.util.Scanner;
public class Main {
public static void main(String... args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
System.out.println(b - a);
}
}
| import java.util.Scanner;
public class Main {
public static void main(String... args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
System.out.println(Math.abs(b - a));
}
}
| [["+", 0, 1, 0, 492, 3, 4, 0, 492, 500, 22], ["+", 0, 1, 0, 492, 3, 4, 0, 492, 0, 131], ["+", 0, 1, 0, 492, 3, 4, 0, 492, 141, 22], ["+", 0, 492, 3, 4, 0, 492, 3, 4, 0, 24], ["+", 0, 492, 3, 4, 0, 492, 3, 4, 0, 25]] | 3 | 63 | 5 |
#include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b;
c = a - b;
if (c < 0)
cout << c * -1 << endl;
cout << c << endl;
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b;
c = a - b;
if (c < 0)
cout << c * -1 << endl;
else
cout << c << endl;
return 0;
}
| [["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95]] | 1 | 54 | 1 |
a,b=map(int,split())
print(abs(a-b))
| a,b=map(int,input().split())
print(abs(a-b))
| [["+", 3, 4, 0, 652, 63, 319, 500, 652, 63, 22], ["+", 0, 652, 63, 319, 500, 652, 3, 4, 0, 24], ["+", 0, 652, 63, 319, 500, 652, 3, 4, 0, 25], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 0, 131]] | 5 | 21 | 4 |
#include <iostream>
using namespace std;
int main() {
int n, c;
cin >> n >> c;
int sum = 0, p;
for (int i = 0; i < c; i++) {
cin >> p;
sum += p;
}
cout << (sum + n - 1) / n << endl;
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int n, c;
cin >> n >> c;
int sum = 0, p;
for (int i = 0; i < c; i++) {
cin >> p;
sum += p;
}
cout << (sum + n) / (n + 1) << endl;
return 0;
}
| [["-", 31, 16, 12, 16, 31, 23, 0, 16, 17, 33], ["-", 31, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 16, 12, 23, 0, 24], ["+", 31, 16, 12, 16, 12, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 12, 23, 0, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 16, 12, 23, 0, 25]] | 1 | 71 | 6 |
#include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <string>
using namespace std;
int main() {
int N, C;
int sum = 0;
int cake;
cin >> N >> C;
for (int i = 0; i < C; i++) {
int a;
cin >> a;
sum += a;
}
cake = sum / (N + 1);
if (sum % N != 0) {
cake += 1;
}
cout << ca... | #include <cstdlib>
#include <iostream>
#include <stdio.h>
#include <string>
using namespace std;
int main() {
int N, C;
int sum = 0;
int cake;
cin >> N >> C;
for (int i = 0; i < C; i++) {
int a;
cin >> a;
sum += a;
}
cake = sum / (N + 1);
if (sum % (N + 1) != 0) {
cake += 1;
}
cout... | [["+", 15, 339, 51, 16, 31, 16, 12, 23, 0, 24], ["+", 51, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 51, 16, 31, 16, 12, 23, 0, 16, 12, 13], ["+", 15, 339, 51, 16, 31, 16, 12, 23, 0, 25]] | 1 | 96 | 4 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define ll long long
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define ROF(i, a, b) for (int i = b - 1; i >= a; i--)
using namespace std;
//
const int inf = 1e9 + 7;
cons... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define ll long long
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define ROF(i, a, b) for (int i = b - 1; i >= a; i--)
using namespace std;
//
const int inf = 1e9 + 7;
cons... | [["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 19], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 19]] | 1 | 255 | 4 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, n;
cin >> a >> b >> n;
while (n--) {
int q, w;
cin >> q >> w;
if (!(q > b || w < a)) {
cout << 1 << endl;
return 0;
}
}
cout << 0 << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, n;
cin >> a >> b >> n;
while (n--) {
int q, w;
cin >> q >> w;
if (!(q >= b || w <= a)) {
cout << 1 << endl;
return 0;
}
}
cout << 0 << endl;
}
| [["-", 51, 91, 28, 23, 0, 16, 31, 16, 17, 47], ["+", 51, 91, 28, 23, 0, 16, 31, 16, 17, 20], ["-", 51, 91, 28, 23, 0, 16, 12, 16, 17, 18], ["+", 51, 91, 28, 23, 0, 16, 12, 16, 17, 19]] | 1 | 75 | 4 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, n;
cin >> a >> b >> n;
for (int i = 0; i < n; i++) {
int x, y;
cin >> x >> y;
if (x <= b && a <= y) {
cout << 1 << endl;
return 0;
}
}
cout << 0 << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, n;
cin >> a >> b >> n;
for (int i = 0; i < n; i++) {
int x, y;
cin >> x >> y;
if (x < b && a < y) {
cout << 1 << endl;
return 0;
}
}
cout << 0 << endl;
return 0;
} | [["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 19], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 18], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 19], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 18]] | 1 | 84 | 4 |
#include <iostream>
using namespace std;
int main() {
int a, b, N, s, f;
int flag = 0;
cin >> a >> b >> N;
for (int i = 0; i < N; i++) {
cin >> s >> f;
if (!flag && a < f && a + b > s)
flag = 1;
}
cout << flag;
return 0;
} | #include <iostream>
using namespace std;
int main() {
int a, b, N, s, f;
int flag = 0;
cin >> a >> b >> N;
for (int i = 0; i < N; i++) {
cin >> s >> f;
if (!flag && a < f && b > s)
flag = 1;
}
cout << flag << endl;
return 0;
} | [["-", 15, 339, 51, 16, 12, 16, 31, 16, 31, 22], ["-", 15, 339, 51, 16, 12, 16, 31, 16, 17, 72], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]] | 1 | 84 | 4 |
#include <iostream>
using namespace std;
int main() {
int a, b, n, k[102], l[102], x = 0;
cin >> a >> b >> n;
for (int i = 0; i <= n; i++) {
cin >> k[i] >> l[i];
if (b <= k[i] || l[i] <= a) {
x = 0;
} else {
x = 1;
break;
}
}
cout << x << endl;
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int a, b, n, k[102], l[102], x = 0;
cin >> a >> b >> n;
for (int i = 1; i <= n; i++) {
cin >> k[i] >> l[i];
if (b <= k[i] || l[i] <= a) {
x = 0;
} else {
x = 1;
break;
}
}
cout << x << endl;
return 0;
}
| [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 109 | 2 |
#include <bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb emplace_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
const int32_t inf = 1001001001;
const int64_t infll = 1001001001001001001ll;
const int dx[] = {0, -1, 1, 0, -1, 1, -1, 1}... | #include <bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb emplace_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
const int32_t inf = 1001001001;
const int64_t infll = 1001001001001001001ll;
const int dx[] = {0, -1, 1, 0, -1, 1, -1, 1}... | [["-", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22], ["-", 8, 9, 0, 1, 0, 16, 31, 16, 17, 152], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 152], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22]] | 1 | 1,125 | 4 |
#include <stdio.h>
int main(void) {
int w, h, i, b;
scanf("%d,%d", &w, &h);
char c = getchar();
for (i = 1; i <= h; i++) {
if (i == 1 || i == h) {
printf("+");
for (int a = 0; a < (w - 2) / 2; a++) {
printf("--");
}
printf("-+\n");
} else {
if (i == h / 2 + 1) {
... | #include <stdio.h>
int main(void) {
int w, h, i, b;
scanf("%d %d ", &w, &h);
char c = getchar();
for (i = 1; i <= h; i++) {
if (i == 1 || i == h) {
printf("+");
for (int a = 0; a < (w - 2) / 2; a++) {
printf("--");
}
printf("-+\n");
} else {
if (i == h / 2 + 1) {
... | [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]] | 1 | 235 | 2 |
w, h, a = input().split()
w, h= int(w), int(h)
for i in range(h):
if i in {0, h -1}:print("+" + "-" * (w - 2) + "+")
else:print("|" + "-" * ((w - 2) // 2) + a + "-" * ((w - 2) // 2) + "|" if i == h // 2 else "|" + "-" * (w - 2) + "|")
| w, h, a = input().split()
w, h= int(w), int(h)
for i in range(h):
if i in {0, h -1}:print("+" + "-" * (w - 2) + "+")
else:print("|" + "." * ((w - 2) // 2) + a + "." * ((w - 2) // 2) + "|" if i == h // 2 else "|" + "." * (w - 2) + "|")
| [["-", 31, 657, 31, 657, 12, 657, 31, 557, 0, 6], ["+", 31, 657, 31, 657, 12, 657, 31, 557, 0, 6], ["-", 0, 657, 31, 657, 12, 657, 31, 557, 0, 6], ["+", 0, 657, 31, 657, 12, 657, 31, 557, 0, 6]] | 5 | 131 | 6 |
// AOJ Vol3-0383 Heat Strokes
// 2018.12.22
//#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main() {
int A, B, X;
int c, ans;
scanf("%d%d%d", &A, &B, &X);
if (A >= 2 * B)
ans = ((X - 1) / 500 + 1) * B;
else {
ans = X / 1000 * A;
c = A % 1000;
if (c) {
if (c <= 500 && B < A)
... | // AOJ Vol3-0383 Heat Strokes
// 2018.12.22
//#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main() {
int A, B, X;
int c, ans;
scanf("%d%d%d", &A, &B, &X);
if (A >= 2 * B)
ans = ((X - 1) / 500 + 1) * B;
else {
ans = X / 1000 * A;
c = X % 1000;
if (c) {
if (c <= 500 && B < A)
... | [["-", 0, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 0, 9, 0, 1, 0, 11, 12, 16, 31, 22]] | 0 | 118 | 2 |
#include <iostream>
using namespace std;
int main() {
int a, b, x;
cin >> a >> b >> x;
int ans = 0;
if (a <= b) {
ans = (x + 999) / 1000 * a;
} else if (2 * b < a) {
ans = (x + 499) / 500 * b;
} else {
ans = x / 1000 * a;
x %= 1000;
ans += (x + 499) / 500 * b;
}
cout << ans << end... | #include <iostream>
using namespace std;
int main() {
int a, b, x;
cin >> a >> b >> x;
int ans = 0;
if (a <= b) {
ans = (x + 999) / 1000 * a;
} else if (2 * b < a) {
ans = (x + 499) / 500 * b;
} else {
ans = x / 1000 * a;
x %= 1000;
ans += min(a, (x + 499) / 500 * b);
}
cout << an... | [["+", 0, 9, 0, 1, 0, 11, 12, 2, 63, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 22], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 21], ["+", 3, 4, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 2, 3, 4, 0, 25]] | 1 | 111 | 5 |
#include <bits/stdc++.h>
using namespace std;
int H, W;
int t[1000][1000];
int total = 0;
int main() {
scanf("%d %d", &H, &W);
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
scanf("%d", &t[i][j]);
total += t[i][j];
}
}
for (int i = 0; i < H; i++) {
int sum = 0;
for (i... | #include <bits/stdc++.h>
using namespace std;
int H, W;
int t[1000][1000];
int total = 0;
int main() {
scanf("%d %d", &W, &H);
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
scanf("%d", &t[i][j]);
total += t[i][j];
}
}
for (int i = 0; i < H; i++) {
int sum = 0;
for (i... | [["-", 0, 1, 0, 2, 3, 4, 0, 66, 28, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 66, 28, 22]] | 1 | 393 | 4 |
// Heat Strokes 2018/12/28
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int A, B, X;
int max_A, X_B, price;
cin >> A >> B >> X;
if (X > 1000)
max_A = 1;
else {
max_A = X / 1000;
if (X % 1000)
max_A++;
}
price = B * (X / 500 + 1); // 最大値(or + B)
for (in... | // Heat Strokes 2018/12/28
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int A, B, X;
int max_A, X_B, price;
cin >> A >> B >> X;
if (X < 1000)
max_A = 1;
else {
max_A = X / 1000;
if (X % 1000)
max_A++;
}
// cout << "max_A: " << max_A << endl;
price = B ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]] | 1 | 164 | 2 |
#include <iostream>
using namespace std;
int main() {
int A, B, X;
cin >> A >> B >> X;
int P = 0;
if (A >= 2 * B) {
P = (X / 500) * B;
if (X / 500 != 0) {
P += B;
}
} else {
P = (X / 1000) * A;
if (X % 1000 != 0) {
if (X % 1000 <= 500 && A > B) {
P += B;
} else ... | #include <iostream>
using namespace std;
int main() {
int A, B, X;
cin >> A >> B >> X;
int P = 0;
if (A >= 2 * B) {
P = (X / 500) * B;
if (X % 500 != 0) {
P += B;
}
} else {
P = (X / 1000) * A;
if (X % 1000 != 0) {
if (X % 1000 <= 500 && A > B) {
P += B;
} else ... | [["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 85], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 109]] | 1 | 120 | 2 |
#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 28;
int main() {
string S;
cin >> S;
int ret = *max_element(begin(S), end(S)) - *min_element(begin(S), end(S));
for (int i = 2; i < S.size(); i++) {
if (S.size() % i)
continue;
string small, large;
for (int j = 0; j < S.si... | #include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 28;
int main() {
string S;
cin >> S;
int ret = *max_element(begin(S), end(S)) - *min_element(begin(S), end(S));
for (int i = 2; i < S.size(); i++) {
if (S.size() % i)
continue;
string small, large;
for (int j = 0; j < S.si... | [["+", 31, 16, 31, 69, 341, 342, 0, 16, 17, 72], ["+", 31, 16, 31, 69, 341, 342, 0, 16, 12, 13]] | 1 | 421 | 2 |
#include <algorithm>
#include <math.h>
#include <stdio.h>
#include <utility>
#include <vector>
using namespace std;
typedef pair<int, int> pi;
#define F first
#define S second
#define PB push_back
bool check(pi a, pi b) { return a.F * b.S - a.S * b.F >= 0; }
template <class _T> _T line(_T a, _T b) { return {b.F - a.F, ... | #include <algorithm>
#include <math.h>
#include <stdio.h>
#include <utility>
#include <vector>
using namespace std;
typedef pair<int, int> pi;
#define F first
#define S second
#define PB push_back
bool check(pi a, pi b) { return a.F * b.S - a.S * b.F >= 0; }
template <class _T> _T line(_T a, _T b) { return {b.F - a.F, ... | [["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 22]] | 1 | 1,299 | 2 |
#include <cmath>
#include <iostream>
using namespace std;
int sum(int x) {
int a = 0;
while (x) {
a += x % 10;
x /= 10;
}
return a;
}
int main() {
int a, n, m;
cin >> a >> n >> m;
int ans = 0;
for (int i = 2; pow(i, n) <= m; i++) {
int x = pow(i, n);
if (i == sum(x) + a)
ans++;
... | #include <cmath>
#include <iostream>
using namespace std;
int sum(int x) {
int a = 0;
while (x) {
a += x % 10;
x /= 10;
}
return a;
}
int main() {
int a, n, m;
cin >> a >> n >> m;
int ans = 0;
for (int i = 1; pow(i, n) <= m; i++) {
int x = pow(i, n);
if (i == sum(x) + a)
ans++;
... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 120 | 2 |
#include <bits/stdc++.h>
using namespace std;
struct UnionFind {
vector<int> data;
UnionFind(int sz) { data.assign(sz, -1); }
bool unite(int x, int y) {
x = find(x), y = find(y);
if (x == y)
return (false);
if (data[x] > data[y])
swap(x, y);
data[x] += data[y];
data[y] = x;
... | #include <bits/stdc++.h>
using namespace std;
struct UnionFind {
vector<int> data;
UnionFind(int sz) { data.assign(sz, -1); }
bool unite(int x, int y) {
x = find(x), y = find(y);
if (x == y)
return (false);
if (data[x] > data[y])
swap(x, y);
data[x] += data[y];
data[y] = x;
... | [["-", 51, 91, 28, 69, 28, 69, 341, 342, 0, 22], ["+", 51, 91, 28, 69, 28, 69, 341, 342, 0, 13], ["-", 15, 339, 51, 91, 28, 69, 341, 342, 0, 13], ["+", 15, 339, 51, 91, 28, 69, 341, 342, 0, 22]] | 1 | 1,101 | 4 |
#include <bits/stdc++.h>
using namespace std;
#define INF_LL (ll)1e18
#define INF (int)1e9
#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define all(x) x.begin(), x.end()
#define fs first
#define sc second
using ll = long long;
using PII = pair<int, int>;
using PL... | #include <bits/stdc++.h>
using namespace std;
#define INF_LL (ll)1e18
#define INF (int)1e9
#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define all(x) x.begin(), x.end()
#define fs first
#define sc second
using ll = long long;
using PII = pair<int, int>;
using PL... | [["-", 3, 4, 0, 69, 28, 69, 341, 342, 0, 13], ["+", 3, 4, 0, 69, 28, 69, 341, 342, 0, 22]] | 1 | 1,533 | 4 |
<?php
//??????????????¬???????????????????????°????????\????????¨????????°
$rightCard = 0;
$leftCard = 0;
//?????????????¨??????\???????????°
$rightAns = 0;
$leftAns = 0;
while(true){
//??\?????????????????????
$stdin=trim(fgets(STDIN));
//??????????????°???0??????break
if($sidin == 0){
break;
}... | <?php
//??????????????¬???????????????????????°????????\????????¨????????°
$rightCard = 0;
$leftCard = 0;
//?????????????¨??????\???????????°
$rightAns = 0;
$leftAns = 0;
while(true){
//??\?????????????????????
$stdin=trim(fgets(STDIN));
//??????????????°???0??????break
if($stdin == 0){
break;
}... | [["-", 0, 57, 15, 23, 0, 16, 31, 606, 0, 141], ["+", 0, 57, 15, 23, 0, 16, 31, 606, 0, 141], ["+", 8, 9, 0, 7, 0, 16, 12, 606, 0, 607]] | 6 | 216 | 5 |
while ($n = trim(fgets(STDIN))) {
$score = array('a' => 0, 'b' =>0);
for ($i = 0; $i < $n; $i++) {
list($a_card, $b_card) = explode(' ', trim(fgets(STDIN)));
if($a_card == $b_card) {
$score['a'] += $a_card;
$score['b'] += $b_card;
} elseif($a_card > $b_card) {
... | <?php
while ($n = trim(fgets(STDIN))) {
$score = array('a' => 0, 'b' =>0);
for ($i = 0; $i < $n; $i++) {
list($a_card, $b_card) = explode(' ', trim(fgets(STDIN)));
if($a_card == $b_card) {
$score['a'] += $a_card;
$score['b'] += $b_card;
} elseif($a_card > $b_card)... | [["+", 36, 36, 36, 36, 36, 36, 0, 493, 0, 605]] | 6 | 162 | 19 |
#include <bits/stdc++.h>
using namespace std;
const int N = 202;
int g[N][N];
int G(int w, int b) {
if (g[w][b] >= 0)
return g[w][b];
bool a[N];
if (w > 0)
a[G(w - 1, b)] = true;
for (int i = 1; i <= min(w, b); ++i)
a[G(w, b - i)] = true;
if (b > 0)
a[G(w + 1, b - 1)] = true;
int ret = 0;... | #include <bits/stdc++.h>
using namespace std;
const int N = 202;
int g[N][N];
int G(int w, int b) {
if (g[w][b] >= 0)
return g[w][b];
bool a[N] = {};
if (w > 0)
a[G(w - 1, b)] = true;
for (int i = 1; i <= min(w, b); ++i)
a[G(w, b - i)] = true;
if (b > 0)
a[G(w + 1, b - 1)] = true;
int ret... | [["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 45], ["+", 8, 9, 0, 43, 49, 50, 51, 83, 0, 46]] | 1 | 227 | 3 |
#include <stdio.h>
typedef struct {
int flip;
long long rotate;
} Query;
long long n, k, q;
Query tree[(1 << 20) * 2];
void build(long long _n);
Query merge(Query a, Query b);
void update(Query data, long long i);
Query sum(void);
int main() {
long long _n;
long long a;
scanf("%lld %lld %lld", &k, &_n, ... | #include <stdio.h>
typedef struct {
int flip;
long long rotate;
} Query;
long long n, k, q;
Query tree[(1 << 20) * 2];
void build(long long _n);
Query merge(Query a, Query b);
void update(Query data, long long i);
Query sum(void);
int main() {
long long _n;
long long a;
scanf("%lld %lld %lld", &k, &_n, ... | [["+", 75, 76, 0, 1, 0, 11, 12, 91, 17, 33], ["-", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 33], ["-", 0, 11, 12, 16, 31, 23, 0, 16, 17, 33], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72]] | 0 | 554 | 5 |
A, B = map(int, input().split())
print((B+A-1)/A)
| A, B = map(int, input().split())
print((B+A-1)//A)
| [["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 85], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 676]] | 5 | 28 | 2 |
H,a,b=map(int,input().split())
c=0
for i in range(a,b):
if H%i==0 :
c+=1
print(c)
| H,a,b=map(int,input().split())
c=0
for i in range(a,b+1):
if H%i==0 :
c+=1
print(c)
| [["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 45 | 2 |
N,K = map(int, input().split())
t = n = a = 1
while True:
n = (K+a-1)/K
a += n;
if N < a: break
t += 1
print(t)
| N,K = map(int, input().split())
t = n = a = 1
while True:
n = (K+a-1)//K
a += n;
if N < a: break
t += 1
print(t)
| [["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 85], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 676]] | 5 | 54 | 2 |
#include <ctype.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define inf (INT_MAX - 1)
#define INF 9223372036854775807
#define sq(n) ((n) * (n))
#define rep(i, n) for (i = 0; i < n; i++)
#define rev(i, n) for (i = n - 1; i >= 0; i--)
#define sort(a, n) qsort(a, n, ... | #include <ctype.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define inf (INT_MAX - 1)
#define INF 9223372036854775807
#define sq(n) ((n) * (n))
#define rep(i, n) for (i = 0; i < n; i++)
#define rev(i, n) for (i = n - 1; i >= 0; i--)
#define sort(a, n) qsort(a, n, ... | [["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 26, 27, 17, 29], ["+", 0, 14, 8, 9, 0, 7, 26, 11, 17, 107], ["+", 0, 14, 8, 9, 0, 7, 26, 11, 12, 13]] | 0 | 466 | 5 |
#include <algorithm>
#include <cassert>
#include <iostream>
#include <vector>
using namespace std;
int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
main() {
int x, y;
cin >> x >> y;
vector<int> v;
v.push_back(3);
for (int i = 0; i < 3000000; i++)
v.push_back(v[i]);
cout << (x + 1) + (y + 1) - (... | #include <algorithm>
#include <cassert>
#include <iostream>
#include <vector>
using namespace std;
int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
main() {
int x, y;
cin >> x >> y;
vector<int> v;
v.push_back(3);
for (int i = 0; i < 5000000; i++)
v.push_back(v[i]);
cout << (x + 1) + (y + 1) - (... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]] | 1 | 122 | 4 |
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vecto... | #include <algorithm>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vecto... | [["-", 12, 16, 31, 16, 12, 16, 31, 16, 31, 22], ["-", 12, 16, 31, 16, 12, 16, 31, 16, 17, 48], ["-", 12, 16, 31, 16, 12, 16, 31, 16, 12, 22], ["-", 31, 16, 12, 16, 31, 16, 12, 16, 17, 85]] | 1 | 108 | 4 |
#include <iostream>
using namespace std;
int min(int x, int y) { return (x > y) ? y : x; }
int gcd(int x, int y) {
int n = min(x, y);
for (; n >= 1; n--) {
if (x % n == 0 && y % n == 0)
return n;
}
return 1;
}
int main() {
int tate, yoko;
cin >> yoko >> tate;
cout << (tate + 1) + (yoko) +... | #include <iostream>
using namespace std;
int min(int x, int y) { return (x > y) ? y : x; }
int gcd(int x, int y) {
int n = min(x, y);
for (; n >= 1; n--) {
if (x % n == 0 && y % n == 0)
return n;
}
return 1;
}
int main() {
int tate, yoko;
cin >> yoko >> tate;
cout << (tate + 1) + (yoko) +... | [["-", 31, 16, 12, 2, 3, 4, 0, 16, 17, 48], ["-", 31, 16, 12, 2, 3, 4, 0, 16, 12, 13]] | 1 | 128 | 2 |
#include <iostream>
using namespace std;
int gcd(int x, int y) {
if (y == 0)
return x;
return gcd(y, y % x);
}
int main() {
int x, y;
cin >> x >> y;
int g = gcd(x, y);
cout << (x + 1) + (y + 1) - (g + 1) << endl;
return 0;
}
| #include <iostream>
using namespace std;
int gcd(int x, int y) {
if (y == 0)
return x;
return gcd(y, x % y);
}
int main() {
int x, y;
cin >> x >> y;
int g = gcd(x, y);
cout << (x + 1) + (y + 1) - (g + 1) << endl;
return 0;
}
| [["-", 0, 37, 0, 2, 3, 4, 0, 16, 31, 22], ["-", 0, 37, 0, 2, 3, 4, 0, 16, 17, 109], ["+", 0, 37, 0, 2, 3, 4, 0, 16, 17, 109], ["+", 0, 37, 0, 2, 3, 4, 0, 16, 12, 22]] | 1 | 88 | 4 |
#include <stdio.h>
int d[300005];
int check1(int s);
int check2(int s, int N);
int main(void) {
int N, i, f;
scanf("%d", &N);
for (i = 0; i < N; i++) {
scanf("%d", &d[i]);
}
f = check1(N - 1);
if (f == 0) {
printf("no\n");
return 0;
}
f = check2(0, N - 1);
if (f == 0) {
printf("no\n"... | #include <stdio.h>
int d[300005];
int check1(int s);
int check2(int s, int N);
int main(void) {
int N, i, f;
scanf("%d", &N);
for (i = 0; i < N; i++) {
scanf("%d", &d[i]);
}
f = check1(N - 1);
if (f == 0) {
printf("no\n");
return 0;
}
f = check2(0, N - 1);
if (f == 0) {
printf("no\n"... | [["-", 0, 57, 15, 23, 0, 16, 12, 16, 17, 33], ["-", 0, 57, 15, 23, 0, 16, 12, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 0 | 328 | 4 |
#include <algorithm>
#include <iostream>
#include <vector>
#define LL long long
int n;
std::vector<int> d;
int main() {
std::cin >> n;
for (int i = 0; i < n; i++) {
int tmp;
std::cin >> tmp;
d.push_back(tmp / 10);
}
bool flag = true;
int st = 0;
for (int i = 0; i < n - 1; i++) {
st = std::ma... | #include <algorithm>
#include <iostream>
#include <vector>
#define LL long long
int n;
std::vector<int> d;
int main() {
std::cin >> n;
for (int i = 0; i < n; i++) {
int tmp;
std::cin >> tmp;
d.push_back(tmp / 10);
}
bool flag = true;
int st = 0;
for (int i = 0; i < n - 1; i++) {
st = std::ma... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 230 | 4 |
#include <iostream>
using namespace std;
int main() {
long long a[300002];
int x, y, z;
cin >> x;
for (int i = 0; i < x; i++) {
cin >> a[i];
}
if (a[0] >= 10 && a[x - 1] >= 10) {
for (int i = 1; i < x; i++) {
int f = 0;
if (a[i] < 10) {
for (int j = i - 1; j >= 0; j--) {
... | #include <iostream>
using namespace std;
int main() {
long long a[300002];
int x, y, z;
cin >> x;
for (int i = 0; i < x; i++) {
cin >> a[i];
}
if (a[0] >= 10 && a[x - 1] >= 10) {
for (int i = 1; i < x; i++) {
int f = 0;
if (a[i] < 10) {
for (int j = i - 1; j >= 0; j--) {
... | [["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 12, 13]] | 1 | 240 | 4 |
#include <bits/stdc++.h>
#define rep(i, n) for (long long int(i) = 0; (i) < (int)(n); (i)++)
#define rrep(i, a, b) for (long long int i = (a); i < (b); i++)
#define rrrep(i, a, b) for (long long int i = (a); i >= (b); i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Abs(a, b) max(a, b) - m... | #include <bits/stdc++.h>
#define rep(i, n) for (long long int(i) = 0; (i) < (int)(n); (i)++)
#define rrep(i, a, b) for (long long int i = (a); i < (b); i++)
#define rrrep(i, a, b) for (long long int i = (a); i >= (b); i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Abs(a, b) max(a, b) - m... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 377 | 2 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define all(v) (v).begin(), (v).end()
#define rep(i, n) for (int i = 0; i < (n); i++)
template <class T = int> T in() {
T x;
std::cin >> x;
return x;
}
#define ... |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <set>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
#define all(v) (v).begin(), (v).end()
#define rep(i, n) for (int i = 0; i < (n); i++)
template <class T = int> T in() {
T x;
std::cin >> x;
return x;
}
#define ... | [["-", 0, 52, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 52, 8, 9, 0, 7, 15, 16, 17, 18]] | 1 | 426 | 2 |
#include <bits/stdc++.h>
using namespace std;
int a[300001], A[300001];
int main(void) {
int n, q;
int x, y;
int cnt = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
A[i] = a[i];
}
sort(a, a + n);
for (int i = 0; i < n; i++) {
if (a[i] == A[i]) {
cnt++;
}
}
if (cnt =... | #include <bits/stdc++.h>
using namespace std;
int a[300001], A[300001];
int main(void) {
int n, q;
int x, y;
int cnt = 0;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> a[i];
A[i] = a[i];
}
sort(a, a + n);
for (int i = 0; i < n; i++) {
if (a[i] == A[i]) {
cnt++;
}
}
if (cnt =... | [["-", 0, 57, 15, 339, 51, 16, 12, 69, 28, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 69, 28, 22]] | 1 | 276 | 2 |
#include <bits/stdc++.h>
using namespace std;
char s[100000], t[100000];
int main(void) {
int n, cnt[30];
int i, j;
cin >> n;
for (i = 0; i < n; i++)
cin >> s[i];
for (i = 0; i < n; i++)
cin >> t[i];
for (i = 0; i < 30; i++)
cnt[i] = 0;
cnt[s[0] - 97]++;
for (i = 0; i < n - 1; i++) {
if... | #include <bits/stdc++.h>
using namespace std;
char s[100000], t[100000];
int main(void) {
int n, cnt[30];
int i, j;
cin >> n;
for (i = 0; i < n; i++)
cin >> s[i];
for (i = 0; i < n; i++)
cin >> t[i];
for (i = 0; i < 30; i++)
cnt[i] = 0;
cnt[s[0] - 97]++;
for (i = 1; i < n - 1; i++) {
if... | [["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 13]] | 1 | 219 | 2 |
#include <iostream>
#define MOD 1000000007
#define N_MAX 100001
int main() {
int dp[27] = {};
char enter[N_MAX], exit[N_MAX];
int N;
std::cin >> N;
std::cin >> enter >> exit;
dp[enter[0] - 'a'] += 1;
for (int i = 0; i < N - 1; i++) {
dp[enter[i] - 'a'] += dp[exit[i] - 'a'];
dp[enter[i] - 'a'] %= ... | #include <iostream>
#define MOD 1000000007
#define N_MAX 100001
int main() {
int dp[27] = {};
char enter[N_MAX], exit[N_MAX];
int N;
std::cin >> N;
std::cin >> enter >> exit;
dp[enter[0] - 'a'] += 1;
for (int i = 1; i < N - 1; i++) {
dp[enter[i] - 'a'] += dp[exit[i] - 'a'];
dp[enter[i] - 'a'] %= ... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13]] | 1 | 146 | 2 |
#include <iostream>
#include <string>
using namespace std;
int main(void) {
int N;
unsigned long long star[26];
string EN, EX;
cin >> N;
cin >> EN;
cin >> EX;
for (int i = 0; i < 26; i++) {
star[i] = 0;
}
star[EN[0] - 0x61] = 1;
for (int i = 1; i < N; i++) {
int en = EN[i] - 0x61;
int ex... | #include <iostream>
#include <string>
using namespace std;
int main(void) {
int N;
unsigned long long star[26];
string EN, EX;
cin >> N;
cin >> EN;
cin >> EX;
for (int i = 0; i < 26; i++) {
star[i] = 0;
}
star[EN[0] - 0x61] = 1;
for (int i = 1; i < N - 1; i++) {
int en = EN[i] - 0x61;
in... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 33], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13]] | 1 | 156 | 6 |
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <complex>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <cassert>
#include <functi... | #include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <complex>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <cassert>
#include <functi... | [["-", 0, 37, 0, 41, 15, 16, 12, 91, 17, 33]] | 1 | 404 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.