buggy_code stringlengths 11 625k | fixed_code stringlengths 17 625k | bug_type stringlengths 2 4.45k | language int64 0 8 | token_count int64 5 200k |
|---|---|---|---|---|
#include <stdio.h>
#include <stdlib.h>
int main() {
int n, num;
scanf("%d", &n);
int *a = calloc(n, sizeof(int));
for (int x = 1; x < n; x++) {
for (int y = 1; y < n; y++)
for (int z = 1; (num = x * x + y * y + z * z + x * y + x * z + y * z) < n;
z++) {
a[num - 1]++;
}
}... | #include <stdio.h>
#include <stdlib.h>
int main() {
int n, num;
scanf("%d", &n);
int *a = calloc(n, sizeof(int));
for (int x = 1; x < n; x++) {
for (int y = 1; y < n; y++)
for (int z = 1;
(num = x * x + y * y + z * z + x * y + x * z + y * z) <= n; z++) {
a[num - 1]++;
}
... | [["-", 8, 9, 0, 7, 8, 7, 15, 16, 17, 18], ["+", 8, 9, 0, 7, 8, 7, 15, 16, 17, 19]] | 0 | 149 |
import math
s = int(input())
ans = [0] * 10000
a = 0
b = 0
c = 0
for i in range(3, 3 * math.floor(math.sqrt(s))):
for j in range(1, i):
a = j
for k in range(1, i - j):
b = k
c = i - a - b
d = a*a + b*b + c*c + a*b + b*c + c*a
ans[d - 1] += 1
for i in... | import math
s = int(input())
ans = [0] * 100000
a = 0
b = 0
c = 0
for i in range(3, 3 * math.floor(math.sqrt(s))):
for j in range(1, i):
a = j
for k in range(1, i - j):
b = k
c = i - a - b
d = a*a + b*b + c*c + a*b + b*c + c*a
ans[d - 1] += 1
for i i... | [["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]] | 5 | 134 |
a={}
b=[]
for i in range(1,91):
for j in range(i,91):
for k in range(j,91):
n=i*i+j*j+k*k+i*j+i*k+j*k
if n not in a:
if i==j and j==k:
a[n]=1
elif i==j or j==k or i==k:
a[n]=3
else:
... |
a={}
b=[]
for i in range(1,120):
for j in range(i,120):
for k in range(j,120):
n=i*i+j*j+k*k+i*j+i*k+j*k
if n not in a:
if i==j and j==k:
a[n]=1
elif i==j or j==k or i==k:
a[n]=3
else:
... | [["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]] | 5 | 193 |
import sys
import math
input = sys.stdin.readline
def readstr():
return input().strip()
def readint():
return int(input())
def readnums():
return map(int, input().split())
def readstrs():
return input().split()
def main():
N = readint()
ans = {i: 0 for i in range(1, N + 1)}
for i ... | import sys
import math
input = sys.stdin.readline
def readstr():
return input().strip()
def readint():
return int(input())
def readnums():
return map(int, input().split())
def readstrs():
return input().split()
def main():
N = readint()
ans = {i: 0 for i in range(1, 20000)}
for i ... | [["-", 0, 659, 12, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 659, 12, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 659, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 12, 703, 0, 659, 12, 652, 3, 4, 0, 612], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]] | 5 | 200 |
#include <math.h>
#include <stdio.h>
int main() {
int N, i, j, k, l, c, b, count = 0;
double a1, a2;
scanf("%d", &N);
for (i = 1; i <= N; i++) {
count = 0;
for (j = 1; j <= 60; j++) {
for (k = 1; k <= 60; k++) {
b = j + k;
c = -1 * i + j * j + k * k + j * k;
a1 = (-1 * b +... | #include <math.h>
#include <stdio.h>
int main() {
int N, i, j, k, l, c, b, count = 0;
double a1, a2;
scanf("%d", &N);
for (i = 1; i <= N; i++) {
count = 0;
for (j = 1; j <= 110; j++) {
for (k = 1; k <= 110; k++) {
b = j + k;
c = -1 * i + j * j + k * k + j * k;
a1 = (-1 * b... | [["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]] | 0 | 214 |
import numpy as np
arr = np.zeros(100000, dtype=np.int32)
for s in range(3, 100+1):
for x in range(1, s-2+1):
for y in range(1, s-1+1):
z = s - (x + y)
if z <= 0:
continue
arr[s**2 - (x*y + y*z + z*x) - 1] += 1
num = int(input())
for i in range(0, num)... | import numpy as np
arr = np.zeros(100000, dtype=np.int32)
for s in range(3, 128+1):
for x in range(1, s-2+1):
for y in range(1, s-1+1):
z = s - (x + y)
if z <= 0:
continue
arr[s**2 - (x*y + y*z + z*x) - 1] += 1
num = int(input())
for i in range(0, num)... | [["-", 0, 7, 12, 652, 3, 4, 0, 657, 31, 612], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 31, 612]] | 5 | 122 |
n = int(input())
ans = [0] * 10001
for x in range(1, 100):
for y in range(1, 100):
for z in range(1, 100):
if x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x < n:
ans[x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x] += 1
for i in range(1, n + 1):
print(ans[i]) | n = int(input())
ans = [0] * 10001
for x in range(1, 100):
for y in range(1, 100):
for z in range(1, 100):
if x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x <= n:
ans[x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x] += 1
for i in range(1, n + 1):
print(ans[i]) | [["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]] | 5 | 119 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define ll long long
using namespace std;
int main() {
int n;
cin >> n;
vector<int> ans(n + 5);
int sn = sqrt(n) - 4;
for (int x = 1; x < sn; x++) {
for (int y = 1; y <= sn; y++) {
for (int z = 1; z <= sn; z++) {
ll t... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define ll long long
using namespace std;
int main() {
int n;
cin >> n;
vector<int> ans(n + 5);
int sn = sqrt(n);
for (int x = 1; x < sn; x++) {
for (int y = 1; y <= sn; y++) {
for (int z = 1; z <= sn; z++) {
ll tmp =... | [["-", 8, 9, 0, 43, 49, 50, 51, 16, 17, 33], ["-", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]] | 1 | 164 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 1; i <= n; i++)
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(20000);
rep(i, 50) {
rep(j, 50) {
rep(k, 50) {
int b = (i * i) + (j * j) + (k * k) + (i * j) + (j * k) + (i * k);
a[b]++;
}
}
}
rep(i,... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 1; i <= n; i++)
using namespace std;
int main() {
int n;
cin >> n;
vector<int> a(60001);
rep(i, 100) {
rep(j, 100) {
rep(k, 100) {
int b = (i * i) + (j * j) + (k * k) + (i * j) + (j * k) + (i * k);
a[b]++;
}
}
}
rep... | [["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["-", 0, 9, 0, 42, 0, 2, 3, 4, 0, 13], ["+", 0, 9, 0, 1, 0, 2, 3, 4, 0, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]] | 1 | 126 |
#include <stdio.h>
int a[1000005];
int main(void) {
int x, y, z, n, i;
int t = 0;
scanf("%d", &n);
for (x = 1; x <= 100; ++x)
for (y = 1; y <= 100; ++y)
for (z = 1; z <= 100; ++z)
a[x * x + y * y + z * z + x * y + x * z + y * z]++;
for (i = 0; i < n; ++i) {
printf("%d\n", a[i]);
}
... | #include <stdio.h>
int a[1000005];
int main(void) {
int x, y, z, n, i;
int t = 0;
scanf("%d", &n);
for (x = 1; x <= 100; ++x)
for (y = 1; y <= 100; ++y)
for (z = 1; z <= 100; ++z)
a[x * x + y * y + z * z + x * y + x * z + y * z]++;
for (i = 1; i <= n; ++i) {
printf("%d\n", a[i]);
}
... | [["-", 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, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 0 | 139 |
import sys
import math
import statistics
import itertools
from collections import deque
N=int(input())
ans_lis =[0]*10000000
nn=math.sqrt(N)
n=int(nn)
#per_lis=itertools.permutations(list(range(1,4)))
for i in range(1,n+1):
for j in range(1,n+1):
for k in range(1,n+1):
tmp=0
tmp=i... | import sys
import math
import statistics
import itertools
from collections import deque
N=int(input())
ans_lis =[0]*10000000
nn=math.sqrt(N)
n=int(nn)
#per_lis=itertools.permutations(list(range(1,4)))
for i in range(1,n+1):
for j in range(1,n+1):
for k in range(1,n+1):
tmp=0
tmp=i... | [["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 22]] | 5 | 129 |
#include <bits/stdc++.h>
#define ll long long
#define dd double
#define scl(n) scanf("%lld", &n)
#define scd(n) scanf("%lf", &n)
#define ptl(n) printf("%lld", n)
#define ptd(n) printf("%lf", n)
#define nline printf("\n")
#define vld vector<ll>
#define vbd vector<bool>
#define eb emplace_back
#define FOR(i, n) for (ll ... | #include <bits/stdc++.h>
#define ll long long
#define dd double
#define scl(n) scanf("%lld", &n)
#define scd(n) scanf("%lf", &n)
#define ptl(n) printf("%lld", n)
#define ptd(n) printf("%lf", n)
#define nline printf("\n")
#define vld vector<ll>
#define vbd vector<bool>
#define eb emplace_back
#define FOR(i, n) for (ll ... | [["-", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["+", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13]] | 1 | 220 |
N = int(input())
ans = [0] * (N + 1)
for i in range(1,101):
for j in range(1,101):
if i ** 2 + j ** 2 > N: break
for k in range(1,101):
if i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i <= N:
ans[i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i] += 1
for i in ans: print... | N = int(input())
ans = [0] * N
for i in range(1,101):
for j in range(1,101):
if i ** 2 + j ** 2 > N: break
for k in range(1,101):
if i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i <= N:
ans[i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i - 1] += 1
for i in ans: print(i... | [["-", 0, 1, 0, 662, 12, 657, 12, 23, 0, 24], ["-", 0, 662, 12, 657, 12, 23, 0, 657, 17, 72], ["-", 0, 662, 12, 657, 12, 23, 0, 657, 12, 612], ["-", 0, 1, 0, 662, 12, 657, 12, 23, 0, 25], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 17, 33], ["+", 0, 1, 0, 677, 31, 206, 206, 657, 12, 612]] | 5 | 125 |
#include <bits/stdc++.h>
typedef long long int ll;
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
map<ll, ll> m;
for (ll i = 1; i <= 100; i++) {
for (ll j = 1; j <= 100; j++) {
for (ll k = 1; k <= 100; k++) {
ll a = (i * i) + (j * j) + (k * k) + (i * j) + (... | #include <bits/stdc++.h>
typedef long long int ll;
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
map<ll, ll> m;
for (ll i = 1; i <= 100; i++) {
for (ll j = 1; j <= 100; j++) {
for (ll k = 1; k <= 100; k++) {
ll a = (i * i) + (j * j) + (k * k) + (i * j) + (... | [["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]] | 1 | 170 |
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy
def main(... | import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy
def main(... | [["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612]] | 5 | 181 |
n = int(input())
ans = [0] * n
s = min(4, n - 2)
import math
t = math.sqrt(s)
t = math.floor(t)
for i in range(1, t + 1):
for j in range(i, t + 2):
for k in range(j, t + 3):
x = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i
if x <= n:
if i == j == k:
... | n = int(input())
ans = [0] * n
s = max(4, n - 2)
import math
t = math.sqrt(s)
t = math.floor(t)
for i in range(1, t + 1):
for j in range(i, t + 2):
for k in range(j, t + 3):
x = i ** 2 + j ** 2 + k ** 2 + i * j + j * k + k * i
if x <= n:
if i == j == k:
... | [["-", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22]] | 5 | 175 |
import itertools
import math
import collections
def main():
n = int(input())
s = int(math.sqrt(n))
a = list(itertools.product(range(1,s),repeat=3))
ans = []
for i in range(len(a)):
t = a[i][0] ** 2 + a[i][1] ** 2 + a[i][2] ** 2 + a[i][0] * a[i][1] + a[i][1] * a[i][2] + a[i][2] * a[i][0]
... | import itertools
import math
import collections
def main():
n = int(input())
s = int(math.sqrt(n))
a = list(itertools.product(range(1,s),repeat=3))
ans = []
for i in range(len(a)):
t = a[i][0] ** 2 + a[i][1] ** 2 + a[i][2] ** 2 + a[i][0] * a[i][1] + a[i][1] * a[i][2] + a[i][2] * a[i][0]
... | [["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]] | 5 | 177 |
N = gets.to_i
$counts = [0] * (N + 1)
def add(x, y, z)
n = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
if n <= N + 1
# puts "n=#{n}, #{x}, #{y}, #{z}"
$counts[n] += 1
false
else
# puts "over, n=#{n}, #{x}, #{y}, #{z}"
true
end
end
max = 100
(1..max).each do |x|
(1..max).each do |y|... | N = gets.to_i
$counts = [0] * (N + 1)
def add(x, y, z)
n = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
if n <= N
# puts "n=#{n}, #{x}, #{y}, #{z}"
$counts[n] += 1
false
else
# puts "over, n=#{n}, #{x}, #{y}, #{z}"
true
end
end
max = 100
(1..max).each do |x|
(1..max).each do |y|
... | [["-", 8, 736, 0, 121, 15, 738, 12, 738, 17, 72], ["-", 8, 736, 0, 121, 15, 738, 12, 738, 12, 612]] | 4 | 124 |
#include <algorithm>
#include <cmath>
#include <iostream>
#include <list>
#include <string>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
using str = string;
using vl = vector<ll>;
using vs = vector<str>;
using listl = list<ll>;
#define min(A, B) min(static_cast<ll>(A), static_cast<... | #include <algorithm>
#include <cmath>
#include <iostream>
#include <list>
#include <string>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
using str = string;
using vl = vector<ll>;
using vs = vector<str>;
using listl = list<ll>;
#define min(A, B) min(static_cast<ll>(A), static_cast<... | [["-", 0, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 0, 9, 0, 57, 15, 339, 51, 16, 17, 19]] | 1 | 1,006 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
bool f(int val, int rhs) {
bool ok = false;
for (int i = 1; i < 100; i++) {
if (i * (i + val) == rhs)
ok = true;
}
return ok;
}
int main() {
int N;
cin >> N;
vector<int> ans(N);
vector<vector<bool>> table(200, vector<bool>(1... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
bool f(int val, int rhs) {
bool ok = false;
for (int i = 1; i < 100; i++) {
if (i * (i + val) == rhs)
ok = true;
}
return ok;
}
int main() {
int N;
cin >> N;
vector<int> ans(N);
vector<vector<bool>> table(200, vector<bool>(1... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]] | 1 | 290 |
f = lambda x, y, z: (x + y + z) ** 2 - x * y - y * z - z * x - 1
n = int(input())
a = [0] * n
z = 1
while f(1, 1, z) < n:
y = 1
while y < z and f(1, y, z) < n:
x = 1
while f(x, y, z) < n:
a[f(x, y, z)] += 1
x += 1
y += 1
z += 1
print(*a, sep='\n')
| f = lambda x, y, z: (x + y + z) ** 2 - x * y - y * z - z * x - 1
n = int(input())
a = [0] * n
z = 1
while f(1, 1, z) < n:
y = 1
while f(1, y, z) < n:
x = 1
while f(x, y, z) < n:
a[f(x, y, z)] += 1
x += 1
y += 1
z += 1
print(*a, sep='\n')
| [["-", 8, 196, 0, 52, 15, 679, 31, 666, 0, 22], ["-", 8, 196, 0, 52, 15, 679, 31, 666, 667, 18], ["-", 0, 52, 8, 196, 0, 52, 15, 679, 17, 355]] | 5 | 129 |
#include <bits/stdc++.h>
using namespace std;
int main(void) {
int n;
cin >> n;
map<int, int> mp;
for (int i = 1; i <= 10; i++) {
for (int j = 1; j <= 10; j++) {
for (int k = 1; k <= 10; k++) {
int val = i * i + j * j + k * k + i * j + j * k + k * i;
mp[val]++;
}
}
}
for ... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n;
cin >> n;
map<int, int> mp;
for (int i = 1; i <= 100; i++) {
for (int j = 1; j <= 100; j++) {
for (int k = 1; k <= 100; k++) {
int val = i * i + j * j + k * k + i * j + j * k + k * i;
mp[val]++;
}
}
}
f... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]] | 1 | 137 |
N = int(input())
A = [0] * 10000
for x in range(1, int(pow(N, 0.5))):
for y in range(1, int(pow(N, 0.5))):
for z in range(1, int(pow(N, 0.5))):
value = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
if value > 10000:
break
A[value] += 1
for a in A[:N]:
... | N = int(input())
A = [0] * 10001
for x in range(1, int(pow(N, 0.5))):
for y in range(1, int(pow(N, 0.5))):
for z in range(1, int(pow(N, 0.5))):
value = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
if value > 10000:
break
A[value] += 1
for a in A[1:N+1]... | [["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612], ["+", 0, 656, 0, 7, 12, 206, 206, 663, 0, 612], ["+", 0, 7, 12, 206, 206, 663, 0, 657, 17, 72], ["+", 0, 7, 12, 206, 206, 663, 0, 657, 12, 612]] | 5 | 119 |
#include <bits/stdc++.h>
using namespace std;
int main(void) {
int n;
cin >> n;
vector<long long> ans(100001);
for (long x = 1; n >= x * x * 3; x++) {
ans[x * x * 6 - 1] += 1;
}
for (long x = 1; n >= x * x * 3; x++) {
for (long y = x + 1; n >= x * x * 3 + y * y + x * y * 2; y++) {
ans[x * x ... | #include <bits/stdc++.h>
using namespace std;
int main(void) {
int n;
cin >> n;
vector<long long> ans(100001);
for (long x = 1; n >= x * x * 3; x++) {
ans[x * x * 6 - 1] += 1;
}
for (long x = 1; n >= x * x * 3; x++) {
for (long y = x + 1; n >= x * x * 3 + y * y + x * y * 2; y++) {
ans[x * x ... | [["-", 0, 7, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 7, 8, 9, 0, 1, 0, 11, 12, 13]] | 1 | 311 |
#include <bits/stdc++.h>
using namespace std;
//#define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop ... | #include <bits/stdc++.h>
using namespace std;
//#define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop ... | [["-", 64, 9, 0, 57, 64, 1, 0, 11, 17, 32], ["+", 64, 9, 0, 57, 64, 1, 0, 11, 17, 107], ["-", 75, 76, 0, 57, 64, 1, 0, 11, 17, 32], ["+", 75, 76, 0, 57, 64, 1, 0, 11, 17, 107], ["-", 0, 57, 75, 76, 0, 1, 0, 11, 17, 32], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 17, 107]] | 1 | 1,037 |
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int N;
if (scanf("%d", &N) == EOF)
exit(1);
int i, x, y, z, count = 0;
for (i = 1; i <= N; i++) {
for (x = 1; x < 100; x++) {
if (x * x + 2 * x + 3 > i)
continue;
for (y = x; y < 100; y++) {
if (y * y + x * x + x * y ... | #include <stdio.h>
#include <stdlib.h>
int main(void) {
int N;
if (scanf("%d", &N) == EOF)
exit(1);
int i, x, y, z, count = 0;
for (i = 1; i <= N; i++) {
for (x = 1; x < 100; x++) {
if (x * x + 2 * x + 3 > i)
continue;
for (y = x; y < 100; y++) {
if (y * y + x * x + x * y ... | [["+", 0, 57, 64, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 57, 64, 9, 0, 1, 0, 11, 17, 32], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["+", 64, 9, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 64, 9, 0, 57, 64, 9, 0, 1, 0, 35]] | 0 | 280 |
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int x;
cin >> x;
vector<int> vec(114514);
for (int i = 1; i < 50; i++) {
for (int j = 1; j < 80; j++) {
for (int k = 1; k < 150; k++) {
int n = k * k + j * j + i * ... | #include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int x;
cin >> x;
vector<int> vec(500000);
for (int i = 1; i < 100; i++) {
for (int j = 1; j < 150; j++) {
for (int k = 1; k < 200; k++) {
int n = k * k + j * j + i ... | [["-", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["+", 8, 9, 0, 43, 49, 50, 51, 4, 0, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]] | 1 | 156 |
#include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
int N;
scanf("%d", &N);
int ans[10002] = {0};
for (int x = 1; x <= (int)sqrt(N); x++) {
for (int y = 1; y <= (int)sqrt(N); y++) {
for (int z = 1; z <= (int)sqrt(N); z++) {... | #include <limits.h>
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
int N;
scanf("%d", &N);
int ans[100002] = {0};
for (int x = 1; x <= (int)sqrt(N); x++) {
for (int y = 1; y <= (int)sqrt(N); y++) {
for (int z = 1; z <= (int)sqrt(N); z++) ... | [["-", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13], ["+", 8, 9, 0, 43, 49, 50, 49, 80, 81, 13]] | 0 | 162 |
#include <bits/stdc++.h>
using namespace std;
#define IN inline
#define CO const
typedef long long int64;
template <class T> IN T read() {
T x = 0, w = 1;
char c = getchar();
for (; !isdigit(c); c = getchar())
if (c == '-')
w = -w;
for (; isdigit(c); c = getchar())
x = x * 10 + c - '0';
return... | #include <bits/stdc++.h>
using namespace std;
#define IN inline
#define CO const
typedef long long int64;
template <class T> IN T read() {
T x = 0, w = 1;
char c = getchar();
for (; !isdigit(c); c = getchar())
if (c == '-')
w = -w;
for (; isdigit(c); c = getchar())
x = x * 10 + c - '0';
return... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 279 |
N=int(input())
keys=[]
for i in range(10**4):
keys.append(str(i+1))
values=[0]*(10**4)
d=dict(zip(keys, values))
for x in range(1, 150):
for y in range(x,150):
tmp=(x+y)**2
for z in range(y, 150):
if tmp+(y+z)**2+(x+z)**2>20000:
break
if (tmp+(y+z)**2+(x+z)**2)%2==1:
continue
... | N=int(input())
keys=[]
for i in range(10**4):
keys.append(str(i+1))
values=[0]*(10**4)
d=dict(zip(keys, values))
for x in range(1, 150):
for y in range(x,150):
tmp=(x+y)**2
for z in range(y, 150):
if tmp+(y+z)**2+(x+z)**2>20000:
break
if (tmp+(y+z)**2+(x+z)**2)%2==1:
continue
... | [["-", 0, 7, 8, 196, 0, 1, 0, 662, 0, 32], ["+", 0, 7, 8, 196, 0, 1, 0, 677, 17, 107]] | 5 | 245 |
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
int a(0), b, c, ans(0), tmp(0);
string s;
cin >> a;
int x[a];
for (int i = 0; i < a; i++)
x[i] = 0;
for (int i = 5; i < a; i++) {
for (int h = 1; h < i; h++) {
for (int j = 1; j < i - h; j++) {
if (h * h +... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
int a(0), b, c, ans(0), tmp(0);
string s;
cin >> a;
int x[a];
for (int i = 0; i < a; i++)
x[i] = 0;
for (int i = 5; i < a + 1; i++) {
for (int h = 1; h < i; h++) {
for (int j = 1; j < i - h; j++) {
if (h *... | [["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]] | 1 | 261 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
#define allrev(x) (x).rbegin(), (x).end()
#define pb push_back
#define pf push_front
#define fori(i, a, n) for (int i = a; i < n; ++i)
#define MAX(x) (*max_element(all(x)))
#define... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
#define allrev(x) (x).rbegin(), (x).end()
#define pb push_back
#define pf push_front
#define fori(i, a, n) for (int i = a; i < n; ++i)
#define MAX(x) (*max_element(all(x)))
#define... | [["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 8, 9, 0, 7, 8, 1, 0, 16, 12, 22], ["+", 0, 7, 8, 1, 0, 16, 12, 5, 0, 62], ["+", 0, 7, 8, 1, 0, 16, 12, 5, 0, 44]] | 1 | 305 |
N = int(input())
L = [0] * N
for x in range(1, 51):
for y in range(1, 51):
for z in range(1, 51):
calc = x**2 + y**2 + z**2 + x*y + y*z + z*x
if calc > N:
break
L[calc-1] += 1
for l in L:
print(l) | N = int(input())
L = [0] * N
for x in range(1, 101):
for y in range(1, 101):
for z in range(1, 101):
calc = x**2 + y**2 + z**2 + x*y + y*z + z*x
if calc > N:
break
else:
L[calc-1] += 1
for l in L:
print(l) | [["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 8, 196, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 7, 8, 196, 0, 57, 75, 76, 0, 95], ["+", 0, 7, 8, 196, 0, 57, 75, 76, 0, 102]] | 5 | 93 |
#include <bits/stdc++.h>
using namespace std;
unsigned int N;
vector<int> f(int n);
int main() {
cin >> N;
vector<int> ans = f(N);
// for_each(ans.begin(), ans.end(), [](int x){cout << x << endl;});
for (int i = 1; i < N + 1; i++) {
cout << ans[i] << endl;
}
return 0;
}
vector<int> f(int n) {
in... | #include <bits/stdc++.h>
using namespace std;
unsigned int N;
vector<int> f(int n);
int main() {
cin >> N;
vector<int> ans = f(N);
// for_each(ans.begin(), ans.end(), [](int x){cout << x << endl;});
for (int i = 1; i < N + 1; i++) {
cout << ans[i] << endl;
}
return 0;
}
vector<int> f(int n) {
in... | [["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 72], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]] | 1 | 210 |
#include <bits/stdc++.h>
using namespace std;
int xyz[20000];
int main() {
int n;
cin >> n;
for (int i = 1; i <= 50; i++) {
for (int j = 1; j <= 50; j++) {
for (int k = 1; k <= 50; k++) {
xyz[i * i + j * j + k * k + i * j + i * k + j * k]++;
}
}
}
for (int i = 1; i <= n; i++) {
... | #include <bits/stdc++.h>
using namespace std;
int xyz[200000];
int main() {
int n;
cin >> n;
for (int i = 1; i <= 100; i++) {
for (int j = 1; j <= 100; j++) {
for (int k = 1; k <= 100; k++) {
xyz[i * i + j * j + k * k + i * j + i * k + j * k]++;
}
}
}
for (int i = 1; i <= n; i++) {... | [["-", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["+", 36, 36, 0, 30, 0, 43, 49, 80, 81, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 13], ["-", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13], ["+", 0, 7, 8, 9, 0, 7, 15, 16, 12, 13]] | 1 | 129 |
#include <bits/stdc++.h>
#define rep(i, n) for (long long i = 0; i < (n); i++)
using namespace std;
int main() {
int N;
cin >> N;
cout << 1000 - N % 1000 << endl;
} | #include <bits/stdc++.h>
#define rep(i, n) for (long long i = 0; i < (n); i++)
using namespace std;
int main() {
int N;
cin >> N;
cout << (1000 - N % 1000) % 1000 << endl;
} | [["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25]] | 1 | 37 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int x = ceil(n / 1000);
cout << x * 1000 - n;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
double n;
cin >> n;
double x = ceil(n / 1000);
cout << abs(x * 1000 - n);
return 0;
}
| [["-", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 0, 30, 0, 14, 8, 9, 0, 43, 39, 40], ["+", 8, 9, 0, 1, 0, 16, 12, 2, 63, 22], ["+", 0, 1, 0, 16, 12, 2, 3, 4, 0, 24], ["+", 0, 1, 0, 16, 12, 2, 3, 4, 0, 25]] | 1 | 40 |
N = input()
print((10000 - N) % 1000) | N = int(input())
print((10000 - N) % 1000) | [["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]] | 5 | 15 |
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int surplus = n % 1000;
int change = 0;
if (surplus)
int change = 1000 - n % 1000;
cout << change << endl;
return 0;
} | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int surplus = n % 1000;
int change = 0;
if (surplus)
change = 1000 - n % 1000;
cout << change << endl;
return 0;
} | [["-", 0, 14, 8, 9, 0, 57, 0, 42, 0, 40]] | 1 | 53 |
price = int(input())
if price == 0:
print(0)
else:
print(1000-(price%1000))
| price = int(input())
if price % 1000 == 0:
print(0)
else:
print(1000-(price%1000))
| [["+", 0, 656, 0, 57, 15, 666, 0, 657, 17, 109], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 12, 612]] | 5 | 29 |
n = int(input())
x = (n+999)/1000
print(x*1000 - n) | n = int(input())
x = (n+999)//1000
print(x*1000 - n)
| [["-", 0, 656, 0, 1, 0, 662, 12, 657, 17, 85], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 676]] | 5 | 25 |
#include <iostream>
using namespace std;
int main() {
int input, numbers, surplus;
cin >> input;
numbers = input / 1000;
surplus = numbers * 1000 - input;
if (surplus == 1000) {
surplus = 0;
}
cout << surplus;
return 0;
} | #include <iostream>
using namespace std;
int main() {
int input, numbers, surplus;
cin >> input;
numbers = input / 1000;
surplus = (numbers + 1) * 1000 - input;
if (surplus == 1000) {
surplus = 0;
}
cout << surplus;
return 0;
} | [["+", 0, 11, 12, 16, 31, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 11, 12, 16, 31, 16, 31, 23, 0, 25]] | 1 | 56 |
import math
N = int(input()) # yen
number_of_bills = N / 1000
change = number_of_bills*1000 - N
if change < 0:
change += 1000
print(str(int(change)))
| N = int(input()) # yen
number_of_bills = int(N / 1000)
change = number_of_bills*1000 - N
if change < 0:
change += 1000
print(str(int(change)))
| [["-", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["-", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]] | 5 | 41 |
n = int(input())
a = n%1000
if a == 1000:
print(0)
else:
print(a) | n = int(input())
a = n%1000
if a == 0:
print(0)
else:
print(1000 - a) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 31, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 33]] | 5 | 28 |
N = input()
N = int(N)
print(N%1000) | N = input()
N = int(N)
print(-N%1000) | [["+", 0, 652, 3, 4, 0, 657, 31, 664, 17, 33]] | 5 | 17 |
n = int(input())
print(((n+999)//1000)*1000 - N) | n = int(input())
print(((n+999)//1000)*1000 - n) | [["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]] | 5 | 24 |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
int N;
scanf("%d", &N);
if (N % 1000 == 0) {
printf("%d\n", 0);
return 0;
} else {
printf("%d\n", ((N / 1000 + 1) * 1000) - (N % 1000));
return 0;
}
return 0;
} | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main() {
int N;
scanf("%d", &N);
if (N % 1000 == 0) {
printf("%d\n", 0);
return 0;
} else {
printf("%d\n", ((N / 1000 + 1) * 1000) - N);
return 0;
}
return 0;
} | [["-", 0, 2, 3, 4, 0, 16, 12, 23, 0, 24], ["-", 3, 4, 0, 16, 12, 23, 0, 16, 17, 109], ["-", 3, 4, 0, 16, 12, 23, 0, 16, 12, 13], ["-", 0, 2, 3, 4, 0, 16, 12, 23, 0, 25]] | 0 | 83 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int a;
cin >> a;
cout << 1000 - a % 1000 << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int a;
cin >> a;
cout << (1000 - a % 1000) % 1000 << endl;
}
| [["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25]] | 1 | 29 |
N = int(input())
r = N % 1000
if r == 0:
print(0)
else:
q = (N // 1000) + 1
print(q*1000 - r) | N = int(input())
r = N % 1000
if r == 0:
print(0)
else:
q = (N // 1000) + 1
print(q*1000 - N) | [["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]] | 5 | 41 |
#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <complex>
#include <cstring>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limit... | #include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <complex>
#include <cstring>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limit... | [["+", 31, 16, 12, 23, 0, 16, 31, 23, 0, 24], ["+", 12, 23, 0, 16, 31, 23, 0, 16, 31, 13], ["+", 12, 23, 0, 16, 31, 23, 0, 16, 17, 33], ["+", 0, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 0, 16, 31, 23, 0, 16, 12, 16, 12, 13], ["+", 31, 16, 12, 23, 0, 16, 31, 23, 0, 25]] | 1 | 545 |
#include <stdio.h>
#include <stdlib.h>
int main(void) {
int N, a;
a = scanf("%d", &N);
while (N > 999)
N -= 1000;
printf("%d\n", N);
return 0;
} | #include <stdio.h>
#include <stdlib.h>
int main(void) {
int N, a;
a = scanf("%d", &N);
N = 10000 - N;
while (N > 999)
N -= 1000;
printf("%d\n", N);
return 0;
} | [["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 31, 13], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]] | 0 | 51 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef set<int> se;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i, a, b) for (int i = a; i <= b; i++)
#define Fn 1.618033987
... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef set<int> se;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i, a, b) for (int i = a; i <= b; i++)
#define Fn 1.618033987
... | [["-", 0, 1, 0, 16, 31, 16, 12, 23, 0, 24], ["-", 0, 16, 31, 16, 12, 23, 0, 16, 31, 22], ["-", 0, 16, 31, 16, 12, 23, 0, 16, 17, 85], ["-", 0, 16, 31, 16, 12, 23, 0, 16, 12, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 23, 0, 25], ["+", 64, 9, 0, 1, 0, 16, 31, 16, 12, 13]] | 1 | 150 |
#include <stdio.h>
int main(void) {
int a;
scanf("%d", &a);
while (a >= 0) {
a -= 1000;
}
a = a * -1;
printf("%d\n", a);
return 0;
}
| #include <stdio.h>
int main(void) {
int a;
scanf("%d", &a);
while (a >= 1) {
a -= 1000;
}
a = a * -1;
printf("%d\n", a);
return 0;
}
| [["-", 8, 9, 0, 52, 15, 23, 0, 16, 12, 13], ["+", 8, 9, 0, 52, 15, 23, 0, 16, 12, 13]] | 0 | 53 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
cout << N % 1000 << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
cout << (1000 - N % 1000) % 1000 << endl;
return 0;
} | [["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 31, 13], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 33], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25]] | 1 | 30 |
N = int.input()
if N % 1000 == 0:
print(0)
else:
print(1000-(N%1000))
| N = int(input())
if N % 1000 == 0:
print(0)
else:
print(1000-(N%1000))
| [["-", 0, 1, 0, 662, 12, 652, 63, 319, 0, 131], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]] | 5 | 30 |
// delete when handing in
// delete when proceedig next
#define EXE
#ifdef EXE
// -------------------------------------------------------
#include <algorithm>
#include <bitset>
#include <cassert>
#include <iostream>
#include <map>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
;
vector<pa... | // delete when handing in
// delete when proceedig next
#define EXE
#ifdef EXE
// -------------------------------------------------------
#include <algorithm>
#include <bitset>
#include <cassert>
#include <iostream>
#include <map>
#include <stdio.h>
#include <string>
#include <vector>
using namespace std;
;
vector<pa... | [["-", 8, 9, 0, 171, 0, 1, 0, 11, 12, 13], ["+", 8, 9, 0, 171, 0, 1, 0, 11, 12, 13], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 280 |
print(abs(-(int(input())%1000))) | print(abs((-int(input())%1000))) | [["-", 3, 4, 0, 652, 3, 4, 0, 664, 17, 33], ["+", 3, 4, 0, 23, 0, 657, 31, 664, 17, 33]] | 5 | 17 |
/*
ID: rchalam1
LANG: C++14
TASK:
*/
// For train.usaco.org, fill the template above.
// Competitive Coding Template
// GCC OPTIMIAZTION FLAGS
#ifdef ONLINE_JUDGE
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#endif
#include <bits/stdc++.h>
/*
#include <fstream>
... | /*
ID: rchalam1
LANG: C++14
TASK:
*/
// For train.usaco.org, fill the template above.
// Competitive Coding Template
// GCC OPTIMIAZTION FLAGS
#ifdef ONLINE_JUDGE
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#endif
#include <bits/stdc++.h>
/*
#include <fstream>
... | [["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 23, 0, 16, 12, 23, 0, 25], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]] | 1 | 481 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n;
scanf("%d", &n);
printf("%d", n % 1000 == 0 ? 1000 - n % 1000 : 0);
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n;
scanf("%d", &n);
printf("%d", n % 1000 == 0 ? 0 : 1000 - n % 1000);
} | [["+", 0, 1, 0, 2, 3, 4, 0, 41, 64, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 41, 0, 102], ["-", 0, 1, 0, 2, 3, 4, 0, 41, 0, 102], ["-", 0, 1, 0, 2, 3, 4, 0, 41, 75, 13]] | 1 | 51 |
#include <iostream>
using namespace std;
int main() {
int N;
cin >> N;
if (N % 1000 != 0) {
cout << 1000 - N % 1000;
}
cout << 0;
}
| #include <iostream>
using namespace std;
int main() {
int N;
cin >> N;
if (N % 1000 != 0) {
cout << 1000 - N % 1000 << endl;
} else
cout << 0;
} | [["+", 0, 57, 64, 9, 0, 1, 0, 16, 17, 151], ["+", 0, 57, 64, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95]] | 1 | 41 |
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define ordered_set \
tree<ll, null_type, less_equal<ll>... | #pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define ordered_set \
tree<ll, null_type, less_equal<ll>... | [["+", 0, 16, 12, 23, 0, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 23, 0, 16, 12, 23, 0, 24], ["+", 31, 23, 0, 16, 12, 23, 0, 16, 17, 109], ["+", 31, 23, 0, 16, 12, 23, 0, 16, 12, 13], ["+", 0, 16, 31, 23, 0, 16, 12, 23, 0, 25], ["+", 0, 16, 12, 23, 0, 16, 31, 23, 0, 25]] | 1 | 282 |
// package beg_173;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int a = s.nextInt();
int b = a % 100;
System.out.println(1000 - b);
}
} | // package beg_173;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int a = s.nextInt();
int b = a % 1000;
System.out.println((1000 - b) % 1000);
}
}
| [["-", 8, 196, 0, 503, 49, 200, 51, 16, 12, 499], ["+", 8, 196, 0, 503, 49, 200, 51, 16, 12, 499], ["+", 8, 196, 0, 1, 0, 492, 3, 4, 0, 24], ["+", 0, 492, 3, 4, 0, 16, 31, 23, 0, 25], ["+", 0, 1, 0, 492, 3, 4, 0, 16, 17, 109], ["+", 0, 1, 0, 492, 3, 4, 0, 16, 12, 499]] | 3 | 63 |
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define int long long
#define ld long double
#define endl '\n'
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define vpii vector<pii>
#define gr vector<vpii>
#define str string
#define mask ... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define int long long
#define ld long double
#define endl '\n'
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define vpii vector<pii>
#define gr vector<vpii>
#define str string
#define mask ... | [["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25]] | 1 | 346 |
n = int(input())
m = 1000 - (n % 1000)
print(m)
| n = int(input())
m = (1000 - (n % 1000)) % 1000
print(m)
| [["+", 0, 1, 0, 662, 12, 657, 31, 23, 0, 24], ["+", 12, 657, 31, 23, 0, 657, 12, 23, 0, 25], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 17, 109], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 612]] | 5 | 21 |
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define FOR(i) for (cin >> i; i > 0; i--)
#define elif else if
#define pb push_back
#define ll long long
#define mp make_pair
#define all(x) x.begin(), x.end()
#define re(x) ... | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define FOR(i) for (cin >> i; i > 0; i--)
#define elif else if
#define pb push_back
#define ll long long
#define mp make_pair
#define all(x) x.begin(), x.end()
#define re(x) ... | [["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 0, 16, 31, 23, 0, 16, 12, 16, 12, 13], ["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 25]] | 1 | 82 |
// NAME-DEEPESH BHATT
// Institute-IIT Dhanbad
// MOTTO-THINK FIRST,CODE LATER
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll MOD = 1000000007;
#define endl '\n'
#define pb push_back
#define mp make_pair
// Check for signed int overflow
// use __builtin_popcount(num) to calculate no.of set... | // NAME-DEEPESH BHATT
// Institute-IIT Dhanbad
// MOTTO-THINK FIRST,CODE LATER
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll MOD = 1000000007;
#define endl '\n'
#define pb push_back
#define mp make_pair
// Check for signed int overflow
// use __builtin_popcount(num) to calculate no.of set... | [["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 24], ["+", 51, 16, 31, 23, 0, 16, 12, 23, 0, 25], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 109], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]] | 1 | 216 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
for (int i = 0; i < 10; i++)
if (N == 0) {
cout << 0 << endl;
break;
} else if ((i + 1) * 1000 > N) {
cout << (i + 1) * 1000 - N << endl;
break;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
for (int i = 0; i < 10; i++)
if (N == 0) {
cout << 0 << endl;
break;
} else if ((i + 1) * 1000 >= N) {
cout << (i + 1) * 1000 - N << endl;
break;
}
} | [["-", 75, 76, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 75, 76, 0, 57, 15, 339, 51, 16, 17, 20]] | 1 | 80 |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
double PI = acos(-1);
int main() {
int n;
cin >> n;
cout << 1000 - n % 1000 << '\n';
return 0;
}
| #include <bits/stdc++.h>
#define ll long long
using namespace std;
double PI = acos(-1);
int main() {
int n;
cin >> n;
cout << (1000 - n % 1000) % 1000 << '\n';
return 0;
}
| [["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25]] | 1 | 45 |
#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(a) a.begin(), a.end()
#define INF 1000000007
const ll MOD = 1000000007;
// accumulate(vec.begin(), vec.end(), 0)
// std::sort(v.begin(), v.end(), std::greater<Type>());
// set_intersectio... | #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(a) a.begin(), a.end()
#define INF 1000000007
const ll MOD = 1000000007;
// accumulate(vec.begin(), vec.end(), 0)
// std::sort(v.begin(), v.end(), std::greater<Type>());
// set_intersectio... | [["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25]] | 1 | 168 |
#include <stdio.h>
int main(void) {
int price, change;
scanf("%d", &price);
change = 1000 - price % 1000;
printf("%d", change);
return 0;
} | #include <stdio.h>
int main(void) {
int price, change;
scanf("%d", &price);
change = (1000 - price % 1000) % 1000;
printf("%d", change);
return 0;
} | [["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25]] | 0 | 44 |
#include <cmath>
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int m = ceil(n / 1000);
int change = abs(m * 1000 - n);
cout << change << endl;
} | #include <cmath>
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int m = (int)ceil(n / 1000.0);
int change = abs(m * 1000 - n);
cout << change << endl;
} | [["+", 8, 9, 0, 43, 49, 50, 51, 74, 0, 24], ["+", 0, 43, 49, 50, 51, 74, 39, 77, 39, 40], ["+", 8, 9, 0, 43, 49, 50, 51, 74, 0, 25], ["-", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13], ["+", 51, 74, 51, 2, 3, 4, 0, 16, 12, 13]] | 1 | 49 |
#include <cmath>
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int m = ceil(n / 1000);
int change = abs(m * 1000 - n);
cout << change << endl;
} | #include <cmath>
#include <iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int m = ceil(n / 1000.0);
int change = abs(m * 1000 - n);
cout << change << endl;
} | [["-", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13], ["+", 49, 50, 51, 2, 3, 4, 0, 16, 12, 13]] | 1 | 49 |
#include <iostream>
using namespace std;
int main() {
int n, r;
cin >> n;
r = n % 1000;
if (r > 500)
cout << 1000 - r;
else
cout << r;
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int n, r;
cin >> n;
r = n % 1000;
if (r != 0)
cout << 1000 - r;
else
cout << 0;
return 0;
}
| [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["-", 0, 57, 75, 76, 0, 1, 0, 16, 12, 22], ["+", 0, 57, 75, 76, 0, 1, 0, 16, 12, 13]] | 1 | 47 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int N = scan.nextInt();
int s = 0;
s = 1000 - (N % 1000) % 1000;
System.out.println(s);
}
} | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int N = scan.nextInt();
int s = 0;
s = (1000 - N % 1000) % 1000;
System.out.println(s);
}
} | [["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["-", 0, 11, 12, 16, 12, 16, 31, 23, 0, 24]] | 3 | 70 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
cout << 1000 - (n % 1000) << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
cout << (10000 - n) % 1000 << endl;
}
| [["-", 0, 1, 0, 16, 31, 16, 12, 16, 31, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 33], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 31, 13], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 33], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25], ["-", 0, 16, 31, 16, 12, 16, 12, 23, 0, 25]] | 1 | 31 |
num = int(input())
fraction = num % 1000
change =0
if fraction !=0:
change = 1000-change
print(change) | num = int(input())
fraction = num % 1000
change =0
if fraction !=0:
change = 1000-fraction
print(change) | [["-", 64, 196, 0, 1, 0, 662, 12, 657, 12, 22], ["+", 64, 196, 0, 1, 0, 662, 12, 657, 12, 22]] | 5 | 30 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int i = 0;
while (i >= n) {
i = i + 1000;
}
cout << i - n << endl;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int i = 0;
while (i < n) {
i = i + 1000;
}
cout << i - n << endl;
}
| [["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 18]] | 1 | 46 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
if (n % 1000 == 0) {
cout << 0;
} else {
cout << (((n % 1000) + 1) * 1000) - n;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
if (n % 1000 == 0) {
cout << 0;
} else {
cout << (((n / 1000) + 1) * 1000) - n;
}
}
| [["-", 31, 23, 0, 16, 31, 23, 0, 16, 17, 109], ["+", 31, 23, 0, 16, 31, 23, 0, 16, 17, 85]] | 1 | 54 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int change = 0;
while (n % 1000 == 0) {
change++;
n++;
}
cout << change << "\n";
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int change = 0;
while (n % 1000 != 0) {
change++;
n++;
}
cout << change << "\n";
}
| [["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 79]] | 1 | 48 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
const ll INF = 1ll << 60;
#define FOR(i, a, b) for (ll i = (a); i < (ll)(b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) (v).begin(), (v).end()
#define DEBUG(x) std:... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll MOD = 1e9 + 7;
// const ll MOD = 998244353;
const ll INF = 1ll << 60;
#define FOR(i, a, b) for (ll i = (a); i < (ll)(b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) (v).begin(), (v).end()
#define DEBUG(x) std:... | [["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 31, 13], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 33], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25]] | 1 | 118 |
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define ins insert
#define ull unsigned ... | #pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define ins insert
#define ull unsigned ... | [["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13], ["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 25]] | 1 | 283 |
n=int(input())
def main():
ans= 1000%(1000-n%1000)
return ans
print(main())
| n=int(input())
def main():
ans= (1000-n%1000)%1000
return ans
print(main())
| [["-", 8, 196, 0, 1, 0, 662, 12, 657, 31, 612], ["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 109], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 109], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 12, 612]] | 5 | 32 |
n = int(input())
otsuri = 1000 - (n % 1000)
if otsuri == 1000:
print(0)
else:
print(osturi) | n = int(input())
otsuri = 1000 - (n % 1000)
if otsuri == 1000:
print(0)
else:
print(otsuri) | [["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22]] | 5 | 32 |
#include <stdio.h>
int main() {
int n;
scanf("%d", n);
int r = 10000 - n;
while (r >= 1000) {
r = r - 1000;
}
printf("%d\n", r);
return 0;
}
| #include <stdio.h>
int main() {
int n;
scanf("%d", &n);
int r = 10000 - n;
while (r >= 1000) {
r -= 1000;
}
printf("%d\n", r);
return 0;
} | [["+", 0, 1, 0, 2, 3, 4, 0, 66, 17, 67], ["-", 0, 52, 8, 9, 0, 1, 0, 11, 17, 32], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 31, 22], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 17, 110]] | 0 | 54 |
#include <stdio.h>
int main(void) {
int N, a;
scanf("%d", &N);
if (N % 1000 == 0) {
a = N / 1000;
} else {
a = N / 1000 + 1;
}
int b = 1000 * a - N;
printf("%d¥n", b);
}
| #include <stdio.h>
int main(void) {
int N, a;
scanf("%d", &N);
if (N % 1000 == 0) {
a = N / 1000;
} else {
a = N / 1000 + 1;
}
int b = 1000 * a - N;
printf("%d\n", b);
}
| [["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44]] | 0 | 69 |
n = int(input())
x = 0
while x <= n:
x += 1000
print(x - n) | n = int(input())
x = 0
while x <= n:
x += 1000
print((x - n) % 1000) | [["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 25], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612]] | 5 | 25 |
import math
N = int(input())
print(int(math.ceil(N / 1000) * 1000)) | import math
N = int(input())
print(int(math.ceil(N / 1000) * 1000) - N)
| [["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]] | 5 | 26 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
int main() {
int n;
cin >> n;
ll times = 0;
if (n % 1000 == 0)
cout << 0 << endl;
times = (n / 1000) + 1;
ll ans = (times * 1000) - n;
cout << ans << endl;
}
| #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
int main() {
int n;
cin >> n;
ll times = 0;
if (n % 1000 == 0)
cout << 0 << endl;
else {
times = (n / 1000) + 1;
ll ans = (times * 1000) - n;
cout << ans << endl;
}
}
| [["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 45], ["+", 8, 9, 0, 57, 75, 76, 0, 9, 0, 46]] | 1 | 74 |
#include <stdio.h>
int main(void) {
int n;
scanf("%d", &n);
int i = 0;
int change = 0;
while (i < 10) {
if (i * 1000 <= n && n <= (i + 1) * 1000) {
change = (i + 1) * 1000 - n;
}
i++;
}
printf("%d\n", change);
} | #include <stdio.h>
int main(void) {
int n;
scanf("%d", &n);
int i = 0;
int change = 0;
while (i < 10) {
if (i * 1000 < n && n <= (i + 1) * 1000) {
change = (i + 1) * 1000 - n;
}
i++;
}
printf("%d\n", change);
} | [["-", 0, 57, 15, 23, 0, 16, 31, 16, 17, 19], ["+", 0, 57, 15, 23, 0, 16, 31, 16, 17, 18]] | 0 | 85 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n) for (int i = n - 1; i >= a; i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define INF 0x3f3f3f3f
t... | #include <bits/stdc++.h>
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n) for (int i = n - 1; i >= a; i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define INF 0x3f3f3f3f
t... | [["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13], ["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 25]] | 1 | 228 |
#include <stdio.h>
int main(void) {
int N, change;
scanf("%d", &N);
change = 1000 - (N % 1000);
printf("%d", change);
return 0;
} | #include <stdio.h>
int main(void) {
int N, change;
scanf("%d", &N);
change = (10000 - N) % 1000;
printf("%d", change);
return 0;
} | [["-", 8, 9, 0, 1, 0, 11, 12, 16, 31, 13], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 31, 13], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 33], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25], ["-", 0, 1, 0, 11, 12, 16, 12, 23, 0, 25]] | 0 | 46 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
if (n % 1000 == 0) {
cout << 0 << endl;
} else {
cout << n - (n % 1000) << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
if (n % 1000 == 0) {
cout << 0 << endl;
} else {
cout << (1000 - n % 1000) % 1000 << endl;
}
} | [["-", 0, 1, 0, 16, 31, 16, 12, 16, 31, 22], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 33], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 31, 13], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 33], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]] | 1 | 50 |
#include <bits/stdc++.h>
using namespace std;
main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
long long i, j, k, l, m, n, o, p;
while (cin >> n) {
n %= 1000;
if (n > 500)
n = 1000 - n;
cout << n << endl;
}
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
long long i, j, k, l, m, n, o, p;
while (cin >> n) {
n %= 1000;
if (n != 0)
n = 1000 - n;
cout << n << endl;
}
return 0;
}
| [["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]] | 1 | 83 |
number = int(input())
thausand_number = int(number / 1000)
if number % 1000 == 0:
print(0)
else:
print(number - (thausand_number + 1) * 1000) | number = int(input())
thausand_number = int(number / 1000)
if number % 1000 == 0:
print(0)
else:
print((thausand_number + 1) * 1000 - number) | [["-", 0, 1, 0, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]] | 5 | 41 |
#include <bits/stdc++.h>
using namespace std;
main() {
int N;
cin >> N;
if (N >= 0 && N <= 10000)
cout << (1000 - N % 1000) << endl;
else
return (0);
} | #include <bits/stdc++.h>
using namespace std;
main() {
int N;
cin >> N;
if (N >= 0 && N <= 10000)
cout << (1000 - N % 1000) % 1000 << endl;
else
return (0);
} | [["+", 64, 1, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 64, 1, 0, 16, 31, 16, 12, 16, 12, 13]] | 1 | 46 |
n = int(input())
if n % 1000 == 0 :
a = n / 1000
else :
a = n / 1000 + 1
b = a * 1000
answer = int(b - n)
print(answer) | n = int(input())
if n % 1000 == 0 :
a = n / 1000
else :
a = int(n / 1000 + 1)
b = a * 1000
answer = int(b - n)
print(answer) | [["+", 8, 196, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]] | 5 | 46 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;
#define all(v) (v).begin(), (v).end()
#define sz(v) (int)(v).size()
int main(int argc, char *argv[]) {
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
cout << 1000 - (n % 1000) << '\n... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;
#define all(v) (v).begin(), (v).end()
#define sz(v) (int)(v).size()
int main(int argc, char *argv[]) {
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
cout << (1000 - (n % 1000)) % 10... | [["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 23, 0, 16, 12, 23, 0, 25], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]] | 1 | 94 |
#atcoder template
def main():
import sys
imput = sys.stdin.readline
#文字列入力の時は上記はerrorとなる。
#ここにコード
#input
n = int(input())
#output
while n >= 0:
n -= 1000
print(n + 1000)
#N = 1のときなどcorner caseを確認!
if __name__ == "__main__":
main() | #atcoder template
def main():
import sys
imput = sys.stdin.readline
#文字列入力の時は上記はerrorとなる。
#ここにコード
#input
n = int(input())
#output
while n > 0:
n -= 1000
print(-n)
#N = 1のときなどcorner caseを確認!
if __name__ == "__main__":
main() | [["-", 0, 14, 8, 196, 0, 52, 15, 666, 667, 20], ["+", 0, 14, 8, 196, 0, 52, 15, 666, 667, 47], ["+", 0, 1, 0, 652, 3, 4, 0, 664, 17, 33], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 72], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612]] | 5 | 52 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll n;
cin >> n;
if (n % 1000)
cout << (n - (n % 1000));
else
cout << "0\n";
return 0;
} | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll n;
cin >> n;
if (n % 1000)
cout << (1000 - (n % 1000));
else
cout << "0\n";
return 0;
} | [["-", 64, 1, 0, 16, 12, 23, 0, 16, 31, 22], ["+", 64, 1, 0, 16, 12, 23, 0, 16, 31, 13]] | 1 | 53 |
#include <bits/stdc++.h>
using namespace std;
void solve1() {
int n;
cin >> n;
cout << n % 1000 << endl;
}
int main() {
// your code goes here
solve1();
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
void solve1() {
int n;
cin >> n;
cout << (1000 - n % 1000) % 1000 << endl;
}
int main() {
// your code goes here
solve1();
return 0;
}
| [["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 31, 13], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 33], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25]] | 1 | 41 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.