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> using namespace std; signed main() { int n; cin >> n; cout << (n - n % 1000) % 1000 << endl; }
#include <bits/stdc++.h> using namespace std; signed main() { int n; cin >> n; cout << (1000 - n % 1000) % 1000 << endl; }
[["-", 31, 16, 12, 16, 31, 23, 0, 16, 31, 22], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 31, 13]]
1
33
#include <bits/stdc++.h> using namespace std; void __start__() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #ifdef MY freopen("/home/ainur/CLionProjects/wow/input.txt", "r", stdin); freopen("/home/ainur/CLionProjects/wow/output.txt", "w", stdout); #else #define endl '\n' // freopen("search.in", "r"...
#include <bits/stdc++.h> using namespace std; void __start__() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); #ifdef MY freopen("/home/ainur/CLionProjects/wow/input.txt", "r", stdin); freopen("/home/ainur/CLionProjects/wow/output.txt", "w", stdout); #else #define endl '\n' // freopen("search.in", "r"...
[["+", 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
257
#include <algorithm> #include <bits/stdc++.h> #include <string> using namespace std; // std::の省略のため using ll = long long; ll MOD = 1000000007; int main() { ll n; cin >> n; ll ans; if (n % 1000 == 0) ans = 1000 - n % 1000; else ans = 0; cout << ans << endl; }
#include <algorithm> #include <bits/stdc++.h> #include <string> using namespace std; // std::の省略のため using ll = long long; ll MOD = 1000000007; int main() { ll n; cin >> n; ll ans; if (n % 1000 != 0) ans = 1000 - n % 1000; else ans = 0; cout << ans << endl; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79]]
1
65
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); sc.close(); // int result = ((((N / 1000) + 1) * 1000) - N); int result = 1000 - (N % 1000); System.out.println(result); } }
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); sc.close(); int result = (1000 - (N % 1000)) % 1000; System.out.println(result); } }
[["+", 0, 503, 49, 200, 51, 16, 31, 23, 0, 24], ["+", 51, 16, 31, 23, 0, 16, 12, 23, 0, 25], ["+", 8, 196, 0, 503, 49, 200, 51, 16, 17, 109], ["+", 8, 196, 0, 503, 49, 200, 51, 16, 12, 499]]
3
71
#include <iostream> using namespace std; int main() { int n; cin >> n; printf("%d\n", 1000 - n % 1000); }
#include <iostream> using namespace std; int main() { int n; cin >> n; printf("%d\n", (1000 - n % 1000) % 1000); }
[["+", 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
33
n = int(input) print((1000 - (n % 1000)) % 1000)
n = int(input()) print((1000 - (n % 1000)) % 1000)
[["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
20
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define all(v) begin(v), end(v) using ll = long long; int main() { int n; cin >> n; if (n % 1000 == 0) cout << n << endl; else cout << 1000 - n % 1000 << endl; }
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define all(v) begin(v), end(v) using ll = long long; int main() { int n; cin >> n; if (n % 1000 == 0) cout << 0 << endl; else cout << 1000 - n % 1000 << endl; }
[["-", 0, 57, 64, 1, 0, 16, 31, 16, 12, 22], ["+", 0, 57, 64, 1, 0, 16, 31, 16, 12, 13]]
1
64
#include <bits/stdc++.h> #include <math.h> using namespace std; int main() { int N; cin >> N; N = 10000 - N; while (true) { if (N > 1000) N -= 1000; else break; } cout << N; }
#include <bits/stdc++.h> #include <math.h> using namespace std; int main() { int N; cin >> N; N = 10000 - N; while (true) { if (N >= 1000) N -= 1000; else break; } cout << N; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
50
#include <bits/stdc++.h> using namespace std; #define ll long long; mt19937 mrand(random_device{}()); int rnd(int x) { return mrand() % x; } struct fast_ios { fast_ios() { ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(10); }; } fast_ios_; int main() { int N; cin >> N; c...
#include <bits/stdc++.h> using namespace std; #define ll long long; mt19937 mrand(random_device{}()); int rnd(int x) { return mrand() % x; } struct fast_ios { fast_ios() { ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(10); }; } fast_ios_; int main() { int N; cin >> N; c...
[["+", 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
94
#include <bits/stdc++.h> #include <unordered_map> #include <unordered_set> #define initdp(a, b) \ for (int i = 0; i <= a; i++) \ for (int j = 0; j <= b; j++) \ ...
#include <bits/stdc++.h> #include <unordered_map> #include <unordered_set> #define initdp(a, b) \ for (int i = 0; i <= a; i++) \ for (int j = 0; j <= b; j++) \ ...
[["-", 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
206
N = int(input()) if N % 1000 == 0: print(0) else: div = N / 1000 exc = (div +1)*1000 - N print(exc)
N = int(input()) if N % 1000 == 0: print(0) else: div = int(N / 1000) exc = (div +1)*1000 - N print(exc)
[["+", 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
41
//デバッグ用オプション:-fsanitize=undefined,address //コンパイラ最適化 #pragma GCC optimize("Ofast") //インクルードなど #include <iostream> using namespace std; typedef long long ll; //マクロ // forループ //引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる // FORAは範囲for文(使いにくかったら消す) #define REP...
//デバッグ用オプション:-fsanitize=undefined,address //コンパイラ最適化 #pragma GCC optimize("Ofast") //インクルードなど #include <iostream> using namespace std; typedef long long ll; //マクロ // forループ //引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか // Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる // FORAは範囲for文(使いにくかったら消す) #define REP...
[["+", 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], ["+", 0, 16, 31, 16, 12, 16, 31, 23, 0, 25]]
1
144
N = int(input()) N = N%1000 if N==0: print(N) print(1000-N)
N = int(input()) N = N%1000 if N==0: print(N) else: print(1000-N)
[["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 95], ["+", 36, 36, 0, 656, 0, 57, 75, 76, 0, 102]]
5
28
n = int(input()) b = 0 while b > n: b += 1000 print(b-n)
n = int(input()) b = 0 while b < n: b += 1000 print(b-n)
[["-", 36, 36, 0, 656, 0, 52, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 52, 15, 666, 667, 18]]
5
25
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; cout << (N % 1000) % 1000 << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; cout << (1000 - N % 1000) % 1000 << endl; }
[["+", 31, 16, 12, 16, 31, 23, 0, 16, 31, 13], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 33]]
1
31
#include <bits/stdc++.h> using namespace std; int main() { int n, s = 0; cin >> n; if (n / 1000 == 0) cout << '0'; else { s += n / 1000 + 1; cout << 1000 * s - n; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, s = 0; cin >> n; if (n % 1000 == 0) cout << '0'; else { s += n / 1000 + 1; cout << 1000 * s - n; } return 0; }
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 85], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 109]]
1
59
#include <bits/stdc++.h> #include <cmath> using namespace std; int main() { int s, i, j, k; cin >> s; if (s % 1000 != 0) s = (s / 1000 + 1) * 1000 - s; else s = s / 1000; cout << s; return 0; }
#include <bits/stdc++.h> #include <cmath> using namespace std; int main() { int s, i, j, k; cin >> s; if (s % 1000 != 0) s = (s / 1000 + 1) * 1000 - s; else s = 0; cout << s; return 0; }
[["-", 75, 76, 0, 1, 0, 11, 12, 16, 31, 22], ["-", 75, 76, 0, 1, 0, 11, 12, 16, 17, 85], ["-", 75, 76, 0, 1, 0, 11, 12, 16, 12, 13], ["+", 0, 57, 75, 76, 0, 1, 0, 11, 12, 13]]
1
63
#include <bits/stdc++.h> using namespace std; typedef long long int ll; ll n; int main() { scanf("%lld", &n); printf("%lld\n", 1000 - (n % 1000)); }
#include <bits/stdc++.h> using namespace std; typedef long long int ll; ll n; int main() { scanf("%lld", &n); printf("%lld\n", (1000 - (n % 1000)) % 1000); }
[["+", 0, 2, 3, 4, 0, 16, 31, 23, 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, 13]]
1
47
#include <iostream> using namespace std; int main() { int n; cin >> n; cout << 1000 - (n % 1000) << "\n"; return (0); }
#include <iostream> using namespace std; 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, 23, 0, 25], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 17, 109], ["+", 0, 1, 0, 16, 31, 16, 12, 16, 12, 13]]
1
38
import java.io.*; import java.util.*; class Main { public static void main(String[] args) throws IOException { setIO(); int N = ni() % 1000; if (N == 1000) N = 0; out.println(1000 - N); f.close(); out.close(); } static BufferedReader f; static PrintWriter out; static StringTo...
import java.io.*; import java.util.*; class Main { public static void main(String[] args) throws IOException { setIO(); int N = ni() % 1000; if (N == 0) N = 1000; out.println(1000 - N); f.close(); out.close(); } static BufferedReader f; static PrintWriter out; static StringTo...
[["-", 8, 196, 0, 57, 15, 15, 0, 16, 12, 499], ["+", 8, 196, 0, 57, 15, 15, 0, 16, 12, 499], ["-", 8, 196, 0, 57, 64, 1, 0, 11, 12, 499], ["+", 8, 196, 0, 57, 64, 1, 0, 11, 12, 499]]
3
344
N = int(input()) print((10000-n)%1000)
N = int(input()) print((10000-N)%1000)
[["-", 3, 4, 0, 657, 31, 23, 0, 657, 12, 22], ["+", 3, 4, 0, 657, 31, 23, 0, 657, 12, 22]]
5
18
/* author : nishi5451 created: 11.08.2020 23:28:18 */ #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; int main() { int n; cin >> n; int ans; if (n % 1000) ans = 0; else ans = (n / 1000 + 1) * 1000 - n; cout << ans << end...
/* author : nishi5451 created: 11.08.2020 23:28:18 */ #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) typedef long long ll; int main() { int n; cin >> n; int ans; if (n % 1000 == 0) ans = 0; else ans = (n / 1000 + 1) * 1000 - n; cout << ans <...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
70
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << (n - n % 1000) % 1000 << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << (1000 - n % 1000) % 1000 << endl; }
[["-", 31, 16, 12, 16, 31, 23, 0, 16, 31, 22], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 31, 13]]
1
33
#include <iostream> using ll = long long; #define rep(i, a, b) for (ll i = a; i < ll(b); i++) #define repr(i, a, b) for (ll i = a; i >= ll(b); i--) #define endl "\n" using namespace std; int N; int main() { cin >> N; N %= 1000; cout << 1000 - N << endl; return 0; }
#include <iostream> using ll = long long; #define rep(i, a, b) for (ll i = a; i < ll(b); i++) #define repr(i, a, b) for (ll i = a; i >= ll(b); i--) #define endl "\n" using namespace std; int N; int main() { cin >> N; N %= 1000; cout << (1000 - N) % 1000 << endl; return 0; }
[["+", 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
63
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define IO ios::sync_with_stdio(false) //#define int long long using nam...
#include <algorithm> #include <bitset> #include <cmath> #include <cstdio> #include <cstring> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> #define IO ios::sync_with_stdio(false) //#define int long long using nam...
[["+", 0, 14, 8, 9, 0, 57, 75, 76, 0, 95]]
1
73
#include <bits/stdc++.h> int main() { int N; scanf("%d", &N); printf("%d\n", 1000 - (N % 1000)); }
#include <bits/stdc++.h> int main() { int N; scanf("%d", &N); printf("%d\n", (1000 - (N % 1000)) % 1000); }
[["+", 0, 2, 3, 4, 0, 16, 31, 23, 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, 13]]
1
37
import sys N = int(input()) ans = 0 if N % 1000 == 0: ans = 0 else: ans = N % 1000 print(ans)
import sys N = int(input()) ans = 0 if N % 1000 == 0: ans = 0 else: ans = 1000 - (N % 1000) print(ans)
[["+", 8, 196, 0, 1, 0, 662, 12, 657, 31, 612], ["+", 8, 196, 0, 1, 0, 662, 12, 657, 17, 33], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 24], ["+", 0, 1, 0, 662, 12, 657, 12, 23, 0, 25]]
5
34
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; typedef long long LL; typedef pair<LL, LL> pLL; int main(void) { LL N, ans; cin >> N; ans = 1000 - (N % 1000); cout << ans << endl; return 0; }
#include <algorithm> #include <iostream> #include <string> #include <vector> using namespace std; typedef long long LL; typedef pair<LL, LL> pLL; int main(void) { LL N, ans; cin >> N; ans = (1000 - (N % 1000)) % 1000; cout << ans << endl; return 0; }
[["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 23, 0, 16, 12, 23, 0, 25], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
61
n=int(input()) print((1000-n%1000))
n=int(input()) print((1000-n%1000)%1000)
[["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612]]
5
18
#include <iostream> using namespace std; int main() { int N; int seged; cin >> N; seged == N % 1000; if (seged == 0) { cout << '0'; } else { cout << 1000 - seged; } return 0; }
#include <iostream> using namespace std; int main() { int N; int seged; cin >> N; seged = N % 1000; if (seged == 0) { cout << '0'; } else { cout << 1000 - seged; } return 0; }
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 60], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32]]
1
54
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt() % 1000; System.out.println(n == 0 ? 1000 : 1000 - n); } }
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt() % 1000; System.out.println(n == 0 ? 0 : 1000 - n); } }
[["-", 0, 1, 0, 492, 3, 4, 0, 510, 64, 499], ["+", 0, 1, 0, 492, 3, 4, 0, 510, 64, 499]]
3
63
#include <iostream> using namespace std; int main() { long long N; cin >> N; cout << 1000 - (N % 1000); return 0; }
#include <iostream> using namespace std; int main() { long long N; cin >> N; cout << (1000 - (N % 1000)) % 1000; return 0; }
[["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 23, 0, 16, 12, 23, 0, 25], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 12, 13]]
1
33
function Main(input) { let total = parseint(input); for (let i = 0; i * 1000 < total; i++) { } console.log('%d', i * 1000 - total); } //*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します) Main(require("fs").readFileSync("/dev/stdin", "utf8"));
function Main(input) { let total = parseInt(input); let i; for (i = 0; i * 1000 < total; i++) { } console.log('%d', i * 1000 - total); } //*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します) Main(require("fs").readFileSync("/dev/stdin", "utf8"));
[["-", 8, 556, 0, 570, 0, 200, 51, 2, 63, 22], ["+", 8, 556, 0, 570, 0, 200, 51, 2, 63, 22], ["+", 0, 493, 0, 435, 8, 556, 0, 570, 0, 35], ["+", 0, 493, 0, 435, 8, 556, 0, 570, 571, 243], ["+", 0, 435, 8, 556, 0, 570, 0, 200, 141, 22], ["-", 0, 435, 8, 556, 0, 7, 10, 570, 571, 243]]
2
70
#ABC173-A N = int(input()) print(N % 1000)
#ABC173-A N = int(input()) print(-N % 1000)
[["+", 0, 652, 3, 4, 0, 657, 31, 664, 17, 33]]
5
15
#include <stdio.h> int main(void) { int N, n; scanf("%d", &N); n = (N / 1000) + 1; printf("%d", n * 1000 - N); return 0; }
#include <stdio.h> int main(void) { int N, n; scanf("%d", &N); n = (N / 1000) + 1; printf("%d", (n * 1000 - N) % 1000); return 0; }
[["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 24], ["+", 0, 2, 3, 4, 0, 16, 31, 23, 0, 25], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 109], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
0
50
#include <algorithm> #include <bits/stdc++.h> using namespace std; int main() { int cost; int change = 1000; cin >> cost; if (1 <= cost && cost <= 999) { cout << cost; return 0; } if (cost % 1000 == 0) { cout << 0; return 0; } while (1) { change = 1000 - cost; cost -= 1000; ...
#include <algorithm> #include <bits/stdc++.h> using namespace std; int main() { int cost; int change = 1000; cin >> cost; if (1 <= cost && cost <= 999) { cout << 1000 - cost; return 0; } if (cost % 1000 == 0) { cout << 0; return 0; } while (1) { change = 1000 - cost; cost -= ...
[["+", 64, 9, 0, 1, 0, 16, 12, 16, 31, 13], ["+", 64, 9, 0, 1, 0, 16, 12, 16, 17, 33]]
1
102
#include <iostream> using namespace std; int main() { int n; cin >> n; int a; a = n / 1000 + 1; cout << a * 1000 - n << endl; }
#include <iostream> using namespace std; int main() { int n; cin >> n; int a; a = (n + 999) / 1000; cout << a * 1000 - n << endl; }
[["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 24], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 17, 72], ["+", 0, 11, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 1, 0, 11, 12, 16, 31, 23, 0, 25], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 17, 72], ["-", 8, 9, 0, 1, 0, 11, 12, 16, 12, 13]]
1
40
package main import ( "fmt" ) func main() { var n int fmt.Scanf("%d", &n) ans := 1000 - (n % 1000) fmt.Printf("%d\n", ans) }
package main import ( "fmt" ) func main() { var n int fmt.Scanf("%d", &n) ans := (10000 - n) % 1000 fmt.Printf("%d\n", ans) }
[["-", 36, 36, 36, 36, 36, 36, 0, 434, 0, 165], ["+", 36, 36, 36, 36, 36, 36, 0, 434, 0, 165], ["-", 8, 196, 0, 431, 12, 432, 0, 16, 31, 433], ["-", 8, 196, 0, 431, 12, 432, 0, 16, 17, 33], ["+", 12, 432, 0, 16, 31, 23, 0, 16, 31, 433], ["+", 12, 432, 0, 16, 31, 23, 0, 16, 17, 33], ["+", 0, 431, 12, 432, 0, 16, 31, 23,...
7
55
/* */ #include <algorithm> #include <cstdlib> #include <iomanip> #include <ios> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define repb(i, a, b) for (int i = a; i < b; i++) #...
/* */ #include <algorithm> #include <cstdlib> #include <iomanip> #include <ios> #include <iostream> #include <map> #include <math.h> #include <queue> #include <stack> #include <string> #include <utility> #include <vector> #define rep(i, n) for (int i = 0; i < n; i++) #define repb(i, a, b) for (int i = a; i < b; i++) #...
[["+", 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
108
N = int(input) for i in range(11): money = i * 1000 if money - N >= 0: print(money - N) break
N = int(input()) for i in range(11): money = i * 1000 if money - N >= 0: print(money - N) break
[["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25]]
5
33
import math n = int(input()) if n % 1000 == 0: print(0) else: print(math.ceil(1900 / 1000) * 1000 - n)
import math n = int(input()) if n % 1000 == 0: print(0) else: print(math.ceil(n / 1000) * 1000 - n)
[["-", 31, 657, 31, 652, 3, 4, 0, 657, 31, 612], ["+", 31, 657, 31, 652, 3, 4, 0, 657, 31, 22]]
5
38
x=int(input()) print((1000-x//1000)%1000)
x=int(input()) print((1000-x%1000)%1000)
[["-", 0, 657, 31, 23, 0, 657, 12, 657, 17, 676], ["+", 0, 657, 31, 23, 0, 657, 12, 657, 17, 109]]
5
20
#include <iostream> using namespace std; int main() { int n; cin >> n; cout << (1000 - (n % 1000)); }
#include <iostream> using namespace std; int main() { int n; cin >> n; cout << (1000 - (n % 1000)) % 1000; }
[["+", 8, 9, 0, 1, 0, 16, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 12, 13]]
1
31
#include <bits/stdc++.h> #include <math.h> using namespace std; int main() { long n; cin >> n; if (n % 1000 == 0) { cout << -0 << endl; } cout << 1000 - n % 1000 << endl; }
#include <bits/stdc++.h> #include <math.h> using namespace std; int main() { long n; cin >> n; if (n % 1000 == 0) { cout << -0 << endl; } else { cout << 1000 - n % 1000 << 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
47
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vector<int>>; using vvc = vector<vector<char>>; #define rep(i, n) for (ll i = 0; i < ll(n); i++) #define repd(i, n) for (ll i = n - 1; i >= 0; i--) #define all(x) x.begin(), x.end(...
#pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using vvi = vector<vector<int>>; using vvc = vector<vector<char>>; #define rep(i, n) for (ll i = 0; i < ll(n); i++) #define repd(i, n) for (ll i = n - 1; i >= 0; i--) #define all(x) x.begin(), x.end(...
[["+", 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
118
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n % 1000 == 0) { cout << 0; } else { cout << n - n % 1000; } }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n % 1000 == 0) { cout << 0; } else { cout << (1000 - n % 1000); } }
[["-", 0, 9, 0, 1, 0, 16, 12, 16, 31, 22], ["+", 0, 9, 0, 1, 0, 16, 12, 23, 0, 24], ["+", 0, 1, 0, 16, 12, 23, 0, 16, 31, 13], ["+", 0, 9, 0, 1, 0, 16, 12, 23, 0, 25]]
1
44
// https://atcoder.jp/contests/abc173/tasks/abc173_a #include <stdio.h> int main(void) { int n; scanf("%d", &n); if (n % 1000 == 0) printf("%d", 0); else if (n % 1000 < 500 || n % 1000 == 500) printf("%d", n % 1000); else if (n % 1000 > 500) printf("%d", 1000 - (n % 1000)); return 0; }
// https://atcoder.jp/contests/abc173/tasks/abc173_a #include <stdio.h> int main(void) { int n; scanf("%d", &n); if (n % 1000 == 0) printf("%d", 0); else if (n % 1000 < 500 || n % 1000 == 500) printf("%d", 1000 - (n % 1000)); else if (n % 1000 > 500) printf("%d", 1000 - (n % 1000)); return...
[["+", 64, 1, 0, 2, 3, 4, 0, 16, 31, 13], ["+", 64, 1, 0, 2, 3, 4, 0, 16, 17, 33], ["+", 0, 2, 3, 4, 0, 16, 12, 23, 0, 24], ["+", 0, 2, 3, 4, 0, 16, 12, 23, 0, 25]]
0
93
n=int(input()) if n%1000 == 0 : print(0) else : ans=1000*((n/1000)+1)-n print(ans)
n = int(input()) if n % 1000 == 0: print(0) else: ans = 1000*(int(n/1000)+1)-n print(ans)
[["+", 31, 657, 12, 23, 0, 657, 31, 652, 63, 22]]
5
40
n = int(input()) if n % 1000 == 0: print(0) else: while n > 1000: n -= 1000 print(n)
n = int(input()) if n % 1000 == 0: print(0) else: while n > 1000: n -= 1000 print(1000-n)
[["+", 0, 1, 0, 652, 3, 4, 0, 657, 31, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 33]]
5
33
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); if (n % 1000 == 0) { printf("0\n"); } else { printf("%d\n", n - (n % 1000)); } }
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); if (n % 1000 == 0) { printf("0\n"); } else { printf("%d\n", 1000 - (n % 1000)); } }
[["-", 0, 1, 0, 2, 3, 4, 0, 16, 31, 22], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 31, 13]]
1
62
#include <iostream> using namespace std; int main() { int n; cin >> n; if (n % 1000) printf("%d\n", 1000 + (1000 - n) % 1000); else printf("0\n"); return 0; }
#include <iostream> using namespace std; int main() { int n; cin >> n; if (n % 1000) printf("%d\n", 1000 - n % 1000); else printf("0\n"); return 0; }
[["-", 64, 1, 0, 2, 3, 4, 0, 16, 17, 72], ["-", 3, 4, 0, 16, 12, 16, 31, 23, 0, 24], ["-", 0, 16, 12, 16, 31, 23, 0, 16, 31, 13], ["-", 3, 4, 0, 16, 12, 16, 31, 23, 0, 25]]
1
55
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; const int INF = 1001001001; int main() { int N, i = 1, ans; cin >> N; cout << 1000 - N % 1000 << endl; return 0; }
#pragma GCC optimize("Ofast") #include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; typedef long long ll; const int INF = 1001001001; int main() { int N, i = 1, ans; cin >> N; cout << (1000 - N % 1000) % 1000 << endl; 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
59
#include <iostream> using namespace std; int main() { int N; cin >> N; cout << 1000 - (N % 1000); }
#include <iostream> using namespace std; int main() { int N; cin >> N; cout << (1000 - (N % 1000)) % 1000; }
[["+", 0, 1, 0, 16, 12, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 23, 0, 16, 12, 23, 0, 25], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 17, 109], ["+", 8, 9, 0, 1, 0, 16, 12, 16, 12, 13]]
1
29
#include <bits/stdc++.h> using namespace std; int A = 0; int main() { cin >> A; cout << 1000 - (A % 1000) << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int A = 0; int main() { cin >> A; cout << (1000 - (A % 1000)) % 1000 << endl; return 0; }
[["+", 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
36
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n; cin >> n; int x = (n + 1000) / 1000; int ans = x * 1000 - n; cout << ans << endl; return 0; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (n); i++) using namespace std; using ll = long long; using P = pair<int, int>; int main() { int n; cin >> n; int x = (n + 1000 - 1) / 1000; int ans = x * 1000 - n; cout << ans << endl; return 0; }
[["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 33], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 13]]
1
72
#include <stdio.h> int main(void) { int n; scanf("%d", &n); if (n == 1000) printf("%d\n", 0); else printf("%d\n", 1000 - n % 1000); return 0; }
#include <stdio.h> int main(void) { int n; scanf("%d", &n); if (n % 1000 == 0) printf("%d\n", 0); else printf("%d\n", 1000 - n % 1000); return 0; }
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 60], ["+", 0, 57, 15, 23, 0, 16, 31, 16, 17, 109], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 12, 13]]
0
56
#include <cstring> #include <iostream> #define MaxNum 10000100 using namespace std; bool e[MaxNum]; int p[MaxNum], tn, mu[MaxNum], n; void Mobius() { e[1] = 1; mu[1] = 1; for (int i = 2; i <= n; i++) { if (!e[i]) { p[++tn] = i; mu[i] = -1; } for (int j = 1; j <= tn; j++) { if (p[j] *...
#include <cstring> #include <iostream> #define MaxNum 10000100 using namespace std; bool e[MaxNum]; int p[MaxNum], tn, mu[MaxNum], n; void Mobius() { e[1] = 1; mu[1] = 1; for (int i = 2; i <= n; i++) { if (!e[i]) { p[++tn] = i; mu[i] = -1; } for (int j = 1; j <= tn; j++) { if (p[j] *...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
212
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) using Graph = vector<vector<int>>; using ll = long long; int main() { int n; if (n % 1000 == 0) { cout << 0 << endl; return 0; } cout << 1000 - n...
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep2(i, s, n) for (int i = (s); i < (int)(n); i++) using Graph = vector<vector<int>>; using ll = long long; int main() { int n; cin >> n; if (n % 1000 == 0) { cout << 0 << endl; return 0; } cout...
[["+", 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
79
#include <iostream> using namespace std; int main() { int n; cin >> n; cout << (1000 - 1000 % n) % 1000 << endl; return 0; }
#include <iostream> using namespace std; int main() { int n; cin >> n; cout << (1000 - n % 1000) % 1000 << endl; return 0; }
[["-", 12, 16, 31, 23, 0, 16, 12, 16, 31, 13], ["-", 12, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 12, 16, 31, 23, 0, 16, 12, 16, 12, 13]]
1
36
n = int(input()) a = n % 1000 if a == 1000: ans = 0 else: ans = 1000 - a print(ans)
n = int(input()) a = n % 1000 if a == 0: ans = 0 else: ans = 1000 - a print(ans)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612]]
5
32
#include <bits/stdc++.h> using namespace std; #define ll unsigned long long #define pb push_back #define mk make_pair #define REP(i, a, b) for (int i = a; i <= b; i++) #define mod 1000000007 int main() { ll n; cin >> n; if (n % 1000) { cout << n % 1000; } else cout << 0; }
#include <bits/stdc++.h> using namespace std; #define ll unsigned long long #define pb push_back #define mk make_pair #define REP(i, a, b) for (int i = a; i <= b; i++) #define mod 1000000007 int main() { ll n; cin >> n; if (n % 1000) { cout << 1000 - n % 1000; } else cout << 0; }
[["+", 64, 9, 0, 1, 0, 16, 12, 16, 31, 13], ["+", 64, 9, 0, 1, 0, 16, 12, 16, 17, 33]]
1
60
N = map(int,input()) x = 0 while x < N : x = x + 1000 print(x-N)
N = int(input()) x = 0 while x < N : x = x + 1000 print(x-N)
[["-", 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, 21], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24]]
5
29
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int rem = n % 1000; if (rem > 500) { rem = 1000 - rem; } cout << rem; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int rem = n % 1000; if (rem != 0) { rem = 1000 - rem; } cout << rem; 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
47
#include <iostream> #include <string> int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); int n; std::cin >> n; int result = 1000 - n % 1000; std::cout << result << std::endl; return 0; }
#include <iostream> #include <string> int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); int n; std::cin >> n; int result = (1000 - n % 1000) % 1000; std::cout << result << std::endl; return 0; }
[["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 24], ["+", 51, 16, 31, 23, 0, 16, 12, 16, 17, 109], ["+", 51, 16, 31, 23, 0, 16, 12, 16, 12, 13], ["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 25]]
1
59
#include <iostream> #define u unsigned #define s short #define ll long long #define REP(i, a, b) for (auto i = (a); i < (b); i++) #define REPR(i, a, b) for (auto i = (a - 1); i >= (b); i--) using namespace std; int main() { int N; cin >> N; cout << (N % 1000 == 0 ? 0 : (1000 - (N & 1000))) << "\n"; return ...
#include <iostream> #define u unsigned #define s short #define ll long long #define REP(i, a, b) for (auto i = (a); i < (b); i++) #define REPR(i, a, b) for (auto i = (a - 1); i >= (b); i--) using namespace std; int main() { int N; cin >> N; cout << (N % 1000 == 0 ? 0 : (1000 - (N % 1000))) << "\n"; return ...
[["-", 75, 23, 0, 16, 12, 23, 0, 16, 17, 67], ["+", 75, 23, 0, 16, 12, 23, 0, 16, 17, 109]]
1
77
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n % 1000 == 0) cout << "0"; else { int temp = n / 1000; cout << 1000 * temp - n; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n % 1000 == 0) cout << "0"; else { int temp = n / 1000; cout << 1000 * (temp + 1) - n; } return 0; }
[["+", 0, 16, 12, 16, 31, 16, 12, 23, 0, 24], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 17, 72], ["+", 12, 16, 31, 16, 12, 23, 0, 16, 12, 13], ["+", 0, 16, 12, 16, 31, 16, 12, 23, 0, 25]]
1
54
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { MyScanner sc = new MyScanner(); out = new PrintWriter(new BufferedOutputStream(System.out)); // Start writing your solution here. ------------------------------------- /* int n = sc.nextInt();...
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { MyScanner sc = new MyScanner(); out = new PrintWriter(new BufferedOutputStream(System.out)); // Start writing your solution here. ------------------------------------- /* int n = sc.nextInt();...
[["-", 0, 1, 0, 492, 3, 4, 0, 16, 12, 499], ["+", 0, 1, 0, 492, 3, 4, 0, 16, 12, 22]]
3
295
#include <iostream> #include <stdlib.h> using namespace std; int main() { int n, i = 0; cin >> n; while (1) { if (n < 1000 * i) break; i++; } cout << abs(n - 1000 * i); return 0; }
#include <iostream> #include <stdlib.h> using namespace std; int main() { int n, i = 0; cin >> n; while (1) { if (n <= 1000 * i) break; i++; } cout << abs(n - 1000 * i); return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
58
// package hiougyf; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); int a = t % 1000; if (a != 0) System.out.println(1000 - a); else System.out.println("1000"); } }
// package hiougyf; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); int a = t % 1000; if (a != 0) System.out.println(1000 - a); else System.out.println("0"); } }
[["-", 75, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 75, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
81
#include <iostream> //#include <vector> using namespace std; int main() { int N; cin >> N; if (N > 999) { int temp; temp = N % 1000; cout << 1000 - temp << endl; } else cout << 0 << endl; return 0; }
#include <iostream> //#include <vector> using namespace std; int main() { int N; cin >> N; if (N % 1000 != 0) { int temp; temp = N % 1000; cout << 1000 - temp << endl; } else cout << 0 << endl; return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 109], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 79], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
55
i = int(input()) if i % 1000: print(0) else: print(1000-(i % 1000))
i = int(input()) if i % 1000 == 0: print(0) else: print(1000-(i % 1000))
[["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612]]
5
29
N = input() A = 0 if N%1000 == 0 else 1000 - N%1000 print(A)
N = int(input()) A = 0 if N%1000 == 0 else 1000 - N%1000 print(A)
[["+", 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
24
#include <cstdio> using namespace std; int main() { int ans; int n; scanf("%d", &n); if (n % 1000 == 0) { ans = 0; } else { ans = 1000 - n % 1000; } printf("%d\n", n); return 0; }
#include <cstdio> using namespace std; int main() { int ans; int n; scanf("%d", &n); if (n % 1000 == 0) { ans = 0; } else { ans = 1000 - n % 1000; } printf("%d\n", ans); return 0; }
[["-", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22], ["+", 8, 9, 0, 1, 0, 2, 3, 4, 0, 22]]
1
66
const main = async () => { const input = require('fs').readFileSync('/dev/stdin', 'UTF-8').trim() const num = parseInt(input).toLocaleString().split(',') const answer = 1000 - parseInt(num[num.length - 1]) if (answer === 1000) { console.log('1000'); } else { console.log(answer); } } main()
const main = async () => { const input = require('fs').readFileSync('/dev/stdin', 'UTF-8').trim() const num = parseInt(input).toLocaleString().split(',') const answer = 1000 - parseInt(num[num.length - 1]) if (answer === 1000) { console.log('0'); } else { console.log(answer); } } main()
[["-", 0, 1, 0, 2, 3, 3, 0, 557, 0, 491], ["+", 0, 1, 0, 2, 3, 3, 0, 557, 0, 491]]
2
97
N = input() turi = N % 1000 if turi != 0: turi = 1000 - turi print(turi)
N = int(input()) turi = N % 1000 if turi != 0: turi = 1000 - turi print(turi)
[["+", 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
24
a = int(input()) print(0) if a%1000==0 else print(1000-(a//1000))
a = int(input()) print(0) if a%1000==0 else print(1000-(a%1000))
[["-", 3, 4, 0, 657, 12, 23, 0, 657, 17, 676], ["+", 3, 4, 0, 657, 12, 23, 0, 657, 17, 109]]
5
29
N=int(input()) a=N//1000 if a==0: print(0) else: print(1000*(a+1)-N)
N=int(input()) a=N//1000 if N%1000==0: print(0) else: print(1000*(a+1)-N)
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 31, 22], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 17, 109], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 12, 612]]
5
36
import math n=int(input()) total = math.ceil(n/1000) print(total-n)
import math n=int(input()) total = math.ceil(n/1000) print((total)*1000-n)
[["+", 3, 4, 0, 657, 31, 657, 31, 23, 0, 24], ["+", 3, 4, 0, 657, 31, 657, 31, 23, 0, 25], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 17, 48], ["+", 0, 652, 3, 4, 0, 657, 31, 657, 12, 612]]
5
26
n = 111200 n2 = str(n)[-3:] if int(n2) == 0: print(0) else: ans = 1000 - int(n2) print(ans)
# -*- coding: utf-8 -*- n = int(input()) n2 = str(n)[-3:] if int(n2) == 0: print(0) else: ans = 1000 - int(n2) print(ans)
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 662, 12, 652, 3, 4, 0, 652, 63, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
40
N = int(input()) if N % 2 ==0: print(0) else: print((1000-(N % 1000)))
#ABC173 N = int(input()) if N % 1000 == 0: print(0) else: print((1000-(N % 1000)))
[["-", 0, 656, 0, 57, 15, 666, 0, 657, 12, 612], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 12, 612]]
5
33
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << 1000 - n % 1000; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << (1000 - n % 1000) % 1000; return 0; }
[["+", 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
30
#include <bits/stdc++.h> using namespace std; int main() { int n, i, sum = 0; cin >> n; for (i = 0; sum <= n; i++) { sum = sum + 1000; } cout << sum - n; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n, i, sum = 0; cin >> n; for (i = 0; sum < n; i++) { sum = sum + 1000; } cout << sum - n; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18]]
1
55
#include <bits/stdc++.h> using namespace std; #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define IN freopen("input.txt", "r", stdin); #define OUT freopen("output.txt", "w", stdout); #...
#include <bits/stdc++.h> using namespace std; #define FAST \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); #define IN freopen("input.txt", "r", stdin); #define OUT freopen("output.txt", "w", stdout); #...
[["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 22], ["-", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35]]
1
64
#include <iostream> using namespace std; int main() { int N; cin >> N; if (N / 1000 == 0) { cout << "0" << endl; } else { cout << 1000 - N % 1000 << endl; } }
#include <iostream> using namespace std; int main() { int N; cin >> N; if (N % 1000 == 0) { cout << "0" << endl; } else { cout << 1000 - N % 1000 << endl; } }
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 85], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 109]]
1
50
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); System.out.println(1000 - (a % 1000)); } }
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); System.out.println((1000 - (a % 1000)) % 1000); } }
[["+", 0, 492, 3, 4, 0, 16, 31, 23, 0, 24], ["+", 0, 16, 31, 23, 0, 16, 12, 23, 0, 25], ["+", 0, 1, 0, 492, 3, 4, 0, 16, 17, 109], ["+", 0, 1, 0, 492, 3, 4, 0, 16, 12, 499]]
3
59
n=int(input()) while n>0: n-=1000 print(n)
n=int(input()) while n>0: n-=1000 print(abs(n))
[["+", 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, 652, 3, 4, 0, 25]]
5
20
n=int(input()) while n>=1000: n-=1000 print(abs(n))
n=int(input()) while n>0: n-=1000 print(abs(n))
[["-", 36, 36, 0, 656, 0, 52, 15, 666, 667, 20], ["-", 36, 36, 0, 656, 0, 52, 15, 666, 0, 612], ["+", 36, 36, 0, 656, 0, 52, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 52, 15, 666, 0, 612]]
5
23
n = int(input()) if n % 1000: print(0) else: print(1000 - n%1000)
n = int(input()) if n % 1000 == 0: print(0) else: print(1000 - n%1000)
[["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 60], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612]]
5
27
x=int(input()) if(x&1000==0): print(0) else: print(x%1000)
x=int(input()) if(x%1000==0): print(0) else: print(1000-x%1000)
[["-", 0, 57, 15, 23, 0, 666, 0, 657, 17, 67], ["+", 0, 57, 15, 23, 0, 666, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 31, 612], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 33]]
5
29
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); System.out.println(1000 - n % 1000); } }
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); System.out.println((1000 - n % 1000) % 1000); } }
[["+", 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
64
#include <bits/stdc++.h> using namespace std; #define sp ' ' #define endl '\n' #define st first #define nd second #define sz(x) ((long long int)x.size()) #define pb push_back #define pob pop_back #define mp make_pair #define lb lower_bound #define ub upper_bound #define forn(xx, yy) for (long long int yy = 0; yy < xx;...
#include <bits/stdc++.h> using namespace std; #define sp ' ' #define endl '\n' #define st first #define nd second #define sz(x) ((long long int)x.size()) #define pb push_back #define pob pop_back #define mp make_pair #define lb lower_bound #define ub upper_bound #define forn(xx, yy) for (long long int yy = 0; yy < xx;...
[["+", 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
414
#include <stdio.h> int main(void) { int N; scanf("%d", &N); for (int i = 0; i <= 10; i++) { if (N > i * 1000) { } else { printf("%d", (i * 1000) - N); } } }
#include <stdio.h> int main(void) { int N; scanf("%d", &N); for (int i = 0; i <= 10; i++) { if (N > i * 1000) { } else { printf("%d", (i * 1000) - N); break; } } }
[["+", 0, 57, 75, 76, 0, 9, 0, 93, 0, 94], ["+", 0, 57, 75, 76, 0, 9, 0, 93, 0, 35]]
0
66
n = int(input()) a = n%1000 print(a) if a ==0: print(0) exit() a = 1000-a print(a)
n = int(input()) a = n%1000 if a ==0: print(0) exit() a = 1000-a print(a)
[["-", 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
38
#include <bits/stdc++.h> using namespace std; #define pb push_back #define pf push_front typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define mp make_pair #define fi first #define se second typedef pair<int, int> pint; #define All(s) s.begi...
#include <bits/stdc++.h> using namespace std; #define pb push_back #define pf push_front typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define mp make_pair #define fi first #define se second typedef pair<int, int> pint; #define All(s) s.begi...
[["+", 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
185
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n; int k = (n + 999) / 1000 * 1000; cout << k - n; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n; cin >> n; int k = (n + 999) / 1000 * 1000; cout << k - n; return 0; }
[["+", 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
42
#include <stdio.h> int main(void) { int N; scanf("%d", &N); printf("%d\n", 1000 - N % 1000); return 0; }
#include <stdio.h> int main(void) { int N; scanf("%d", &N); printf("%d\n", (1000 - N % 1000) % 1000); return 0; }
[["+", 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]]
0
39
#include <bits/stdc++.h> #define rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define SZ(x) ((int)(x).size()) typedef long long ll; typedef unsigned long long ull; typedef unsigned int uint; struct Vector { double x, y; }; template <class T> inline bool chmin(T &a, T b) {...
#include <bits/stdc++.h> #define rep(i, n) repi(i, 0, n) #define repi(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define SZ(x) ((int)(x).size()) typedef long long ll; typedef unsigned long long ull; typedef unsigned int uint; struct Vector { double x, y; }; template <class T> inline bool chmin(T &a, T b) {...
[["+", 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
154
#include <stdio.h> int main() { int N; scanf("%d", &N); while (N >= 1000) { N -= 1000; } printf("%d", N); }
#include <stdio.h> int main() { int N; scanf("%d", &N); while (N > 0) { N -= 1000; } printf("%d\n", N * -1); }
[["-", 8, 9, 0, 52, 15, 23, 0, 16, 17, 20], ["-", 8, 9, 0, 52, 15, 23, 0, 16, 12, 13], ["+", 8, 9, 0, 52, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 52, 15, 23, 0, 16, 12, 13], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 44], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 17, 48], ["+", 0, 1, 0, 2, 3, 4, 0, 16, 12, 13]]
0
42
n = int(input()) if(n % 1000): print(0) else: print(1000 - n % 1000)
n = int(input()) if(n % 1000 == 0): print(0) else: print(1000 - n % 1000)
[["+", 0, 656, 0, 57, 15, 23, 0, 666, 667, 60], ["+", 0, 656, 0, 57, 15, 23, 0, 666, 0, 612]]
5
29
taka = int(input()) remainder = taka % 1000 ans = 1000 - remainder print(ans)
taka = int(input()) remainder = taka % 1000 ans = 1000 - remainder print(ans % 1000)
[["+", 0, 1, 0, 652, 3, 4, 0, 657, 17, 109], ["+", 0, 1, 0, 652, 3, 4, 0, 657, 12, 612]]
5
22