buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <stdio.h> int main(void) { int a, b, i, k; scanf("%d%d%d", &k, &a, &b); for (i = a; i < b; i++) { if (i % k == 0) { printf("OK"); return 0; } } printf("NG"); return 0; }
#include <stdio.h> int main(void) { int a, b, i, k; scanf("%d%d%d", &k, &a, &b); for (i = a; i < b + 1; i++) { if (i % k == 0) { printf("OK"); return 0; } } printf("NG"); return 0; }
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
0
79
k = int(input()) a, b = map(int, input()) answer = 'NG' for i in range(a,b): if i % k == 0: answer = 'OK' print(answer)
k = int(input()) a, b = map(int, input().split()) answer = 'NG' for i in range(a,b+1): if i % k == 0: answer = 'OK' print(answer)
[["+", 12, 652, 3, 4, 0, 652, 63, 319, 0, 131], ["+", 12, 652, 3, 4, 0, 652, 63, 319, 319, 22], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 24], ["+", 12, 652, 3, 4, 0, 652, 3, 4, 0, 25], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
51
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { int k, a, b, temp; cin >> k >> a >> b; temp = k; while (temp + k <= b) temp += k; if (a <= temp) cout << "OK" << endl; else cout << "NG" << endl; }
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) using namespace std; int main() { int k, a, b, temp; cin >> k >> a >> b; temp = 0; while (temp + k <= b) temp += k; if (a <= temp) cout << "OK" << endl; else cout << "NG" << endl; }
[["-", 0, 14, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13]]
1
76
import java.util.*; public class Main { public static void main(String[] args) throws Exception { String[] lines = getStdin(); String str1 = lines[0]; int mult = Integer.parseInt(str1); // K String str2 = lines[1]; String[] str21 = str2.split(" "); int from = Integer.parseInt(str21[0]); // A...
import java.util.*; public class Main { public static void main(String[] args) throws Exception { String[] lines = getStdin(); String str1 = lines[0]; int mult = Integer.parseInt(str1); // K String str2 = lines[1]; String[] str21 = str2.split(" "); int from = Integer.parseInt(str21[0]); // A...
[["-", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491], ["+", 0, 1, 0, 492, 3, 4, 0, 5, 0, 491]]
3
243
K = int(input()) AB = input() l = AB.split() A = int(l[0]) B = int(l[1]) li = [] for i in range(A, B+1) : if i % K == 0 : li.append(i) else : continue if len(li) >=1 : print("YES") else : print("NO")
K = int(input()) AB = input() l = AB.split() A = int(l[0]) B = int(l[1]) li = [] for i in range(A, B+1) : if i % K == 0 : li.append(i) else : continue if len(li) >=1 : print("OK") else : print("NG")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
92
#include <stdio.h> int main() { int K, A, B, flag = 0; scanf("%d", &K); scanf("%d %d", &A, &B); for (int i = 1; K * i < B; i++) { if (K * i >= A && K * i <= B) { printf("OK"); flag = 1; break; } } if (flag == 0) printf("NG"); }
#include <stdio.h> int main() { int K, A, B, flag = 0; scanf("%d", &K); scanf("%d %d", &A, &B); for (int i = 1; K * i <= B; i++) { if (K * i >= A && K * i <= B) { printf("OK"); flag = 1; break; } } if (flag == 0) printf("NG"); }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
0
102
a = get.to_i b,c = get.split.map(&:to_i) i = 0 while i + a <=c do i += a if b<=i then puts "OK" return end end puts"NG"
a = gets.to_i b,c = gets.split.map(&:to_i) i = 0 while i + a <=c do i += a if b<=i then puts "OK" return end end puts"NG"
[["-", 36, 36, 0, 493, 0, 662, 12, 652, 486, 22], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 486, 22], ["-", 0, 493, 0, 662, 12, 652, 486, 652, 486, 22], ["+", 0, 493, 0, 662, 12, 652, 486, 652, 486, 22]]
4
47
k=int(input()) a,b=map(int,input().split()) print("OK" if (a-1)//k!=b//k else 'No')
k=int(input()) a,b=map(int,input().split()) print("OK" if (a-1)//k!=b//k else 'NG')
[["-", 0, 652, 3, 4, 0, 41, 0, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 41, 0, 557, 0, 6]]
5
46
k = int(input()) a, b = map(int, input().split()) c = (b//k) * k if c >= a: print('OK') else: print('NO')
k = int(input()) a,b = map(int, input().split()) if (b // k) * k >= a: print('OK') else: print('NG')
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["+", 36, 36, 36, 36, 0, 656, 0, 57, 0, 121], ["-", 36, 36, 36, 36, 0, 656, 0, 57, 0, 121], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
52
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define REP(i, n) for (int i = 0; i <= n; i++) #define ll long long using namespace std; int keta(int n) { int res; for (int i = 0; i < 100; i++) { n = n / 10; if (n == 0) { res = i + 1; break; } } return res; } in...
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < n; i++) #define REP(i, n) for (int i = 0; i <= n; i++) #define ll long long using namespace std; int keta(int n) { int res; for (int i = 0; i < 100; i++) { n = n / 10; if (n == 0) { res = i + 1; break; } } return res; } in...
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 31, 22]]
1
156
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b; cin >> k >> a >> b; bool t = false; for (int i = a; i < b + 1; i++) { if (i % k == 0) { t = true; } } if (t = true) { cout << "OK" << endl; } else { cout << "NG" << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b; cin >> k >> a >> b; bool t = false; for (int i = a; i < b + 1; i++) { if (i % k == 0) { t = true; } } if (t == true) { cout << "OK" << endl; } else { cout << "NG" << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60]]
1
91
if __name__ == '__main__': k = input() k = int(k) ab = input() ab = ab.split() a = int(ab[0]) b = int(ab[1]) flag = False sum = k while k<b: if a<=k and k<=b: flag = True k += sum if flag: print("OK") else: print("NG")
if __name__ == '__main__': k = input() k = int(k) ab = input() ab = ab.split() a = int(ab[0]) b = int(ab[1]) flag = False sum = k while k<=b: if a<=k and k<=b: flag = True k += sum if flag: print("OK") else: print("NG")
[["-", 0, 57, 64, 196, 0, 52, 15, 666, 667, 18], ["+", 0, 57, 64, 196, 0, 52, 15, 666, 667, 19]]
5
91
#include <bits/stdc++.h> using namespace std; int main() { int K, A, B; cin >> K >> A >> B; if ((B / K) < 1) { cout << "NG" << endl; return 0; } int amari = B % K; if ((B - amari) >= A) { cout << "NG" << endl; return 0; } cout << "OK" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int K, A, B; cin >> K >> A >> B; if ((B / K) < 1) { cout << "NG" << endl; return 0; } int amari = B % K; if ((B - amari) < A) { cout << "NG" << endl; return 0; } cout << "OK" << endl; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18]]
1
88
k=int(input()) a,b=map(int,input().split()) flg=0 for i in range(a,b): if i%k==0: flg+=1 i+=1 if a==b: if a%k==0: flg+=1 if flg==0: print("NG") else: print("OK")
k=int(input()) a,b=map(int,input().split()) flg=0 for i in range(a,b+1): if i%k==0: flg+=1 i+=1 if (a==b and a%k==0): flg+=1 if flg==0: print("NG") else: print("OK")
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["+", 36, 36, 0, 656, 0, 57, 15, 23, 0, 24], ["-", 36, 36, 36, 36, 0, 656, 0, 57, 0, 102], ["-", 0, 656, 0, 57, 64, 196, 0, 57, 0, 121], ["+", 0, 656, 0, 57, 15, 23, 0, 679, 17, 355], ["+", 36, 36, 0, 656, 0, 57, 15, 23, 0, 25]]
5
84
#include <bits/stdc++.h> using namespace std; typedef long long ll; //ループ #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 FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++) #define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--) //コンテナ #define ALL(x) (x).begin(...
#include <bits/stdc++.h> using namespace std; typedef long long ll; //ループ #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 FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++) #define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--) //コンテナ #define ALL(x) (x).begin(...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 85], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 109]]
1
159
K = int(input()) A,B = map(int,input().split()) for i in range(A,B+1): if i % K == 0: print("OK") flg=1 break else: flg=0 if flg==0: print("NO")
K = int(input()) A,B = map(int,input().split()) for i in range(A,B+1): if i % K == 0: print("OK") flg=1 break else: flg=0 if flg==0: print("NG")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
69
K=int(input()) a,b=map(int,input().split()) flag = 0 for i in range(a,b+1): if i%K == 0: flag = 1 break print('OK' if flag==1 else 'NO')
K=int(input()) a,b=map(int,input().split()) flag = 0 for i in range(a,b+1): if i%K == 0: flag = 1 break print('OK' if flag else 'NG')
[["-", 0, 652, 3, 4, 0, 41, 0, 666, 667, 60], ["-", 0, 652, 3, 4, 0, 41, 0, 666, 0, 612], ["-", 0, 652, 3, 4, 0, 41, 0, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 41, 0, 557, 0, 6]]
5
64
K=int(input()) a,b=map(int,input().split()) flag = 0 for i in range(a,b+1): if i%K == 0: flag = 1 break print('OK' if flag==1 else 'NO')
K=int(input()) a,b=map(int,input().split()) flag = 0 for i in range(a,b+1): if i%K == 0: flag = 1 break print('OK' if flag==1 else 'NG')
[["-", 0, 652, 3, 4, 0, 41, 0, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 41, 0, 557, 0, 6]]
5
64
K = int(input()) A, B = map(int, input().split()) i = 1 while K * i <= 1000: if A <= K * i and K * i <= B: print("Yes") exit() else: i+=1 print("NG")
K = int(input()) A, B = map(int, input().split()) i = 1 while K * i <= 1000: if A <= K * i and K * i <= B: print("OK") exit() else: i+=1 print("NG")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
67
#include <stdio.h> int main(void) { int K, A, B; int wid; int rem; scanf("%d\n %d %d", &K, &A, &B); rem = A % K; K = K - rem; wid = B - A; if (K < wid || rem == 0) { printf("OK"); } else { printf("NG"); } return 0; }
#include <stdio.h> int main(void) { int K, A, B; int wid; int rem; scanf("%d\n %d %d", &K, &A, &B); rem = A % K; K = K - rem; wid = B - A; if (K <= wid || rem == 0) { printf("OK"); } else { printf("NG"); } return 0; }
[["-", 0, 57, 15, 23, 0, 16, 31, 16, 17, 18], ["+", 0, 57, 15, 23, 0, 16, 31, 16, 17, 19]]
0
90
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = Integer.parseInt(sc.next()); int a = Integer.parseInt(sc.next()); int b = Integer.parseInt(sc.next()); String ans = "NG"; for (int i = a; i < b; i++) { if (i % ...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = Integer.parseInt(sc.next()); int a = Integer.parseInt(sc.next()); int b = Integer.parseInt(sc.next()); String ans = "NG"; for (int i = a; i < b + 1; i++) { if (...
[["+", 8, 196, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 196, 0, 7, 15, 16, 12, 16, 12, 499]]
3
127
K = int(input()) A, B = map(int, input().split()) if A // K == B // K: if A % K == 0 and B % K == 0: print("OK") else: print("NG") elif A // K < B // K: print("OK") else: print("NG")
K = int(input()) A, B = map(int, input().split()) if A // K == B // K: if A % K == 0 or B % K == 0: print("OK") else: print("NG") elif A // K < B // K: print("OK") else: print("NG")
[["-", 0, 57, 64, 196, 0, 57, 15, 679, 17, 355], ["+", 0, 57, 64, 196, 0, 57, 15, 679, 17, 354]]
5
83
K = int(input()) A,B = map(int,input().split()) flag = False # if A==B: # if A % K ==0: # flag = True for i in range(A,B+1,1): print(i) if i % K == 0: flag = True if flag: print("OK") else: print("NG")
K = int(input()) A,B = map(int,input().split()) flag = False # if A==B: # if A % K ==0: # flag = True for i in range(A,B+1,1): #print(i) if i % K == 0: flag = True if flag: print("OK") else: print("NG")
[["-", 0, 7, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
75
import sys K = int(input()) A, B = map(int, input().split()) for i in range(A, B): if (i%K)==0: print('OK') sys.exit(0) print('NG')
import sys K = int(input()) A, B = map(int, input().split()) for i in range(A, B+1): if (i%K)==0: print('OK') sys.exit(0) print('NG')
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
63
k = int(input()) a, b = list(map(int, input().split())) result="NG" for i in range(a, b): if i%k == 0: result="OK" break print(result)
k = int(input()) a, b = list(map(int, input().split())) result="NG" for i in range(a, b+1): #print(i) if i%k == 0: result="OK" break print(result)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
59
K = int(input()) A, B = map(int, input().split()) for i in range(A, B+1, 1): if i%K == 0: print("YES") exit() print("NG")
K = int(input()) A, B = map(int, input().split()) for i in range(A, B+1, 1): if i%K == 0: print("OK") exit() print("NG")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
60
#include <iostream> using namespace std; int main() { int a, b, c, i = 0, k = 0; cin >> a; cin >> b >> c; i = b; while (i <= c) { if (i % a == 0) { k = 1; cout << "OK"; } i += 1; } if (k == 0) cout << "NG"; }
#include <iostream> using namespace std; int main() { int a, b, c, i = 0, k = 0; cin >> a; cin >> b >> c; i = b; while (i <= c) { if (i % a == 0) { k = 1; cout << "OK"; break; } i += 1; } if (k == 0) cout << "NG"; }
[["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 35]]
1
85
K = int(input()) A , B = map(int,input().split()) if A == B: if A % K == 0: print('OK') elif B % K == 0: print('OK') else: print('NG') else: for i in range(B-A): i += A if i % K == 0: print('OK') break else: print('...
K = int(input()) A , B = map(int,input().split()) if A == B: if A % K == 0: print('OK') elif B % K == 0: print('OK') else: print('NG') else: for i in range(B-A+1): i += A if i % K == 0: print('OK') break else: print('NG')
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
100
#include <algorithm> #include <cmath> #include <iostream> #include <math.h> #include <string> using namespace std; #define int long long signed main() { bool ans = false; int a, b, k; cin >> a >> b >> k; for (int i = a; i <= b; i++) if (i % k == 0) ans = true; if (ans) cout << "OK" << endl; ...
#include <algorithm> #include <cmath> #include <iostream> #include <math.h> #include <string> using namespace std; #define int long long signed main() { bool ans = false; int a, b, k; cin >> k >> a >> b; for (int i = a; i <= b; i++) if (i % k == 0) ans = true; if (ans) cout << "OK" << endl; ...
[["+", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 152], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
93
K = int(input()) A, B = list(map(int, input().split())) for i in range(A, B+1): if i%K == 0: print("OK") exit print("NG")
import sys K = int(input()) A, B = list(map(int, input().split())) for i in range(A, B+1): if i%K == 0: print("OK") sys.exit( ) print("NG")
[["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22], ["+", 64, 196, 0, 1, 0, 652, 63, 319, 500, 22], ["+", 64, 196, 0, 1, 0, 652, 63, 319, 0, 131], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
59
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int a, b, k; cin >> k >> a >> b; for (int i = a; i <= b; i++) { if (i % k == 0) cout << "OK"; return 0; } cout << "NG"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int a, b, k; cin >> k >> a >> b; for (int i = a; i <= b; i++) { if (i % k == 0) { cout << "OK"; return 0; } } cout << "NG"; return 0; }
[["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
83
#include <bits/stdc++.h> using namespace std; int main() { int K, A, B; cin >> K >> A >> B; for (int i = 0; K * (i - 1) <= B; i++) { if (A <= K * i) { cout << "OK" << endl; break; } else if (K * i > B) { cout << "NG" << endl; } } }
#include <bits/stdc++.h> using namespace std; int main() { int K, A, B; cin >> K >> A >> B; for (int i = 0; K * (i - 1) <= B; i++) { if (A <= K * (i - 1)) { cout << "OK" << endl; break; } else if (K * i > B) { cout << "NG" << endl; } } }
[["+", 15, 339, 51, 16, 12, 16, 12, 23, 0, 24], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 17, 33], ["+", 51, 16, 12, 16, 12, 23, 0, 16, 12, 13], ["+", 15, 339, 51, 16, 12, 16, 12, 23, 0, 25]]
1
88
K = int(input()) A, B = map(int, input().split()) d = K while d <= B: if d >= A: print("OK") exit() d += K print("No")
K = int(input()) A, B = map(int, input().split()) d = K while d <= B: if d >= A: print("OK") exit() d += K print("NG")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
55
#include <bits/stdc++.h> using namespace std; typedef long long int lli; #define MAX 1001000 #define MOD 1000000007 #define endl "\n" lli arr[MAX]; lli ans[MAX]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); lli t; cin >> t; while (t--) { lli K, A, B; cin >> K >> A >> B; for (lli i...
#include <bits/stdc++.h> using namespace std; typedef long long int lli; #define MAX 1001000 #define MOD 1000000007 #define endl "\n" lli arr[MAX]; lli ans[MAX]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); lli t; t = 1; while (t--) { lli K, A, B; cin >> K >> A >> B; for (lli i = ...
[["-", 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, 11, 17, 32], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13]]
1
123
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); int a = sc.nextInt(); int b = sc.nextInt(); boolean hantei = false; for (int i = a; i < b; i++) { if (i % k == 0) { hantei = true; ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); int a = sc.nextInt(); int b = sc.nextInt(); boolean hantei = false; for (int i = a; i <= b; i++) { if (i % k == 0) { hantei = true; ...
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
3
134
package main import ( "fmt" "log" ) func main() { //fmt.Print("Enter a grade: ") var K,i,j int // or grade := 0 _, err := fmt.Scanf("%d", &K) // or %f and change grade to float64 _, err2 := fmt.Scanf("%d", &i) // or %f and change grade to float64 _, err3 :=fmt.Scanf("%d", &j) if err != nil || err2 !=nil|| ...
package main import ( "fmt" "log" ) func main() { //fmt.Print("Enter a grade: ") var K,i,j int // or grade := 0 _, err := fmt.Scanf("%d", &K) // or %f and change grade to float64 _, err2 := fmt.Scanf("%d", &i) // or %f and change grade to float64 _, err3 :=fmt.Scanf("%d", &j) if err != nil || err2 !=nil|| ...
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["+", 0, 7, 8, 196, 0, 57, 64, 196, 0, 165]]
7
222
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b; cin >> k >> a >> b; bool x = false; for (int i = 1; i < 1000; i++) { if (k * i <= b && a <= k * 1) { cout << "OK" << endl; x = true; break; } } if (x == false) { cout << "NG" << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b; cin >> k >> a >> b; bool x = false; for (int i = 1; i < 1000; i++) { if (k * i <= b && a <= k * i) { cout << "OK" << endl; x = true; break; } } if (x == false) { cout << "NG" << endl; } }
[["-", 15, 339, 51, 16, 12, 16, 12, 16, 12, 13], ["+", 15, 339, 51, 16, 12, 16, 12, 16, 12, 22]]
1
94
#include <bits/stdc++.h> using namespace std; int main() { int K, A, B; cin >> K >> A >> B; int bai = (B / K) * K; //倍数を出力 if (bai > A) { cout << "OK" << endl; } else { cout << "NG" << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int K, A, B; cin >> K >> A >> B; int bai = (B / K) * K; //倍数を出力 if (bai >= A) { cout << "OK" << endl; } else { cout << "NG" << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
66
#include <bits/stdc++.h> using namespace std; #define MOD (1000000000 + 7) #define pb(x) push_back(x) #define mp(x, y) make_pair(x, y) #define all(x) x.begin(), x.end() #define print(vec, l, r) \ for (int i = l; i <= r; i++) ...
#include <bits/stdc++.h> using namespace std; #define MOD (1000000000 + 7) #define pb(x) push_back(x) #define mp(x, y) make_pair(x, y) #define all(x) x.begin(), x.end() #define print(vec, l, r) \ for (int i = l; i <= r; i++) ...
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
180
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define rep(i, n) for (int i = 0; i < (n); ++i) int main(void) { int K, A, B, cmp; cin >> K >> A >> B; cmp = (A / K) * K; if (cmp + K <= B || cmp == B) cout << "OK" << endl; else cout << "NG" << endl; return 0; }
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(), (x).end() #define rep(i, n) for (int i = 0; i < (n); ++i) int main(void) { int K, A, B, cmp; cin >> K >> A >> B; cmp = (A / K) * K; if (cmp + K <= B || cmp == B || cmp == A) cout << "OK" << endl; else cout << "NG" << endl; r...
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]]
1
86
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int K = scan.nextInt(); int A = scan.nextInt(); int B = scan.nextInt(); if (A % K == 0) { System.out.println("OK"); } else if ((K - A % K) + A < B) { ...
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int K = scan.nextInt(); int A = scan.nextInt(); int B = scan.nextInt(); if (A % K == 0) { System.out.println("OK"); } else if ((K - A % K) + A <= B) { ...
[["-", 0, 57, 75, 57, 15, 15, 0, 16, 17, 18], ["+", 0, 57, 75, 57, 15, 15, 0, 16, 17, 19]]
3
131
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int k, a, b; cin >> k >> a >> b; int c = k; for (int i = 1; i <= 1000; i++) { k = c * i; if (a <= k && b <= k) { cout << "OK"; exit(0); } } co...
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int k, a, b; cin >> k >> a >> b; int c = k; for (int i = 1; i <= 1000; i++) { k = c * i; if (a <= k && k <= b) { cout << "OK"; exit(0); } } co...
[["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 19], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 19], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 22]]
1
109
k = int(input()) a, b = map(int, input().split()) if b-a>b%k: print('OK') else: print('NG')
k = int(input()) a, b = map(int, input().split()) if b-a>=b%k: print('OK') else: print('NG')
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20]]
5
47
# AtCoder K = int(input()) A, B = map(int, input().split()) for i in range(A, B): if i % K == 0: print('OK') exit() print('NG')
# AtCoder K = int(input()) A, B = map(int, input().split()) for i in range(A, B+1): if i % K == 0: print('OK') exit() print('NG')
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
57
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; bool flag = false; for (int i = a; i < b + 1; i++) { if (i % c == 0) flag = true; } if (flag) cout << "OK" << endl; else cout << "NG" << endl; }
#include <iostream> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; bool flag = false; for (int i = b; i < c + 1; i++) { if (i % a == 0) flag = true; } if (flag) cout << "OK" << endl; else cout << "NG" << endl; }
[["-", 8, 9, 0, 7, 10, 43, 49, 50, 51, 22], ["+", 8, 9, 0, 7, 10, 43, 49, 50, 51, 22], ["-", 8, 9, 0, 7, 15, 16, 12, 16, 31, 22], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22]]
1
83
K = int(input()) A, B = list(map(int, input().split())) for i in range(A, B+1): if 7%K == 0: print('OK') exit() print('NG')
K = int(input()) A, B = list(map(int, input().split())) for i in range(A, B+1): if i%K == 0: print('OK') exit() print('NG')
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 31, 612], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 31, 22]]
5
61
K = int(input()) A, B = list(map(int, input().split())) flg = 1 for i in range(A, B+1): if 7%K == 0: print('OK') flg = 0 break if (flg): print('NG')
K = int(input()) A, B = list(map(int, input().split())) flg = 1 for i in range(A, B+1): if i%K == 0: print('OK') flg = 0 break if (flg): print('NG')
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 31, 612], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 31, 22]]
5
70
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b; cin >> k >> a >> b; if (a % k == 0 || b % k == 0) cout << "OK" << "\n"; else { if ((a % k) == (b % k)) cout << "NG" << "\n"; else cout << "OK" << "\n"; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b; cin >> k >> a >> b; if (a % k == 0 || b % k == 0) cout << "OK" << "\n"; else { if ((a / k) == (b / k)) cout << "NG" << "\n"; else cout << "OK" << "\n"; } return 0; }
[["-", 15, 339, 51, 16, 31, 23, 0, 16, 17, 109], ["+", 15, 339, 51, 16, 31, 23, 0, 16, 17, 85], ["-", 15, 339, 51, 16, 12, 23, 0, 16, 17, 109], ["+", 15, 339, 51, 16, 12, 23, 0, 16, 17, 85]]
1
92
#include <stdio.h> int main() { int a, b, k, n, i; scanf("%d", &k); scanf("%d %d", &a, &b); n = 0; for (i = k; i <= b; i++) { if (i % k == 0) { n = 1; break; } } if (n = 0) { puts("NG\n"); } else { puts("OK\n"); } return 0; }
#include <stdio.h> int main() { int a, b, k, n, i; scanf("%d", &k); scanf("%d %d", &a, &b); n = 0; for (i = a; i <= b; i++) { if (i % k == 0) { n = 1; break; } } if (n == 0) { puts("NG\n"); } else { puts("OK\n"); } return 0; }
[["-", 0, 14, 8, 9, 0, 7, 10, 11, 12, 22], ["+", 0, 14, 8, 9, 0, 7, 10, 11, 12, 22], ["-", 8, 9, 0, 57, 15, 23, 0, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 60]]
0
107
K = int(input()) A, B = [int(n) for n in input().split()] for n in range(A, B+1): if n % K == 0: print("OK") exit() print("NO")
K = int(input()) A, B = [int(n) for n in input().split()] for n in range(A, B+1): if n % K == 0: print("OK") exit() print("NG")
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
62
#include <iostream> using namespace std; int main(void) { int k, a, b; cin >> k >> a >> b; for (int i = a; i <= b; i++) if (i % k == 0) { cout << "Yes" << endl; return 0; } cout << "No" << endl; }
#include <iostream> using namespace std; int main(void) { int k, a, b; cin >> k >> a >> b; for (int i = a; i <= b; i++) if (i % k == 0) { cout << "OK" << endl; return 0; } cout << "NG" << endl; }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
71
#include <algorithm> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; typedef long long ll; // constexpr ll MOD = 998244353; constexpr ll MOD = 1000000007...
#include <algorithm> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <vector> using namespace std; typedef long long ll; // constexpr ll MOD = 998244353; constexpr ll MOD = 1000000007...
[["-", 51, 16, 12, 91, 28, 23, 0, 16, 17, 98], ["+", 51, 16, 12, 91, 28, 23, 0, 16, 17, 106]]
1
161
#include <iostream> #include <string> using namespace std; typedef long long int ll; int main() { int K, A, B; bool flag; cin >> K >> A >> B; flag = false; for (int i = A; i <= B; i++) { if (i % 7 == 0) flag = true; } if (flag) cout << "OK" << endl; else cout << "NG" << endl; }
#include <iostream> #include <string> using namespace std; typedef long long int ll; int main() { int K, A, B; bool flag; cin >> K >> A >> B; flag = false; for (int i = A; i <= B; i++) { if (i % K == 0) flag = true; } if (flag) cout << "OK" << endl; else cout << "NG" << endl; }
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22]]
1
91
K=int(input()) A,B=map(int,input().split()) flag=0 for i in range(A,B,1): if i % K ==0: a=1 if a==0: print("NG") else: print("OK")
K=int(input()) A,B=map(int,input().split()) a=0 for i in range(A,B+1): if i % K ==0: a=1 if a==0: print("NG") else: print("OK")
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72]]
5
68
k = int(input()) a,b = map(int,input().split()) for i in range(a,b + 1): if i % k == 0: print('OK') else: print('NG')
k = int(input()) a,b = map(int,input().split()) for i in range(a,b + 1): if i % k == 0: print('OK') break else: print('NG')
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94]]
5
57
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int main() { int k, a, b; cin >> k >> a >> b; int s; for (int i = a; i < b + 1; i++) { if (i % k == 0) { s++; } } if (s != 0) { cout << "NG" << endl; } else { cout << "OK" << endl; } }
#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; int main() { int k, a, b; cin >> k >> a >> b; int s = 0; for (int i = a; i < b + 1; i++) { if (i % k == 0) { s++; } } if (s != 0) { cout << "OK" << endl; } else { cout << "NG" << endl; } }
[["+", 0, 14, 8, 9, 0, 43, 49, 50, 0, 32], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
90
#include <algorithm> #include <iomanip> #include <iostream> #include <set> #include <string> #include <vector> #define _USE_MATH_DEFINES #include <math.h> using namespace std; int main() { int K, A, B; cin >> K >> A >> B; int mul_num1 = A / K; int mul_num2 = B / K; if (mul_num2 - mul_num1 > 0) cout <...
#include <algorithm> #include <iomanip> #include <iostream> #include <set> #include <string> #include <vector> #define _USE_MATH_DEFINES #include <math.h> using namespace std; int main() { int K, A, B; cin >> K >> A >> B; int mul_num1 = (A - 1) / K; int mul_num2 = B / K; if (mul_num2 - mul_num1 > 0) ...
[["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 24], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 17, 33], ["+", 49, 50, 51, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 43, 49, 50, 51, 16, 31, 23, 0, 25]]
1
76
#include <bits/stdc++.h> using namespace std; long long pow(long long a, long long b) { int re = 1; for (int i = 1; i <= b; i++) re += a; return re; } int main() { long long a, b, base, s; cin >> base >> a >> b; for (long long i = 1;; i++) { s = pow(base, i); if (s >= a && s <= b) { cout <...
#include <bits/stdc++.h> using namespace std; long long pow(long long a, long long b) { int re = 0; for (int i = 1; i <= b; i++) re += a; return re; } int main() { long long a, b, base, s; cin >> base >> a >> b; for (long long i = 1;; i++) { s = pow(base, i); if (s >= a && s <= b) { cout <...
[["-", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13], ["+", 0, 14, 8, 9, 0, 43, 49, 50, 51, 13]]
1
134
k = int(input()) data = input().split() a = int(data[0]) b = int(data[1]) ans = False if abs(a - b) < k: ans = True else: for i in range(a, b + 1): if i % k == 0: ans = True break print("OK" if ans else "NG")
k = int(input()) data = input().split() a = int(data[0]) b = int(data[1]) ans = False if abs(a - b) > k: ans = True else: for i in range(a, b + 1): if i % k == 0: ans = True break print("OK" if ans else "NG")
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 47]]
5
88
K = int(input()) A, B = map(int, input().split()) m = 0 for i in range(A, B+1): if i%K == 0: break m = 1 print('OK') if m == 0: print('NG')
K = int(input()) A, B = map(int, input().split()) m = 0 for i in range(A, B+1): if i%K == 0: m = 1 print('OK' if m==1 else 'NG')
[["-", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612], ["-", 36, 36, 36, 36, 0, 656, 0, 57, 0, 102], ["-", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["-", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 0, 652, 3, 4, 0, 41, 0, 666, 0, 612], ["+", ...
5
67
main = input => { i = input.split(/ |\n/).map(e => parseInt(e)); return Math.floor(i[2] / i[0]) * i[0] <= i[1] ? "OK" : "NG" }; console.log(main(require('fs').readFileSync('/dev/stdin', 'utf8')));
main = input => { i = input.split(/ |\n/).map(e => parseInt(e)); return Math.floor(i[2] / i[0]) * i[0] >= i[1] ? "OK" : "NG" }; console.log(main(require('fs').readFileSync('/dev/stdin', 'utf8')));
[["-", 8, 556, 0, 37, 0, 510, 15, 16, 17, 19], ["+", 8, 556, 0, 37, 0, 510, 15, 16, 17, 20]]
2
87
//#pragma GCC optimize("03", "unroll-loops") //#pragma GCC target("avx2") #include <bits/stdc++.h> #define fast() \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
//#pragma GCC optimize("03", "unroll-loops") //#pragma GCC target("avx2") #include <bits/stdc++.h> #define fast() \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
[["+", 0, 16, 31, 23, 0, 16, 31, 23, 0, 24], ["+", 31, 23, 0, 16, 31, 23, 0, 16, 17, 33], ["+", 31, 23, 0, 16, 31, 23, 0, 16, 12, 13], ["+", 0, 16, 31, 23, 0, 16, 31, 23, 0, 25]]
1
266
K =int(input()) A,B = map(int,input().split()) f = 0 for i in range(A,B+1): if(i%K==0): print("OK") f =1 break print(i) if(f ==0): print("NG")
K =int(input()) A,B = map(int,input().split()) f = 0 for i in range(A,B+1): if(i%K==0): print("OK") f =1 break if(f ==0): print("NG")
[["-", 0, 7, 8, 196, 0, 1, 0, 652, 63, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 22], ["-", 8, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
75
#include <bits/stdc++.h> using namespace std; int main() { int K, A, B; cin >> K >> A >> B; string result = "NG"; int tmp = K; int count = 2; while (tmp < B) { if (tmp >= A && tmp <= B) { result = "OK"; break; } tmp = count * K; count++; } cout << result << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int K, A, B; cin >> K >> A >> B; string result = "NG"; int tmp = K; int count = 2; while (tmp <= B) { if (tmp >= A && tmp <= B) { result = "OK"; break; } tmp = count * K; count++; } cout << result << endl; }
[["-", 8, 9, 0, 52, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 52, 15, 339, 51, 16, 17, 19]]
1
87
#include <iostream> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; int main() { int k, a, b; cin >> k >> a >> b; int i = 0; while (1) { int ans = k * i; if (a <= i && i <= b) { cout << "OK" << endl; break; } else if (a <= i && i > b) { cout << "NG" << endl...
#include <iostream> #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; int main() { int k, a, b; cin >> k >> a >> b; int i = 0; while (1) { int ans = k * i; if (a <= ans && ans <= b) { cout << "OK" << endl; break; } else if (a <= ans && ans > b) { cout << "NG"...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22]]
1
104
#include <iostream> using namespace std; int main() { int K, A, B; cin >> K; cin >> A >> B; int largest = (B / K) * K; // B以下のKの倍数のうち、最大となる数 if (largest > A) { cout << "OK"; } else { cout << "NG"; } }
#include <iostream> using namespace std; int main() { int K, A, B; cin >> K; cin >> A >> B; int largest = (B / K) * K; // B以下のKの倍数のうち、最大となる数 if (largest >= A) { cout << "OK"; } else { cout << "NG"; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 20]]
1
64
#include <bits/stdc++.h> using namespace std; int main() { int a, b, k; bool flag = false; cin >> k >> a >> b; for (int i = a; i <= b; i++) { if (i % k == 0) { flag = true; } } if (flag) cout << "OK"; else cout << "NO"; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, k; bool flag = false; cin >> k >> a >> b; for (int i = a; i <= b; i++) { if (i % k == 0) { flag = true; break; } } if (flag) cout << "OK"; else cout << "NG"; }
[["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 35], ["-", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 75, 76, 0, 1, 0, 16, 12, 5, 0, 6]]
1
79
#include <bits/stdc++.h> #define _USE_MATH_DEFINES #include <algorithm> #include <math.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define acc(v) accumulate(v.begin(), v.end(), 0) using namespace std; typedef long long ll; const int INF = 1e...
#include <bits/stdc++.h> #define _USE_MATH_DEFINES #include <algorithm> #include <math.h> #define rep(i, n) for (int i = 0; i < (n); ++i) #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define acc(v) accumulate(v.begin(), v.end(), 0) using namespace std; typedef long long ll; const int INF = 1e...
[["-", 0, 57, 64, 1, 0, 11, 12, 16, 31, 22], ["+", 0, 57, 64, 1, 0, 11, 12, 16, 31, 22]]
1
126
#include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define pb push_back #define mp make_pair #define ins insert #define f(i, n) for (int i = 0; i < n; i++) #define f1(i, n) for (int i = 1; i <= n; i++) #define int long long int #define fast() ...
#include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define pb push_back #define mp make_pair #define ins insert #define f(i, n) for (int i = 0; i < n; i++) #define f1(i, n) for (int i = 1; i <= n; i++) #define int long long int #define fast() ...
[["-", 15, 339, 51, 16, 31, 16, 12, 16, 31, 22], ["-", 15, 339, 51, 16, 31, 16, 12, 16, 17, 109]]
1
144
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int k, a, b; cin >> k; cin >> a >> b; if (a % k == 0 || b % k == 0) cout << "OK" << endl; else if (a / k != b / k) cout << "OK" << endl; else cout << "NO" << endl; }
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { int k, a, b; cin >> k; cin >> a >> b; if (a % k == 0 || b % k == 0) cout << "OK" << endl; else if (a / k != b / k) cout << "OK" << endl; else cout << "NG" << endl; }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
83
x = int(input()) a, b = map(int, input().split()) c = "NO" for i in range(b-a+1): if a % x == 0: c = "OK" break else: a = a+1 print(c)
x = int(input()) a, b = map(int, input().split()) c = "NG" for i in range(b-a+1): if a % x == 0: c = "OK" break else: a = a+1 print(c)
[["-", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 0, 656, 0, 1, 0, 662, 12, 557, 0, 6]]
5
65
package main import "fmt" func main() { var K, A, B int fmt.Scan(&K) fmt.Scan(&A, &B) i := 1 for { ans := K * i if ans > A && ans < B { fmt.Println("OK") break } if ans > A && ans > B { fmt.Println("NG") break } i++ } }
package main import "fmt" func main() { var K, A, B int fmt.Scan(&K) fmt.Scan(&A, &B) i := 1 for { ans := K * i if ans >= A && ans <= B { fmt.Println("OK") break } if ans >= A && ans >= B { fmt.Println("NG") break } i++ } }
[["-", 8, 196, 0, 57, 15, 16, 31, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 16, 31, 16, 17, 20], ["-", 8, 196, 0, 57, 15, 16, 12, 16, 17, 18], ["+", 8, 196, 0, 57, 15, 16, 12, 16, 17, 19], ["-", 8, 196, 0, 57, 15, 16, 12, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 16, 12, 16, 17, 20]]
7
103
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b, s = 0; cin >> k >> a >> b; for (int i = a + 1; i < b; i++) { if (i % k == 0) { s++; } } if (s != 0) cout << "OK"; else cout << "NG"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b, s = 0; cin >> k >> a >> b; for (int i = a; i <= b; i++) { if (i % k == 0) { s++; } } if (s != 0) cout << "OK"; else cout << "NG"; return 0; }
[["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
84
k = int(input()) a, b = [int(e) for e in input().split()] ans='NG' for i in range(a,b+1): if k%i == 0: ans='OK' break else: pass print(ans)
k = int(input()) a, b = [int(e) for e in input().split()] ans='NG' for i in range(a,b+1): if i%k == 0: ans='OK' break else: pass print(ans)
[["-", 8, 196, 0, 57, 15, 666, 0, 657, 31, 22], ["-", 8, 196, 0, 57, 15, 666, 0, 657, 17, 109], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 17, 109], ["+", 8, 196, 0, 57, 15, 666, 0, 657, 12, 22]]
5
65
k = int(input()) a, b = [int(e) for e in input().split()] import numpy as np ab = np.zeros((b-a)+1) ab[0] = a for i in range(b-a): ab[i+1:] +=1 if (ab % k == 0).sum() > 0: print('OK') else: print('NG')
k = int(input()) a, b = [int(e) for e in input().split()] import numpy as np ab = np.zeros((b-a)+1) ab[:] = a for i in range(b-a): ab[i+1:] +=1 if (ab % k == 0).sum() > 0: print('OK') else: print('NG')
[["-", 0, 656, 0, 1, 0, 662, 31, 206, 206, 612], ["+", 0, 1, 0, 662, 31, 206, 206, 663, 0, 102]]
5
100
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <stack> #include <stdlib.h> #include <string> #include <vector> int main() { long long a, b, k; std::cin >> k; std::cin >> a >> b; for (long long i = ...
#include <algorithm> #include <cmath> #include <cstdio> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <stack> #include <stdlib.h> #include <string> #include <vector> int main() { long long a, b, k; std::cin >> k; std::cin >> a >> b; for (long long i = ...
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 109], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 60], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
107
#include <iostream> using namespace std; int main() { int A, B, K; cin >> K; cin >> A >> B; int a = A / K; int b1 = K * a, b2 = K * (a + 1); if (b1 == A || (b2 > A && b2 < B)) cout << "OK" << endl; else cout << "NG" << endl; return 0; }
#include <iostream> using namespace std; int main() { int A, B, K; cin >> K; cin >> A >> B; int a = A / K; int b1 = K * a, b2 = K * (a + 1); if (b1 == A || (b2 > A && b2 <= B)) cout << "OK" << endl; else cout << "NG" << endl; return 0; }
[["-", 51, 16, 12, 23, 0, 16, 12, 16, 17, 18], ["+", 51, 16, 12, 23, 0, 16, 12, 16, 17, 19]]
1
89
K = int(input()) A, B = map(int, input().split()) for i in range(A, B+1): if i % K == 0: #Kで割り切れたら print("OK") else: #最後まで割り切れなかったら print("NG")
K = int(input()) A, B = map(int, input().split()) for i in range(A, B+1): if i % K == 0: #Kで割り切れたら print("OK") break else: #最後まで割り切れなかったら print("NG")
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94]]
5
59
#include <bits/stdc++.h> #define ll long long int #define mod 1000000007 #define mp(a, b) make_pair(a, b) #define pb(x) push_back(x) using namespace std; ll max(ll a, ll b) { if (a > b) { return a; } return b; } ll min(ll a, ll b) { if (a < b) { return a; } return b; } ll gcd(ll a, ll b) { if...
#include <bits/stdc++.h> #define ll long long int #define mod 1000000007 #define mp(a, b) make_pair(a, b) #define pb(x) push_back(x) using namespace std; ll max(ll a, ll b) { if (a > b) { return a; } return b; } ll min(ll a, ll b) { if (a < b) { return a; } return b; } ll gcd(ll a, ll b) { if...
[["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 72], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 12, 13], ["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
213
#include <iostream> using namespace std; int main() { int k, a, b; cin >> k; cin >> a >> b; for (int i = 0; i < 1000; i++) { if (k * i < b && k * i > a) { cout << "OK" << endl; return 0; } else if (k * i > 1000) break; } cout << "NG" << endl; return 0; }
#include <iostream> using namespace std; int main() { int k, a, b; cin >> k; cin >> a >> b; for (int i = 0; i < 1000; i++) { if (k * i <= b && k * i >= a) { cout << "OK" << endl; return 0; } else if (k * i > 1000) break; } cout << "NG" << endl; return 0; }
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 18], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 19], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 47], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 20]]
1
94
k= int(input()) s= input().rstrip().split() a = int(s[0]) b = int(s[1]) f = "NG" for i in range(a,b): if i%k == 0: f = "OK" if a == b: if a%k == 0: f = "OK" print(f)
k= int(input()) s= input().rstrip().split() a = int(s[0]) b = int(s[1]) f = "NG" for i in range(a,b+1): if i%k == 0: f = "OK" if a == b: if a%k == 0: f = "OK" print(f)
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
87
K=int(input()) A,B=map(int,input().split()) for i in range(A,B+1): if(i>=K and i%K==0): print("OK") else: print("NG")
K=int(input()) A,B=map(int,input().split()) for i in range(A, B+1): if(i>=K and i%K==0): print("OK") break else: print("NG")
[["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94]]
5
63
#include <bits/stdc++.h> using ll = long long int; using namespace std; int main() { int K, A, B; cin >> K >> A >> B; for (int i = A; i <= B; i++) { if (i % K == 0) { cout << "Yes" << endl; return 0; } } cout << "No" << endl; return 0; }
#include <bits/stdc++.h> using ll = long long int; using namespace std; int main() { int K, A, B; cin >> K >> A >> B; for (int i = A; i <= B; i++) { if (i % K == 0) { cout << "OK" << endl; return 0; } } cout << "NG" << endl; return 0; }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
82
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; int a, b; cin >> a >> b; int c = 0; for (int i = a; i <= b; i++) { if (k % i == 0) { c = 1; cout << "OK\n"; break; } } if (c == 0) { cout << "NG\n"; } }
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; int a, b; cin >> a >> b; int c = 0; for (int i = a; i <= b; i++) { if (i % k == 0) { c = 1; cout << "OK\n"; break; } } if (c == 0) { cout << "NG\n"; } }
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 109], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 109], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22]]
1
89
#include <bits/stdc++.h> using namespace std; using u64 = uint64_t; int main() { u64 K, A, B; cin >> K >> A >> B; if (A % K == 0 || B % K == 0) { cout << "OK"; } else if (A % K != B % K) { cout << "OK"; } else { cout << "NG"; } return 0; }
#include <bits/stdc++.h> using namespace std; using u64 = uint64_t; int main() { u64 K, A, B; cin >> K >> A >> B; if (A % K == 0 || B % K == 0) { cout << "OK"; } else if (A / K != B / K) { cout << "OK"; } else { cout << "NG"; } return 0; }
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 109], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 17, 85], ["-", 0, 57, 15, 339, 51, 16, 12, 16, 17, 109], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 85]]
1
85
import math k = int(input()) a,b = map(int, input().split()) if math.ceil(b/k - a/k) >= 1 : print("OK") elif a%k == 0 or b%k == 0 : print("OK") elif a<=k and k<=b: print("OK") else: print("NG")
import math k = int(input()) a,b = map(int, input().split()) if math.floor(b/k) - math.floor(a/k) >= 1 : print("OK") elif a%k == 0 or b%k == 0 : print("OK") elif a<=k and k<=b: print("OK") else: print("NG")
[["-", 0, 57, 15, 666, 0, 652, 63, 319, 319, 22], ["+", 15, 666, 0, 657, 31, 652, 63, 319, 319, 22], ["+", 15, 666, 0, 657, 31, 652, 3, 4, 0, 25], ["+", 15, 666, 0, 657, 12, 652, 63, 319, 500, 22], ["+", 15, 666, 0, 657, 12, 652, 63, 319, 0, 131], ["+", 15, 666, 0, 657, 12, 652, 63, 319, 319, 22], ["+", 15, 666, 0, 657...
5
90
#include <iostream> using namespace std; int main() { int a, b, k, flag = 0; cin >> k >> a >> b; if (b - b / k >= a) cout << "OK"; else cout << "NG"; }
#include <iostream> using namespace std; int main() { int a, b, k, flag = 0; cin >> k >> a >> b; if (b - b % k >= a) cout << "OK"; else cout << "NG"; }
[["-", 15, 339, 51, 16, 31, 16, 12, 16, 17, 85], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 17, 109]]
1
54
#include <iostream> using namespace std; int main() { int a, b, c, flag = 0; cin >> a >> b >> c; for (int i = a; i <= b; i++) { if (i % c == 0) { flag = 1; break; } } if (flag == 0) cout << "NG"; else cout << "OK"; }
#include <iostream> using namespace std; int main() { int a, b, c, flag = 0; cin >> c >> a >> b; for (int i = a; i <= b; i++) { if (i % c == 0) { flag = 1; break; } } if (flag == 0) cout << "NG"; else cout << "OK"; }
[["+", 0, 1, 0, 16, 31, 16, 31, 16, 12, 22], ["+", 8, 9, 0, 1, 0, 16, 31, 16, 17, 152], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
82
# input K = int(input()) A, B = map(int, input().split()) fly = K result = False while fly < B: if A <= fly <= B: result = True break fly += K if result is True: print("OK") else: print("NG")
# input K = int(input()) A, B = map(int, input().split()) fly = K result = False while fly <= B: if A <= fly <= B: result = True break fly += K if result is True: print("OK") else: print("NG")
[["-", 36, 36, 0, 656, 0, 52, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 52, 15, 666, 667, 19]]
5
69
#include <iostream> #include <stdio.h> #include <string.h> int main() { int k; std::cin >> k; int a, b; std::cin >> a >> b; int min = a / k; int max = b / k; if (a < max * k) { std::cout << "OK" << std::endl; } else { std::cout << "NG" << std::endl; } return 0; }
#include <iostream> #include <stdio.h> #include <string.h> int main() { int k; std::cin >> k; int a, b; std::cin >> a >> b; int min = a / k; int max = b / k; if (a <= max * k) { std::cout << "OK" << std::endl; } else { std::cout << "NG" << std::endl; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
88
#include <iostream> using namespace std; int main() { int num; cin >> num; int min; cin >> min; int max; cin >> max; if ((max - min) > num) { cout << "OK"; return 0; } for (int i = min; i <= max; i++) { if (min % num == 0) { cout << "OK"; return 0; } } cout << "...
#include <iostream> using namespace std; int main() { int num; cin >> num; int min; cin >> min; int max; cin >> max; if ((max - min) > num) { cout << "OK"; return 0; } for (int i = min; i <= max; i++) { if (i % num == 0) { cout << "OK"; return 0; } } cout << "NG...
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22]]
1
98
array = [] for i in range(2): val = input() array.append(val.split()) K = int(array[0][0]) A = int(array[1][0]) B = int(array[1][1]) compare = (B / K) * K if compare >= A: print("OK") else: print("NG")
import math array = [] for i in range(2): val = input() array.append(val.split()) K = int(array[0][0]) A = int(array[1][0]) B = int(array[1][1]) compare = math.floor(B / K) * K if compare >= A: print("OK") else: print("NG")
[["+", 36, 36, 36, 36, 0, 656, 0, 596, 0, 487], ["+", 36, 36, 0, 656, 0, 596, 141, 673, 0, 22], ["+", 0, 662, 12, 657, 31, 652, 63, 319, 500, 22], ["+", 0, 662, 12, 657, 31, 652, 63, 319, 0, 131], ["+", 0, 662, 12, 657, 31, 652, 63, 319, 319, 22]]
5
91
#include <bits/stdc++.h> using namespace std; int main() { int K, A, B; cin >> K >> A >> B; int m, n; m = A % K; n = K - m; if (A + n <= B) { cout << "OK" << endl; } else { cout << "NG" << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int K, A, B; cin >> K >> A >> B; int m, n; m = A % K; n = K - m; if (A + n <= B || m == 0) { cout << "OK" << endl; } else { cout << "NG" << endl; } }
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 106], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 17, 60], ["+", 0, 57, 15, 339, 51, 16, 12, 16, 12, 13]]
1
73
// #include <bits/stdc++.h> #include <algorithm> #include <cmath> #include <iomanip> #include <ios> #include <iostream> #include <map> #include <numeric> #include <queue> #include <stack> // #include <windows.h> using namespace std; template <class T> using V = vector<T>; template <class T> using VV = V<V<T>>; template...
// #include <bits/stdc++.h> #include <algorithm> #include <cmath> #include <iomanip> #include <ios> #include <iostream> #include <map> #include <numeric> #include <queue> #include <stack> // #include <windows.h> using namespace std; template <class T> using V = vector<T>; template <class T> using VV = V<V<T>>; template...
[["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
764
#include <iostream> using namespace std; int main() { int N, a, b; cin >> N; cin >> a >> b; for (int i = a; i <= b; i++) { if (i % N == 0) { cout << "OK" << endl; break; } if (i == b) cout << "NO" << endl; } return 0; }
#include <iostream> using namespace std; int main() { int N, a, b; cin >> N; cin >> a >> b; for (int i = a; i <= b; i++) { if (i % N == 0) { cout << "OK" << endl; break; } if (i == b) cout << "NG" << endl; } return 0; }
[["-", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 64, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
82
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner scn = new Scanner(System.in); int k = scn.nextInt(); int a = scn.nextInt(); int b = scn.nextInt(); for (; a < b; a++) { if (a % k == 0) { System.out.printf("OK\n"); retu...
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner scn = new Scanner(System.in); int k = scn.nextInt(); int a = scn.nextInt(); int b = scn.nextInt(); for (; a <= b; a++) { if (a % k == 0) { System.out.printf("OK\n"); ret...
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19]]
3
112
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) const long long MOD = 1e9 + 7, MAX = 1e18, larg = 1e5, INF = -1e9; long long A, B, C, D, E, F, G, H, I, J, K, L, N, M, O, P, Q, R, S, T, U, V, W; typedef long long ll; typedef pair<ll, ll> Pa; int main() { cin >> N >> ...
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) const long long MOD = 1e9 + 7, MAX = 1e18, larg = 1e5, INF = -1e9; long long A, B, C, D, E, F, G, H, I, J, K, L, N, M, O, P, Q, R, S, T, U, V, W; typedef long long ll; typedef pair<ll, ll> Pa; int main() { cin >> N >> ...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
153
k=int(input()) a,b=map(int, input().split()) for i in (a, b+1): if i%k==0: print("OK") exit() print("NG")
k=int(input()) a,b=map(int, input().split()) for i in range(a, b+1): if i%k==0: print("OK") exit() print("NG")
[["+", 36, 36, 0, 656, 0, 7, 12, 652, 63, 22]]
5
57
#include <bits/stdc++.h> using namespace std; int main() { int K, A, B; cin >> K >> A >> B; int check = (B / K) * K; if (A < check) { cout << "OK" << endl; } else { cout << "NG" << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int K, A, B; cin >> K >> A >> B; int check = (B / K) * K; if (A <= check) { cout << "OK" << endl; } else { cout << "NG" << endl; } return 0; }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 17, 18], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 19]]
1
68
k=int(input()) a,b=map(int,input().split()) count=0 for i in range(a,b): if i%k==0: count=count+1 else: count=count if count>0: print('OK') else: print('NG')
k=int(input()) a,b=map(int,input().split()) count=0 for i in range(a,b+1): if i%k==0: count=count+1 else: count=count if count>0: print('OK') else: print('NG')
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
73