buggy_code stringlengths 11 625k | fixed_code stringlengths 17 625k | bug_type stringlengths 2 4.45k | language int64 0 8 | token_count int64 5 200k |
|---|---|---|---|---|
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define INF 1073741824
#define ll long long
#define PI (2 * acos(0.0))
#define p1(n) printf("showing %d\n", n)
#define p2(m, n) printf("showing %d %d\n", m, n)
#define fastIO ... | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define INF 1073741824
#define ll long long
#define PI (2 * acos(0.0))
#define p1(n) printf("showing %d\n", n)
#define p2(m, n) printf("showing %d %d\n", m, n)
#define fastIO ... | [["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 21], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]] | 1 | 149 |
n = int(input())
if n%1000!=0:
print(min(1000-(n%1000)))
else:
print("0") | n = int(input())
if n%1000!=0:
print(1000-(n%1000))
else:
print("0") | [["-", 0, 1, 0, 652, 3, 4, 0, 652, 63, 22], ["-", 0, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["-", 0, 652, 3, 4, 0, 657, 12, 23, 0, 25]] | 5 | 36 |
/**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author cherrypi59
*/
#pragma GCC optimize("O2")
#pragma GCC optimize("tree-vectorize")
#pragma GCC target("sse4")
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FFOR(i, a, b) FOR(i, a, ... | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author cherrypi59
*/
#pragma GCC optimize("O2")
#pragma GCC optimize("tree-vectorize")
#pragma GCC target("sse4")
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FFOR(i, a, b) FOR(i, a, ... | [["-", 31, 16, 12, 16, 31, 23, 0, 16, 31, 22], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 31, 13]] | 1 | 345 |
#include <iostream>
using namespace std;
int main() {
int n, m;
cin >> n;
m = n % 1000;
if (n == 0)
cout << n << endl;
else
cout << 1000 - m << endl;
return 0;
} | #include <iostream>
using namespace std;
int main() {
int n, m;
cin >> n;
m = n % 1000;
if (m == 0)
cout << 0 << endl;
else
cout << 1000 - m << endl;
return 0;
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["-", 0, 57, 64, 1, 0, 16, 31, 16, 12, 22], ["+", 0, 57, 64, 1, 0, 16, 31, 16, 12, 13]] | 1 | 51 |
///////////////////////////////////////////////////////////////////////////////
#include <bits/stdc++.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
using namespace std;
///////////////////////////////////////////////////////////////////////////////
#define DEBUG 0
#define pb push_back
#define V ve... | ///////////////////////////////////////////////////////////////////////////////
#include <bits/stdc++.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
using namespace std;
///////////////////////////////////////////////////////////////////////////////
#define DEBUG 0
#define pb push_back
#define V ve... | [["+", 12, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["-", 0, 16, 31, 16, 12, 16, 12, 16, 17, 109], ["-", 0, 16, 31, 16, 12, 16, 12, 16, 12, 13]] | 1 | 1,190 |
#include <iostream>
using namespace std;
int main() {
int N = 0;
int M = 0;
cin >> N;
M = N % 1000;
if (0 == M) {
cout << "0" << endl;
} else {
cout << M << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int N = 0;
int M = 0;
cin >> N;
M = N % 1000;
if (0 == M) {
cout << "0" << endl;
} else {
cout << 1000 - M << endl;
}
return 0;
}
| [["+", 0, 1, 0, 16, 31, 16, 12, 16, 31, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 33]] | 1 | 60 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll N;
cin >> N;
ll p = 0;
while (p <= N) {
p += 1000;
}
cout << p - N << endl;
} | #include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
ll N;
cin >> N;
ll p = 0;
while (p < N) {
p += 1000;
}
cout << p - N << endl;
} | [["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 18]] | 1 | 47 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, r;
cin >> n;
r = n % 1000;
if (n == 0)
cout << 0 << endl;
else
cout << 1000 - r << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, r;
cin >> n;
r = n % 1000;
if (r == 0)
cout << 0 << endl;
else
cout << 1000 - r << endl;
return 0;
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22]] | 1 | 51 |
a = int(input())
b = 0
while b <= a:
b = b + 1000
print(abs(a-b)) |
a = int(input())
b = 0
while b < a:
b = b + 1000
print(abs(a-b)) | [["-", 36, 36, 0, 656, 0, 52, 15, 666, 667, 19], ["+", 36, 36, 0, 656, 0, 52, 15, 666, 667, 18]] | 5 | 30 |
<?php
// Your code here!
$n = trim(fgets(STDIN));
echo 1000 - ($n % 1000);
?>
| <?php
// Your code here!
$n = trim(fgets(STDIN));
echo (1000 - ($n % 1000)) % 1000;
?>
| [["+", 0, 493, 0, 608, 0, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 23, 0, 16, 12, 23, 0, 25], ["+", 36, 36, 0, 493, 0, 608, 0, 16, 17, 109], ["+", 36, 36, 0, 493, 0, 608, 0, 16, 12, 612]] | 6 | 24 |
function Main(input) {
input = input.split("\n");
var result = input % 1000;
if (result) {
result = 1000 - result;
}
console.log('%d', result);
return;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8")); | function Main(input) {
input = input.split("\n");
var result = parseInt(input) % 1000;
if (result) {
result = 1000 - result;
}
console.log('%d', result);
return;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8")); | [["+", 0, 198, 0, 200, 51, 16, 31, 2, 63, 22], ["+", 0, 200, 51, 16, 31, 2, 3, 3, 0, 24], ["+", 0, 200, 51, 16, 31, 2, 3, 3, 0, 25]] | 2 | 71 |
// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <cstdlib>
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int i;
for (i = 1000; n >= i; i += 1000)
;
cout << i - n << endl;
}
| // This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <cstdlib>
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int i;
for (i = 0; i < n; i += 1000)
;
cout << i - n << endl;
}
| [["-", 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, 31, 22], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 20], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 12, 22]] | 1 | 48 |
#!/usr/bin/python
# -*- Coding: utf-8 -*-
n = int(input())
if n % 1000 == 0:
print(0)
elif n > 1000:
a = (n//1000 + 1)*1000
print(a - n)
else:
print(n)
| #!/usr/bin/python
# -*- Coding: utf-8 -*-
n = int(input())
if n % 1000 == 0:
print(0)
elif n > 1000:
a = (n//1000 + 1)*1000
print(a - n)
else:
print(1000 - n) | [["+", 0, 1, 0, 652, 3, 4, 0, 657, 31, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 33]] | 5 | 49 |
def main():
N=int(input())
mod=N%1000
if N==0:
print("0")
else:
print(1000-mod)
if __name__=="__main__":
main() | def main():
N=int(input())
mod=N%1000
if mod==0:
print(0)
else:
print(1000-mod)
if __name__=="__main__":
main() | [["-", 0, 14, 8, 196, 0, 57, 15, 666, 0, 22], ["+", 0, 14, 8, 196, 0, 57, 15, 666, 0, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655]] | 5 | 47 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
n = 1000 - n % 1000;
if (n == 0)
n = 0;
cout << n << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
n = 1000 - n % 1000;
if (n == 1000)
n = 0;
cout << n << endl;
} | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]] | 1 | 43 |
def Next(): return input()
def NextInt(): return float(Next())
N = round(NextInt()*0.0010, 3)
import math
ans = math.ceil(N)
print(ans)
print(int(ans*1000-N*1000)) | def Next(): return input()
def NextInt(): return float(Next())
N = round(NextInt()*0.0010, 3)
import math
ans = math.ceil(N)
print(int(ans*1000-N*1000)) | [["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24]] | 5 | 60 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, anser;
cin >> n;
while (n >= 0) {
anser = n;
n = n - 1000;
}
cout << anser;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, anser;
cin >> n;
while (n > 0) {
anser = 1000 - n;
n = n - 1000;
}
cout << anser;
} | [["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 31, 13], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 33]] | 1 | 43 |
n = int(input())
if n % 1000 == 0:
print(0)
else:
res = n // 1000
rem = (1000 * (res + 1)) % n
print(rem) | n = int(input())
if n % 1000 == 0:
print(0)
else:
res = n // 1000
rem = (1000 * (res + 1)) - n
print(rem)
| [["-", 8, 196, 0, 1, 0, 662, 12, 657, 17, 109], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 33]] | 5 | 43 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 1; i <= n; ++i)
#define all(obj) (obj).begin(), (obj).end()
using P = pair<int, int>;
const int inf = 1e9;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;
con... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define REP(i, n) for (int i = 1; i <= n; ++i)
#define all(obj) (obj).begin(), (obj).end()
using P = pair<int, int>;
const int inf = 1e9;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;
con... | [["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 33], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 22]] | 1 | 114 |
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
void solve() {
int n;
cin >> n;
int n1 = 1000, mini = 100000000;
for (int i = 2; i <= 100; i++) {
if (n1 - n > 0)
mini = min(mini, n1 - n);
n1 = n1 * i;
}
cout << ceil(n / 1000.0) * 1000 - n << "\n";
}
int main() {
in... | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
void solve() {
int n;
cin >> n;
int n1 = 1000, mini = 100000000;
for (int i = 2; i <= 100; i++) {
if (n1 - n > 0)
mini = min(mini, n1 - n);
n1 = n1 * i;
}
cout << ceil(n / 1000.0) * 1000 - n << "\n";
}
int main() {
in... | [["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]] | 1 | 113 |
N= int(input())
for n in range(10):
a = 1000*n -N
if 0< a < 1000:
print(a)
break | N= int(input())
for n in range(11):
a = 1000*n -N
if 0<= a < 1000:
print(a)
break | [["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["-", 0, 7, 8, 196, 0, 57, 15, 666, 667, 18], ["+", 0, 7, 8, 196, 0, 57, 15, 666, 667, 19]] | 5 | 35 |
p = int(input())
count = 0
while p >= count:
count += 1000
print(count - p) | p = int(input())
count = 0
while p > count:
count += 1000
print(count - p) | [["-", 36, 36, 0, 656, 0, 52, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 52, 15, 666, 667, 47]] | 5 | 25 |
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define mod 1000000007
#define pb(x) push_back(x);
#define mp(x, y) make_pair(x, y)
#define mem(dp, a) memset(dp, a, sizeof dp);
#define all(a) a.begin(), a.end()
#define sall(a) sort(all(a))
#define X first
#define Y second
typedef long long int ll;
typ... | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define mod 1000000007
#define pb(x) push_back(x);
#define mp(x, y) make_pair(x, y)
#define mem(dp, a) memset(dp, a, sizeof dp);
#define all(a) a.begin(), a.end()
#define sall(a) sort(all(a))
#define X first
#define Y second
typedef long long int ll;
typ... | [["-", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 31, 22], ["-", 8, 9, 0, 57, 64, 1, 0, 11, 31, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 11, 31, 22], ["-", 0, 57, 64, 1, 0, 11, 12, 16, 12, 22], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 14, 8, ... | 1 | 211 |
"use strict";
const main = (arg) => {
let n = parseInt(arg);
console.log(Math.round(arg / 1000) * 1000 - n);
};
main(require("fs").readFileSync("/dev/stdin", "utf8")); | "use strict";
const main = (arg) => {
let n = parseInt(arg);
console.log(Math.ceil(arg / 1000) * 1000 - n);
};
main(require("fs").readFileSync("/dev/stdin", "utf8")); | [["-", 0, 16, 31, 16, 31, 2, 63, 558, 559, 560], ["+", 0, 16, 31, 16, 31, 2, 63, 558, 559, 560]] | 2 | 61 |
#include <algorithm>
#include <assert.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
#define int long long
#define double long double
#define rep(i, n) for (int i = 0; i < n; i++)
#define... | #include <algorithm>
#include <assert.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
#define int long long
#define double long double
#define rep(i, n) for (int i = 0; i < n; i++)
#define... | [["+", 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 | 1,139 |
#include <bits/stdc++.h>
#define MAXN
using namespace std;
int main() {
int n;
scanf("%d", &n);
if (n % 1000)
printf("0\n");
else
printf("%d", 1000 - n % 1000);
return 0;
}
| #include <bits/stdc++.h>
#define MAXN
using namespace std;
int main() {
int n;
scanf("%d", &n);
if (n % 1000 == 0)
printf("0\n");
else
printf("%d", 1000 - n % 1000);
return 0;
}
| [["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]] | 1 | 58 |
def INT():
return int(input())
def MI():
return map(int, input().split())
def LI():
return list(map(int, input().split()))
N = INT()
if N % 1000 == 0:
print(0)
else:
print(N % 1000) | def INT():
return int(input())
def MI():
return map(int, input().split())
def LI():
return list(map(int, input().split()))
N = INT()
if N % 1000 == 0:
print(0)
else:
print(1000 - N % 1000) | [["+", 0, 1, 0, 652, 3, 4, 0, 657, 31, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 33]] | 5 | 75 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
n = n % 1000;
cout << 1000 - n;
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
n = n % 1000;
cout << (1000 - n) % 1000;
return 0;
}
| [["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 25], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 12, 13]] | 1 | 34 |
n = int(input())
q, mod = divmod(n, 1000)
if mod == 0:
print(0)
else:
print(q * 1000 - mod)
| n = int(input())
q, mod = divmod(n, 1000)
if mod == 0:
print(0)
else:
print(1000 - mod)
| [["-", 0, 652, 3, 4, 0, 657, 31, 657, 31, 22], ["-", 0, 652, 3, 4, 0, 657, 31, 657, 17, 48]] | 5 | 37 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
int t, n;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
t = 1;
// cin>>t;
while (t--) {
cin >> n;
cout << (int)((ceil(n / 1000.0) - n / 1000.0) * 1000);
}
}
| #include <bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
int t, n;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
t = 1;
// cin>>t;
while (t--) {
cin >> n;
cout << ((ceil(n / 1000.0) - n / 1000.0) * 1000);
}
}
| [["-", 0, 1, 0, 16, 12, 74, 39, 77, 39, 40], ["-", 8, 9, 0, 1, 0, 16, 12, 74, 0, 25], ["-", 12, 74, 51, 23, 0, 16, 31, 23, 0, 24]] | 1 | 82 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
N = (N / 1000 + 1) * 1000 - N;
cout << N << endl;
return 0;
} | // a
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
N = ceil(N / 1000.0) * 1000 - N;
cout << N << endl;
return 0;
} | [["+", 0, 11, 12, 16, 31, 16, 31, 2, 63, 22], ["-", 31, 16, 31, 23, 0, 16, 31, 16, 12, 13], ["-", 12, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["-", 12, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["+", 31, 16, 31, 2, 3, 4, 0, 16, 12, 13]] | 1 | 42 |
#include <bits/stdc++.h>
#define lowbit(x) ((x) & (-(x)))
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
const int INF = 0x3f3f3f3f;
const LL LINF = 0x3f3f3f3f3f3f3f3f;
const int MOD = 1e9 + 7;
const int maxn = 1e5 + 10;
int N;
int main() {
scanf("%d", &N);
printf("%d", 1000 - N % 1000);
r... | #include <bits/stdc++.h>
#define lowbit(x) ((x) & (-(x)))
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
const int INF = 0x3f3f3f3f;
const LL LINF = 0x3f3f3f3f3f3f3f3f;
const int MOD = 1e9 + 7;
const int maxn = 1e5 + 10;
int N;
int main() {
scanf("%d", &N);
printf("%d", (1000 - N % 1000) % 1... | [["+", 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 | 89 |
#include <bits/stdc++.h>
#define Int int64_t
using namespace std;
int main() {
int N;
cin >> N;
cout << N % 1000 << endl;
return 0;
}
| #include <bits/stdc++.h>
#define Int int64_t
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 | 33 |
import sys
import numpy as np
N = int(input())
print(1000 - (N%1000))
| import sys
import numpy as np
N = int(input())
print((1000 - (N%1000))%1000)
| [["+", 0, 652, 3, 4, 0, 657, 31, 23, 0, 24], ["+", 0, 657, 31, 23, 0, 657, 12, 23, 0, 25], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612]] | 5 | 24 |
#include <stdio.h>
int main() {
int N;
// int count=0;
scanf("%d", &N);
while (N >= 1000) {
N -= 1000;
}
printf("%d", N);
} | #include <stdio.h>
int main() {
int N;
// int count=0;
scanf("%d", &N);
while (N > 0)
N -= 1000;
printf("%d", -N);
} | [["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 20], ["-", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 52, 8, 9, 0, 45], ["-", 0, 14, 8, 9, 0, 52, 8, 9, 0, 46], ["+", 0, 1, 0, 2, 3, 4, 0, 91, 17, 33]] | 1 | 43 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
if (n / 1000 == 0) {
cout << 0 << endl;
} else {
cout << (n / 1000 + 1) * 1000 - n << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
if (n % 1000 == 0) {
cout << 0 << endl;
} else {
cout << (n / 1000 + 1) * 1000 - n << endl;
}
}
| [["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 85], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 109]] | 1 | 54 |
n = int(input())
x = (n//1000 + 1) * 1000 - n
print(x) | n = int(input())
x = (n//1000 + 1) * 1000 - n
print(x % 1000) | [["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612]] | 5 | 25 |
#include <iostream>
#define ll long long int
using namespace std;
int main() {
ll n;
cin >> n;
ll a = n % 1000;
if (a > 500) {
a = 1000 - a;
}
cout << a;
}
| #include <iostream>
#define ll long long int
using namespace std;
int main() {
ll n;
cin >> n;
ll a = n % 1000;
if (a != 0) {
a = 1000 - a;
}
cout << a;
} | [["-", 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 | 47 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
if (n % 1000 == 0) {
cout << n % 1000 << endl;
} else {
int rem = n % 1000;
cout << n % rem << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
if (n % 1000 == 0) {
cout << n % 1000 << endl;
} else {
int rem = n % 1000;
cout << 1000 - rem << endl;
}
}
| [["-", 0, 1, 0, 16, 31, 16, 12, 16, 31, 22], ["-", 0, 1, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 31, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 33]] | 1 | 55 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
ll MOD = 1000000007;
int main() {
int N;
int ans = N % 1000;
if (ans == 0) {
ans = 1000;
}
cout << 1000 - ans << endl;
} | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
ll MOD = 1000000007;
int main() {
int N;
cin >> N;
int ans = N % 1000;
if (ans == 0) {
ans = 1000;
}
cout << 1000 - ans << endl;
} | [["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]] | 1 | 60 |
function main(input) { console.log(Math.ceil(input / 1000) - input); }
main(require('fs').readFileSync('/dev/stdin', 'utf8')); | function main(input) { console.log(Math.ceil(input / 1000) * 1000 - input); }
main(require('fs').readFileSync('/dev/stdin', 'utf8')); | [["+", 0, 2, 3, 3, 0, 16, 31, 16, 17, 48], ["+", 0, 2, 3, 3, 0, 16, 31, 16, 12, 555]] | 2 | 44 |
n = int(input())
if n%1000:
print(0)
else:
oturi = (int(n/1000)+1)*1000-n
print(oturi) | n = int(input())
if n%1000 == 0:
print(0)
else:
oturi = (int(n/1000)+1)*1000-n
print(oturi)
| [["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612]] | 5 | 39 |
n = int(input())
maisu = math.floor( (n+1000-1)/1000 )
val = maisu*1000 - n
print(val) | import math
n = int(input())
maisu = math.floor( (n+1000-1)/1000 )
val = maisu*1000 - n
print(val) | [["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22]] | 5 | 35 |
#include <iostream>
using namespace std;
int main() {
int N, k;
cin >> N;
if (N % 1000 == 0) {
cout << 0 << endl;
} else {
cout << (N % 1000) << endl;
}
return 0;
}
| #include <iostream>
using namespace std;
int main() {
int N, k;
cin >> N;
if (N % 1000 == 0) {
cout << 0 << endl;
} else {
cout << (1000 - (N % 1000)) << endl;
}
return 0;
} | [["+", 0, 16, 31, 16, 12, 23, 0, 16, 31, 13], ["+", 0, 16, 31, 16, 12, 23, 0, 16, 17, 33], ["+", 31, 16, 12, 23, 0, 16, 12, 23, 0, 24], ["+", 31, 16, 12, 23, 0, 16, 12, 23, 0, 25]] | 1 | 53 |
#include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define pb push_back
set<int> se;
int main() {
int a;
cin >> a;
if (a % 1000 == 0) {
cout << 0 << endl;
} else if (a < 1000) {
cout << 1000 - a << endl;
} else {
cout << 1000 - (1000 % a) << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define pb push_back
set<int> se;
int main() {
int a;
cin >> a;
if (a % 1000 == 0) {
cout << 0 << endl;
} else if (a < 1000) {
cout << 1000 - a << endl;
} else {
cout << 1000 - (a % 1000) << endl;
}
}
| [["-", 31, 16, 12, 16, 12, 23, 0, 16, 31, 13], ["-", 31, 16, 12, 16, 12, 23, 0, 16, 17, 109], ["+", 31, 16, 12, 16, 12, 23, 0, 16, 17, 109], ["+", 31, 16, 12, 16, 12, 23, 0, 16, 12, 13]] | 1 | 82 |
n = int(input())
a = n // 1000
rem = n - 1000 * a
if rem == 0:
print(0)
else:
print(rem)
| n = int(input())
a = n // 1000
rem = n - 1000 * a
if rem == 0:
print(0)
else:
print(1000 - rem)
| [["+", 0, 1, 0, 652, 3, 4, 0, 657, 31, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 33]] | 5 | 35 |
N=int(input(""))
A = N % 1000
if A > 1:
B=1000-A
print(B)
else:
print(A)
| N=int(input(""))
A = N % 1000
if A > 0:
B=1000-A
print(B)
else:
print(A) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612]] | 5 | 35 |
N = input()
final = 1000 - N%1000
if final == 1000:
print(0)
else:
print(final) | N = int(input())
final = 1000 - N%1000
if final == 1000:
print(0)
else:
print(final) | [["+", 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 | 27 |
N = int(input())
n=N%1000
if n<=500:
print(n)
else:
print(1000-n) | N = int(input())
n=N%1000
if n==0:
print(0)
else:
print(1000-n) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]] | 5 | 30 |
package main
import (
"bufio"
"fmt"
"os"
"sort"
"strconv"
)
var sc = bufio.NewScanner(os.Stdin)
func main() {
var N int
fmt.Scan(&N)
// sc.Split(bufio.ScanWords)
ans := N % 1000
if N != 0 {
fmt.Print(1000 - ans)
} else {
fmt.Print(ans)
}
}
func nextLine() string {
sc.Scan()
return sc.Text()
}
func... | package main
import (
"bufio"
"fmt"
"os"
"sort"
"strconv"
)
var sc = bufio.NewScanner(os.Stdin)
func main() {
var N int
fmt.Scan(&N)
// sc.Split(bufio.ScanWords)
ans := N % 1000
if ans != 0 {
fmt.Print(1000 - ans)
} else {
fmt.Print(ans)
}
}
func nextLine() string {
sc.Scan()
return sc.Text()
}
fu... | [["-", 0, 435, 8, 196, 0, 57, 15, 16, 31, 22], ["+", 0, 435, 8, 196, 0, 57, 15, 16, 31, 22]] | 7 | 656 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
cout << (n % 1000 ? 0 : 1000 - n % 1000);
#ifndef ONLINE_JUDGE
system("pause");
#endif
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
cout << (n % 1000 ? 1000 - n % 1000 : 0);
#ifndef ONLINE_JUDGE
system("pause");
#endif
return 0;
} | [["-", 0, 1, 0, 16, 12, 23, 0, 41, 64, 13], ["-", 0, 1, 0, 16, 12, 23, 0, 41, 0, 102], ["+", 0, 1, 0, 16, 12, 23, 0, 41, 0, 102], ["+", 0, 1, 0, 16, 12, 23, 0, 41, 75, 13]] | 1 | 48 |
#x, y = map(int, input().split())
n = int(input())
a = 0
while(a < n):
a += 1000
print(a)
| #x, y = map(int, input().split())
n = int(input())
a = 0
while(a < n):
a += 1000
print(a-n)
| [["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 33], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 22]] | 5 | 26 |
N=int(input())
if (N%1000==0):
print (0)
else:
((((N//1000)+1)*1000)-N) | N=int(input())
if (N%1000==0):
print (0)
else:
print ((((N//1000)+1)*1000)-N) | [["+", 75, 76, 8, 196, 0, 1, 0, 652, 63, 22]] | 5 | 40 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
using pii = pair<int, int... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
using pii = pair<int, int... | [["-", 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 | 134 |
import java.io.*;
import java.lang.*;
import java.util.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Main {
public static void main(String[] args) throws java.lang.Exception {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
System.out.println(1000 - t % ... | import java.io.*;
import java.lang.*;
import java.util.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Main {
public static void main(String[] args) throws java.lang.Exception {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
System.out.println((1000 - t %... | [["+", 0, 492, 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, 499], ["+", 0, 492, 3, 4, 0, 16, 31, 23, 0, 25]] | 3 | 78 |
#include <stdio.h>
int main() {
int i, bill, N, change;
scanf("%d", &N);
bill = N / 1000;
if (N == 10000) {
printf("0\n");
} else {
change = (1000 * (bill + 1)) - N;
printf("%d\n", change);
}
return 0;
} | #include <stdio.h>
int main() {
int i, bill, N, change;
scanf("%d", &N);
bill = N / 1000;
if (N == 1000 * bill) {
printf("0\n");
} else {
change = (1000 * (bill + 1)) - N;
printf("%d\n", change);
}
return 0;
} | [["-", 8, 9, 0, 57, 15, 23, 0, 16, 12, 13], ["+", 0, 57, 15, 23, 0, 16, 12, 16, 31, 13], ["+", 0, 57, 15, 23, 0, 16, 12, 16, 17, 48], ["+", 0, 57, 15, 23, 0, 16, 12, 16, 12, 22]] | 0 | 79 |
#include <bits/stdc++.h>
// #include <iostream> // cout, endl, cin
// #include <string> // string, to_string, stoi
// #include <vector> // vector
// #include <algorithm> // min, max, swap, sort, reverse, lower_bound,
// upper_bound #include <utility> // pair, make_pair #include <tuple> // tuple,
// make_tuple #include... | #include <bits/stdc++.h>
// #include <iostream> // cout, endl, cin
// #include <string> // string, to_string, stoi
// #include <vector> // vector
// #include <algorithm> // min, max, swap, sort, reverse, lower_bound,
// upper_bound #include <utility> // pair, make_pair #include <tuple> // tuple,
// make_tuple #include... | [["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 25, 0, 35]] | 1 | 1,334 |
a=int(input())
n=a//1000 if a/1000 == 0 else a//1000-1
print((n*1000)+1000-a) | a=int(input())
n=a//1000 if a%1000 != 0 else a//1000-1
print((n*1000)+1000-a) | [["-", 0, 662, 12, 41, 0, 666, 0, 657, 17, 85], ["+", 0, 662, 12, 41, 0, 666, 0, 657, 17, 109], ["-", 0, 1, 0, 662, 12, 41, 0, 666, 667, 60], ["+", 0, 1, 0, 662, 12, 41, 0, 666, 667, 79]] | 5 | 37 |
N = int(input())
ans = []
for i in range(1,10):
if (1000 * i) - N >= 0:
ans.append((1000 * i) - N )
print(min(ans)) | N = int(input())
ans = []
for i in range(0,11):
if (1000 * i) - N >= 0:
ans.append((1000 * i) - N )
print(min(ans)) | [["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612], ["+", 0, 656, 0, 7, 12, 652, 3, 4, 0, 612]] | 5 | 52 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String read = scan.nextLine();
int N = Integer.parseInt(read);
int R = N % 1000;
if (R == 0) {
System.out.println(0);
} else {
System.out.println(R);
... | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String read = scan.nextLine();
int N = Integer.parseInt(read);
int R = N % 1000;
if (R == 0) {
System.out.println(0);
} else {
System.out.println(1000 - R... | [["+", 0, 1, 0, 492, 3, 4, 0, 16, 31, 499], ["+", 0, 1, 0, 492, 3, 4, 0, 16, 17, 33]] | 3 | 90 |
#include <bits/stdc++.h>
using namespace std;
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
typedef long long ll;
#define FIN \
ios::sync_with_stdio(0); \
cin.tie(0);... | #include <bits/stdc++.h>
using namespace std;
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
typedef long long ll;
#define FIN \
ios::sync_with_stdio(0); \
cin.tie(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 | 103 |
N = int(input())
print((N // 1000 + 1) * 1000 - N) | N = int(input())
print(((N - 1) // 1000 + 1) * 1000 - N) | [["+", 31, 23, 0, 657, 31, 657, 31, 23, 0, 24], ["+", 0, 657, 31, 657, 31, 23, 0, 657, 17, 33], ["+", 0, 657, 31, 657, 31, 23, 0, 657, 12, 612], ["+", 31, 23, 0, 657, 31, 657, 31, 23, 0, 25]] | 5 | 22 |
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
if (n % 1000 == 0)
cout << n;
else {
cout << 1000 - n % 1000;
}
} | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
if (n % 1000 == 0)
cout << 0;
else {
cout << 1000 - n % 1000;
}
} | [["-", 8, 9, 0, 57, 64, 1, 0, 16, 12, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 16, 12, 13]] | 1 | 42 |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int ans = n % 1000;
System.out.println(ans);
}
}
| import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int ans = (10000 - n) % 1000;
System.out.println(ans);
}
}
| [["+", 0, 503, 49, 200, 51, 16, 31, 23, 0, 24], ["+", 49, 200, 51, 16, 31, 23, 0, 16, 31, 499], ["+", 49, 200, 51, 16, 31, 23, 0, 16, 17, 33], ["+", 0, 503, 49, 200, 51, 16, 31, 23, 0, 25]] | 3 | 60 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define rrep(i, n) for (int(i) = ((n)-1); (i) >= 0; (i)--)
#define itn int
#define miele(v) min_element(v.begin(), v.end())
#define maele(v) max_element(v.begin(), v.end())
#define SUM(v) accumulate(... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
#define rrep(i, n) for (int(i) = ((n)-1); (i) >= 0; (i)--)
#define itn int
#define miele(v) min_element(v.begin(), v.end())
#define maele(v) max_element(v.begin(), v.end())
#define SUM(v) accumulate(... | [["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 24], ["+", 3, 4, 0, 16, 31, 23, 0, 16, 31, 13], ["+", 3, 4, 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], ["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 25]] | 1 | 989 |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define eb emplace_back
void fastio() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
void solve() {
int n;
cin >> n;
n %= 1... | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define eb emplace_back
void fastio() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
}
void solve() {
int n;
cin >> n;
n %= 1... | [["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 25], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 12, 13]] | 1 | 107 |
#include <bits/stdc++.h>
using namespace std;
#define _rep(n, a, b) for (int n = (a); n <= (b); ++n)
#define _rev(n, a, b) for (int n = (a); n >= (b); --n)
#define _for(n, a, b) for (int n = (a); n < (b); ++n)
#define _rof(n, a, b) for (int n = (a); n > (b); --n)
#define oo 0x3f3f3f3f3f3f
#define ll long long
#define ... | #include <bits/stdc++.h>
using namespace std;
#define _rep(n, a, b) for (int n = (a); n <= (b); ++n)
#define _rev(n, a, b) for (int n = (a); n >= (b); --n)
#define _for(n, a, b) for (int n = (a); n < (b); ++n)
#define _rof(n, a, b) for (int n = (a); n > (b); --n)
#define oo 0x3f3f3f3f3f3f
#define ll long long
#define ... | [["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]] | 1 | 163 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int S = 0;
S = N / 1000;
if (S % 1000 == 0) {
cout << 0;
} else {
cout << (S + 1) * 1000 - N;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int S = 0;
S = N / 1000;
if (N % 1000 == 0) {
cout << 0;
} else {
cout << (S + 1) * 1000 - N;
}
} | [["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22]] | 1 | 59 |
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
int i, j, k, n, t;
cin >> n;
if (n % 1000)
cout << n - n % 1000 << endl;
else
cout << "0\n";
return 0;
}
| #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
int i, j, k, n, t;
cin >> n;
if (n % 1000)
cout << 1000 - n % 1000 << endl;
else
cout << "0\n";
return 0;
}
| [["-", 64, 1, 0, 16, 31, 16, 12, 16, 31, 22], ["+", 64, 1, 0, 16, 31, 16, 12, 16, 31, 13]] | 1 | 60 |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<ll>;
using vvi = vector<vector<ll>>;
using st = set<ll>;
using kiwi = queue<ll>;
using mp = map<ll, ll>;
using ump = unordered_map<ll, ll>;
#define MOD 1000000007
const ll mx = 1e5 + 123;
#define REP(i, n) for ... | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<ll>;
using vvi = vector<vector<ll>>;
using st = set<ll>;
using kiwi = queue<ll>;
using mp = map<ll, ll>;
using ump = unordered_map<ll, ll>;
#define MOD 1000000007
const ll mx = 1e5 + 123;
#define REP(i, n) for ... | [["+", 64, 1, 0, 16, 31, 16, 12, 16, 31, 13], ["+", 64, 1, 0, 16, 31, 16, 12, 16, 17, 33]] | 1 | 168 |
a=input(int())
b=a % 1000
if b>>0:
print(1000-b)
else:
print(0) | a=int(input())
b=a % 1000
if b>>0:
print(1000-b)
else:
print(0)
| [["-", 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, 24], ["+", 0, 662, 12, 652, 3, 4, 0, 652, 63, 22]] | 5 | 30 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int a;
cin >> a;
int b = a % 1000;
if (b == 0)
cout << 0 << endl;
else
cout << b << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int a;
cin >> a;
int b = a % 1000;
if (b == 0)
cout << 0 << endl;
else
cout << 1000 - b << endl;
return 0;
} | [["+", 0, 1, 0, 16, 31, 16, 12, 16, 31, 13], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 33]] | 1 | 48 |
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#pragma GCC optimize(2)
#define int long long
#define MAXN 2000000
#define INF (1e13 + 7)
#define MANX MAXN
using namespace std;
inline int read() {
int x = 0, f = 1;
char c = getchar();
while (c > '9' || c < '0') {
... | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#pragma GCC optimize(2)
#define int long long
#define MAXN 2000000
#define INF (1e13 + 7)
#define MANX MAXN
using namespace std;
inline int read() {
int x = 0, f = 1;
char c = getchar();
while (c > '9' || c < '0') {
... | [["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 16, 12, 16, 31, 23, 0, 16, 31, 13], ["+", 0, 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, 1, 0, 16, 12, 16, 31, 23, 0, 25]] | 1 | 146 |
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
n = n % 1000;
n = 1000 - n;
if (n == 1000)
cout << 0 << endl;
cout << n << endl;
}
| #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
n = n % 1000;
n = 1000 - n;
if (n == 1000)
cout << 0 << endl;
else
cout << n << endl;
}
| [["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95]] | 1 | 49 |
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int N;
cin >> N;
int mo = 0;
while (mo <= N) {
mo += 1000;
}
cout << mo - N << endl;
} | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
int N;
cin >> N;
int mo = 0;
while (mo < N) {
mo += 1000;
}
cout << mo - N << endl;
} | [["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 19], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 18]] | 1 | 52 |
#include <stdio.h>
int main() {
int n;
scanf("%d", &n);
int i = 0;
while (i * 1000 <= n)
i++;
printf("%d\n", 1000 * i - n);
return 0;
} | #include <stdio.h>
int main() {
int n;
scanf("%d", &n);
int i = 0;
while (i * 1000 < n)
i++;
printf("%d\n", 1000 * i - n);
return 0;
} | [["-", 8, 9, 0, 52, 15, 23, 0, 16, 17, 19], ["+", 8, 9, 0, 52, 15, 23, 0, 16, 17, 18]] | 0 | 54 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
n = n % 1000;
if (n) {
cout << n;
} else {
cout << 1000 - n;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
n = n % 1000;
if (n == 0) {
cout << n;
} else {
cout << 1000 - n;
}
} | [["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]] | 1 | 44 |
import math
import collections
import fractions
import itertools
import functools
import operator
def solve():
n = int(input())
print((n//1000)*1000 - n)
return 0
if __name__ == "__main__":
solve()
| import math
import collections
import fractions
import itertools
import functools
import operator
def solve():
n = int(input())
print(math.ceil(n/1000)*1000 - n)
return 0
if __name__ == "__main__":
solve()
| [["+", 0, 657, 31, 657, 31, 652, 63, 319, 500, 22], ["+", 0, 657, 31, 657, 31, 652, 63, 319, 0, 131], ["+", 0, 657, 31, 657, 31, 652, 63, 319, 319, 22], ["-", 0, 657, 31, 657, 31, 23, 0, 657, 17, 676], ["+", 31, 657, 31, 652, 3, 4, 0, 657, 17, 85]] | 5 | 49 |
n = int(input())
m = n % 1000
if m < 501:
print(m)
else:
print(1000-m) | n = int(input())
m = n % 1000
if m==0:
print(0)
else:
print(1000-m) | [["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612]] | 5 | 30 |
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int ans = n % 1000;
if (ans > 500) {
ans = 1000 - ans;
}
System.out.println(ans);
}
} | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int n = scn.nextInt();
int ans = n % 1000;
if (ans != 0) {
ans = 1000 - ans;
}
System.out.println(ans);
}
} | [["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 47], ["-", 8, 196, 0, 57, 15, 15, 0, 16, 12, 499], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 79], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 12, 499]] | 3 | 74 |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int, int>
#define pli pair<ll, int>
#define pil pair<int, ll>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>
#define vd vector<double>
#define vs vector<string>
#define ff first
#define s... | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pii pair<int, int>
#define pli pair<ll, int>
#define pil pair<int, ll>
#define pll pair<ll, ll>
#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>
#define vd vector<double>
#define vs vector<string>
#define ff first
#define s... | [["-", 0, 57, 15, 339, 51, 16, 31, 91, 17, 111], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]] | 1 | 336 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
int a = N % 1000;
if (a == 0) {
cout << a << endl;
} else {
cout << 1000 - a << endl;
}
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int a = N % 1000;
if (a == 0) {
cout << a << endl;
} else {
cout << 1000 - a << endl;
}
} | [["+", 0, 14, 8, 9, 0, 1, 0, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]] | 1 | 47 |
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
var rdr = bufio.NewReaderSize(os.Stdin, 1000000)
func readLine() (ret string) {
buf := make([]byte, 0, 1000000)
for {
l, p, e := rdr.ReadLine()
if e != nil {
return ""
}
buf = append(buf, l...)
if !p {
break
}
}
return string(... | package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
var rdr = bufio.NewReaderSize(os.Stdin, 1000000)
func readLine() (ret string) {
buf := make([]byte, 0, 1000000)
for {
l, p, e := rdr.ReadLine()
if e != nil {
return ""
}
buf = append(buf, l...)
if !p {
break
}
}
return string(... | [["-", 36, 36, 0, 434, 0, 435, 8, 196, 0, 165], ["+", 36, 36, 0, 434, 0, 435, 8, 196, 0, 165], ["+", 8, 196, 0, 1, 0, 2, 3, 4, 0, 24], ["+", 0, 16, 31, 23, 0, 16, 12, 23, 0, 25], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 109], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 433]] | 7 | 386 |
N = int(input())
count = 0
money = 1000
while N >= money * count:
count += 1
print(money * count - N)
| N = int(input())
count = 0
money = 1000
while N > money * count:
count += 1
print(money * count - N)
| [["-", 36, 36, 0, 656, 0, 52, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 52, 15, 666, 667, 47]] | 5 | 32 |
#include <bits/stdc++.h>
#define ll long long
#define int long long
#define ld long double
const ll MOD = 998244353;
const ll INF = 1e18;
using namespace std;
int32_t main() {
#ifndef XOX
freopen("Input.txt", "r", stdin);
freopen("Output.txt", "w", stdout);
#endif
ios::sync_with_stdio(!cin.tie(NULL));
int n;... | #include <bits/stdc++.h>
#define ll long long
#define int long long
#define ld long double
const ll MOD = 998244353;
const ll INF = 1e18;
using namespace std;
int32_t main() {
#ifdef XOX
freopen("Input.txt", "r", stdin);
freopen("Output.txt", "w", stdout);
#endif
ios::sync_with_stdio(!cin.tie(NULL));
int n;
... | [["-", 0, 30, 0, 14, 8, 9, 0, 171, 0, 184], ["+", 0, 30, 0, 14, 8, 9, 0, 171, 0, 172]] | 1 | 109 |
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
using namespace std;
int main() {
// 文字列の入力
int N;
cin >> N;
int b = (N / 1000 + 1) * 1000 - N;
printf("%d\n", b);
return 0;
} |
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
using namespace std;
int main() {
// 文字列の入力
int N;
cin >> N;
int b = ((N / 1000 + 1) * 1000 - N) % 1000;
printf("%d\n", b);
return 0;
} | [["+", 31, 23, 0, 16, 31, 16, 31, 23, 0, 24], ["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 25], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 109], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]] | 1 | 56 |
#include <bits/stdc++.h>
typedef long long ll;
#define ALL(l) (l).begin(), (l).end()
#define rep(i, n) for (ll(i) = 0; (i) < (n); (i)++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
// const ll mod = 1000000007;
// const ll maxn = 1000000000;
//-------------------------------------... | #include <bits/stdc++.h>
typedef long long ll;
#define ALL(l) (l).begin(), (l).end()
#define rep(i, n) for (ll(i) = 0; (i) < (n); (i)++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
// const ll mod = 1000000007;
// const ll maxn = 1000000000;
//-------------------------------------... | [["-", 0, 57, 64, 1, 0, 16, 31, 16, 12, 13], ["+", 0, 57, 64, 1, 0, 16, 31, 16, 12, 13]] | 1 | 128 |
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int amount = n % 1000;
int ans = 1000 - amount;
cout << ans;
return 0;
} | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int amount = n % 1000;
int ans = (1000 - amount) % 1000;
cout << ans;
return 0;
} | [["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 24], ["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 25], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 17, 109], ["+", 8, 9, 0, 43, 49, 50, 51, 16, 12, 13]] | 1 | 40 |
N = int(input())
for i in range(11):
if 1000 * i >= N:
ans = i - N
break
print(ans)
| N = int(input())
for i in range(11):
if 1000 * i >= N:
ans = 1000 * i - N
break
print(ans)
| [["+", 0, 1, 0, 662, 12, 657, 31, 657, 31, 612], ["+", 0, 1, 0, 662, 12, 657, 31, 657, 17, 48]] | 5 | 33 |
N = int(input())
if N // 1000 != 0:
pay = (N // 1000 + 1)*1000
answer = pay - N
print(int(answer))
else:
print(0) | N = int(input())
if N % 1000 != 0:
pay = (N // 1000 + 1)*1000
answer = pay - N
print(int(answer))
else:
print(0) | [["-", 0, 656, 0, 57, 15, 666, 0, 657, 17, 676], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 17, 109]] | 5 | 44 |
def resolve():
n = int(input())
while n>0:
n = n - 1000
print(abs(n))
resolvea() | def resolve():
n = int(input())
while n>0:
n = n - 1000
print(abs(n))
resolve() | [["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22]] | 5 | 33 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int x;
cin >> x;
int n;
n == x % 1000;
if (n == 0) {
cout << 0 << endl;
} else {
cout << 1000 - n << endl;
}
}
| #include <bits/stdc++.h>
using namespace std;
int main() {
int x;
cin >> x;
int n;
n = x % 1000;
if (n == 0) {
cout << 0 << endl;
} else {
cout << 1000 - n << endl;
}
}
| [["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 60], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32]] | 1 | 53 |
n = int(input())
# n=3000
if n%1000 == 0:
print(n//1000)
else:
print((n//1000 + 1)*1000 - n) | n = int(input())
# n=3000
if n%1000 == 0:
print("0")
else:
print((n//1000 + 1)*1000 - n) | [["-", 0, 1, 0, 652, 3, 4, 0, 657, 31, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 17, 676], ["-", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 654], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 655]] | 5 | 38 |
import java.io.*;
import java.util.*;
class Main {
static final long MOD = 1_000_000_007; // 10^9+7
static final int MAX = 2_147_483_646; // intMax
static final int INF = 1_000_000_000; // 10^9
public static void main(String[] args) throws Exception {
hayami saori = new hayami();
int n = saori.saori_h... | import java.io.*;
import java.util.*;
class Main {
static final long MOD = 1_000_000_007; // 10^9+7
static final int MAX = 2_147_483_646; // intMax
static final int INF = 1_000_000_000; // 10^9
public static void main(String[] args) throws Exception {
hayami saori = new hayami();
int n = saori.saori_h... | [["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 18], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 17, 19]] | 3 | 589 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int i = 0;
while (i >= N) {
i += 1000;
}
cout << i - N << endl;
return 0;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
int i = 0;
while (i < N) {
i += 1000;
}
cout << i - N << endl;
return 0;
} | [["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 18]] | 1 | 47 |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define FOR(i, a, b) for (int i = (int)a; i <= (int)b; i++)
#define DEC(i, a, b) for (int i = (int)a; i >= (int)b; i--)
typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef pair<pi, pi> pipi;
#define f first
#define s s... | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define FOR(i, a, b) for (int i = (int)a; i <= (int)b; i++)
#define DEC(i, a, b) for (int i = (int)a; i >= (int)b; i--)
typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef pair<pi, pi> pipi;
#define f first
#define s s... | [["+", 12, 16, 31, 16, 31, 16, 31, 23, 0, 25], ["-", 0, 16, 12, 16, 31, 16, 31, 23, 0, 25]] | 1 | 200 |
N = int(input())
otsuri = N % 1000
print(otsuri)
if not otsuri == 0:
otsuri = 1000 - otsuri
print(otsuri)
| N = int(input())
otsuri = N % 1000
if not otsuri == 0:
otsuri = 1000 - otsuri
print(otsuri)
| [["-", 36, 36, 0, 656, 0, 1, 0, 652, 63, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 0, 656, 0, 1, 0, 652, 3, 4, 0, 25]] | 5 | 32 |
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
if (n % 1000 == 0)
cout << n;
else {
int s = int(n / 1000) + 1;
cout << (s * 1000) - n;
}
} | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
if (n % 1000 == 0)
cout << 0;
else {
int s = int(n / 1000) + 1;
cout << (s * 1000) - n;
}
return 0;
} | [["-", 8, 9, 0, 57, 64, 1, 0, 16, 12, 22], ["+", 8, 9, 0, 57, 64, 1, 0, 16, 12, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 38], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 37, 0, 35]] | 1 | 56 |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
n %= 1000;
n = 1000 - n;
cout << n << endl;
} | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
n %= 1000;
if (n)
n = 1000 - n;
cout << n << endl;
} | [["+", 0, 30, 0, 14, 8, 9, 0, 57, 0, 121], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 24], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 51, 22], ["+", 0, 14, 8, 9, 0, 57, 15, 339, 0, 25]] | 1 | 35 |
N = int(input())
if N%1000==0:
print(0)
elif N<1000:
print(N)
else:
print(1000-N%1000) | N = int(input())
if N%1000==0:
print(0)
elif N<1000:
print(1000-N)
else:
print(1000-N%1000) | [["+", 0, 1, 0, 652, 3, 4, 0, 657, 31, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 33]] | 5 | 38 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.