buggy_code
stringlengths
11
625k
fixed_code
stringlengths
17
625k
bug_type
stringlengths
2
4.45k
language
int64
0
8
token_count
int64
5
200k
#include <bits/stdc++.h> //#include <iostream> using namespace std; int main(void) { int A, B, K; cin >> K; cin >> A >> B; int flag = 0; int i; for (i = A; i <= B; i++) { if (i % K == 0) { flag = 1; break; } } if (flag == 1) { cout << "OK" << endl; } else { cout << "NO" ...
#include <bits/stdc++.h> //#include <iostream> using namespace std; int main(void) { int A, B, K; cin >> K; cin >> A >> B; int flag = 0; int i; for (i = A; i <= B; i++) { if (i % K == 0) { flag = 1; break; } } if (flag == 1) { cout << "OK" << endl; } else { cout << "NG" ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
100
#include <iostream> #include <set> #include <string> using namespace std; int main() { int K, A, B; cin >> K >> A >> B; int C = A / K + 1; if (B >= C || A % K == 0) { cout << "OK"; } else { cout << "NG"; } return 0; }
#include <iostream> #include <set> #include <string> using namespace std; int main() { int K, A, B; cin >> K >> A >> B; int C = A / K + 1; if (B >= C * K || A % K == 0) { cout << "OK"; } else { cout << "NG"; } return 0; }
[["+", 15, 339, 51, 16, 31, 16, 12, 16, 17, 48], ["+", 15, 339, 51, 16, 31, 16, 12, 16, 12, 22]]
1
72
// Created by Kira #include <bits/stdc++.h> using namespace std; #define IOS \ cin.sync_with_stdio(0); \ cin.tie(0); \ cout.tie...
// Created by Kira #include <bits/stdc++.h> using namespace std; #define IOS \ cin.sync_with_stdio(0); \ cin.tie(0); \ cout.tie...
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
179
#include <iostream> using namespace std; int main() { int K, A, B; int ON = 100; cin >> K; cin >> A >> B; for (int i = 0; i < B - A; i++) { if ((A + i) % K == 0) { ON = 10; break; } } if (ON == 10) cout << "OK" << endl; if (ON == 100) cout << "NG" << endl; return 0; }
#include <iostream> using namespace std; int main() { int K, A, B; int ON = 100; cin >> K; cin >> A >> B; for (int i = 0; i < B - A + 1; i++) { if ((A + i) % K == 0) { ON = 10; break; } } if (ON == 10) cout << "OK" << endl; if (ON == 100) cout << "NG" << endl; return 0;...
[["+", 8, 9, 0, 7, 15, 16, 12, 16, 17, 72], ["+", 8, 9, 0, 7, 15, 16, 12, 16, 12, 13]]
1
103
K = int(input()) A,B = map(int,input().split()) ans = 0 for i in range(A,B): if i % K == 0: ans += 1 if ans > 0: print('OK') else: print('NG')
K = int(input()) A,B = map(int,input().split()) ans = 0 for i in range(A,B+1): if i % K == 0: ans += 1 if ans > 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
66
N=int(input()) a, b = map(int, input().split()) def golf(N,a,b): for i in range(a,b+1): if i%N==0: return "OK" else: return "NG" print(golf(N,a,b))
N=int(input()) a, b = map(int, input().split()) def golf(N,a,b): for i in range(a,b+1): if i%N==0: return "OK" return "NG" print(golf(N,a,b))
[["-", 0, 7, 8, 196, 0, 57, 75, 76, 0, 95], ["-", 0, 7, 8, 196, 0, 57, 75, 76, 0, 102]]
5
74
#include "bits/stdc++.h" #include <set> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--) #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i < (n); i++) #define rrep(i, n) for (int i = (n)-1; i >= 0; i--)...
#include "bits/stdc++.h" #include <set> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--) #define rep(i, n) for (int i = 0; i < (n); i++) #define rep1(i, n) for (int i = 1; i < (n); i++) #define rrep(i, n) for (int i = (n)-1; i >= 0; i--)...
[["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
206
package main import ( "fmt" "math" ) func scanNums(len int) []int { var num int var nums []int for i:=0; i <len; i++ { fmt.Scan(&num) nums = append(nums, num) } return nums } func checker(n int, nums []int) string { v := float64(nums[1]) / float64(n) i := int(math.Floor(v)) if nums[0] <= i*n && i*n <=...
package main import ( "fmt" "math" ) func scanNums(len int) []int { var num int var nums []int for i:=0; i <len; i++ { fmt.Scan(&num) nums = append(nums, num) } return nums } func checker(n int, nums []int) string { v := float64(nums[1]) / float64(n) i := int(math.Floor(v)) if nums[0] <= i*n && i*n <=...
[["-", 8, 196, 0, 57, 15, 16, 12, 16, 17, 47], ["+", 8, 196, 0, 57, 15, 16, 12, 16, 17, 20]]
7
189
K = int(input()) A, B = map(int, input().split()) if (B // K) * B >= A: print('OK') else: print('NG')
K = int(input()) A, B = map(int, input().split()) if B // K * K >= A: print('OK') else: print('NG')
[["-", 0, 57, 15, 666, 0, 657, 31, 23, 0, 24], ["-", 0, 57, 15, 666, 0, 657, 31, 23, 0, 25], ["-", 0, 656, 0, 57, 15, 666, 0, 657, 12, 22], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 12, 22]]
5
49
K = int(input()) A, B = map(int, input().split()) if (B // K) * B >= A: print('OK') else: print('NG')
K = int(input()) A, B = map(int, input().split()) if (B // K) * K >= A: print('OK') else: print('NG')
[["-", 0, 656, 0, 57, 15, 666, 0, 657, 12, 22], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 12, 22]]
5
49
K = int(input()) A, B = map(int, input().split()) count = 0 for i in range(1001): if((A < (K*i)) & ((K*i) < B)): count = 1 if(count == 0): print("NG") if(count == 1): print("OK")
K = int(input()) A, B = map(int, input().split()) count = 0 for i in range(1001): if((A <= (K*i)) & ((K*i) <= B)): count = 1 if(count == 0): print("NG") if(count == 1): print("OK")
[["-", 15, 23, 0, 657, 31, 23, 0, 666, 667, 18], ["+", 15, 23, 0, 657, 31, 23, 0, 666, 667, 19], ["-", 15, 23, 0, 657, 12, 23, 0, 666, 667, 18], ["+", 15, 23, 0, 657, 12, 23, 0, 666, 667, 19]]
5
87
import java.util.*; 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(); if (a % k == 0 || b % k == 0) { System.out.println("OK"); } else { System.out.println(b / k - a...
import java.util.*; 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(); if (a % k == 0 || b % k == 0) { System.out.println("OK"); } else { System.out.println(b / k - a...
[["-", 0, 492, 3, 4, 0, 510, 75, 5, 0, 491], ["+", 0, 492, 3, 4, 0, 510, 75, 5, 0, 491]]
3
117
k=int(input()) s=input().split() a=int(s[0]) b=int(s[1]) for i in range(a,b+1): if i%k==0: print("OK") print("NG")
k=int(input()) s=input().split() a=int(s[0]) b=int(s[1]) for i in range(a,b+1): if i%k==0: print("OK") exit() print("NG")
[["+", 0, 57, 64, 196, 0, 1, 0, 652, 63, 22], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 24], ["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 25]]
5
66
K = int(input()) a, b = map(int, input().split()) if a < b // K * K: print('OK') else: print('NG')
K = int(input()) a, b = map(int, input().split()) if a <= b // K * K: print('OK') else: print('NG')
[["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 18], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19]]
5
47
#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>; const int mod = 1000000007; const ll INF = 1001001001; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class...
#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>; const int mod = 1000000007; const ll INF = 1001001001; template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <class...
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
197
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b; scanf("%d%d%d", &k, &a, &b); if (b / k - (a - 1) / k == 0) printf("No"); else printf("Yes"); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b; scanf("%d%d%d", &k, &a, &b); if (b / k - (a - 1) / k == 0) printf("NG"); else printf("OK"); return 0; }
[["-", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 64, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
1
69
k = int(input()) a,b = list(map(int, input().split())) if (a//k < b//k) or (k==1) or not(a%k or b%k): print("OK") else: print("NG")
k = int(input()) a,b = list(map(int, input().split())) if (a//k < b//k) or (k==1) or (not(a%k) or not(b%k)): print("OK") else: print("NG")
[["+", 0, 656, 0, 57, 15, 679, 12, 23, 0, 24], ["+", 12, 23, 0, 679, 31, 681, 28, 23, 0, 25], ["+", 15, 679, 12, 23, 0, 679, 12, 681, 0, 372], ["+", 12, 23, 0, 679, 12, 681, 28, 23, 0, 24], ["+", 12, 23, 0, 679, 12, 681, 28, 23, 0, 25]]
5
69
#include <bits/stdc++.h> using namespace std; int main() { int k; int a; int b; 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" << endl; } else { cout << "NO" << endl; } return 0;...
#include <bits/stdc++.h> using namespace std; int main() { int k; int a; int b; 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" << endl; } else { 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
94
#include <stdio.h> int main() { int k = 0, a = 0, b = 0, count = 0, i; scanf("%d", &k); scanf("%d%d", &a, &b); for (i = a; i <= b; i++) { if (i % k == 0) { printf("OK"); count += 1; break; } } if (count = 0) printf("NG"); return 0; }
#include <stdio.h> int main() { int k = 0, a = 0, b = 0, count = 0, i; scanf("%d", &k); scanf("%d%d", &a, &b); for (i = a; i <= b; i++) { if (i % k == 0) { printf("OK"); count += 1; break; } } if (count == 0) printf("NG"); return 0; }
[["-", 8, 9, 0, 57, 15, 23, 0, 11, 17, 32], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 60]]
0
104
k = int(input()) a, b = map(int, input().split()) i = k flag = False while i < b: if k == 1: flag= True break dis = i * k if dis >= a and dis <= b: flag = True break i += 1 if flag: print("OK") else: print("NG")
k = int(input()) a, b = map(int, input().split()) i = 1 flag = False while i < b: if k == 1: flag = True break dis = i * k if dis >= a and dis <= b: flag = True break i += 1 if flag: print("OK") else: print("NG")
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 22], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612]]
5
82
def main(): import sys input = sys.stdin.readline K = int(input()) A, B = map(int, input().split()) x = A//K y = B//K for i in range(A, B): if i % K == 0: print('OK') exit() if A == B and A % K == 0: print('OK') exit() print('NG') ...
def main(): import sys input = sys.stdin.readline K = int(input()) A, B = map(int, input().split()) x = A//K y = B//K for i in range(A, B+1): if i % K == 0: print('OK') exit() if A == B and A % 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
110
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; int a, b; cin >> a >> b; int count = 0; for (int i = a; i <= b; i++) { if (i % k == 0) { count++; break; } } if (count == 0) { cout << "OK" << endl; } else { cout << "NG" << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int k; cin >> k; int a, b; cin >> a >> b; int count = 0; for (int i = a; i <= b; i++) { if (i % k == 0) { count++; break; } } if (count == 1) { cout << "OK" << endl; } else { cout << "NG" << endl; } }
[["-", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13], ["+", 8, 9, 0, 57, 15, 339, 51, 16, 12, 13]]
1
93
k = int(input()) a, b = map(int, input().split()) ans = 0 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')
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 31, 22], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 0, 32], ["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 8, 196, 0, 57, 64, 196, 0, 93, 0, 94]]
5
60
#1 import sys K=int(input()) A,B=map(int, input().split()) if A==B: if A%K==0: print("OK") sys.exit() else: for i in range(A,B): if i%K==0: print("OK") sys.exit() print("NG")
#1 import sys K=int(input()) A,B=map(int, input().split()) if A==B: if A%K==0: print("OK") sys.exit() else: for i in range(A,B+1): if i%K==0: print("OK") sys.exit() print("NG")
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
86
<?php $hope = trim(fgets(STDIN)); $capacity = explode(" ", trim(fgets(STDIN))); for($i=$capacity[0]; $i<=$capacity[1]; $i++){ if($i%$hope == 0){ echo "OK"; }else{ echo "NG"; } }
<?php $hope = trim(fgets(STDIN)); $capacity = explode(" ", trim(fgets(STDIN))); for($i=$capacity[0]; $i<=$capacity[1]; $i++){ if($i%$hope == 0){ echo "OK"; return; } } echo "NG";
[["+", 0, 9, 0, 57, 8, 9, 0, 37, 0, 38], ["+", 0, 9, 0, 57, 8, 9, 0, 37, 0, 35], ["-", 0, 7, 0, 9, 0, 57, 75, 76, 0, 95], ["-", 0, 9, 0, 57, 75, 76, 8, 9, 0, 45], ["+", 36, 36, 0, 493, 0, 7, 0, 9, 0, 46], ["-", 0, 9, 0, 57, 75, 76, 8, 9, 0, 46], ["-", 36, 36, 0, 493, 0, 7, 0, 9, 0, 46]]
6
81
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(); int num = 0; for (int i = A; i < B; i++) { if (i % K == 0) { num += 1; } ...
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(); int num = 0; for (int i = A; i <= B; i++) { if (i % K == 0) { num += 1; } ...
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 17, 18], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 17, 19], ["-", 8, 196, 0, 57, 15, 15, 0, 16, 17, 106], ["-", 0, 57, 15, 15, 0, 16, 12, 16, 31, 22], ["-", 0, 57, 15, 15, 0, 16, 12, 16, 17, 60], ["-", 0, 57, 15, 15, 0, 16, 12, 16, 12, 499]]
3
140
K = int(input()) A, B = map(int,input().split()) count = 0 for i in range(A,B): if i%K == 0: count += 1 else: count += 0 if count >= 1: print("OK") elif count == 0: print("NO")
K = int(input()) A, B = map(int,input().split()) count = 0 for i in range(A,B+1): if i%K == 0: count += 1 else: count += 0 if count >= 1: print("OK") elif count == 0: print("NG")
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
74
# coding: utf-8 # Your code here! K = int(input()) A, B = map(int, input().split()) for i in range(A, B + 1): if i % K == 0: print('OK') exit() else: print('NO')
# coding: utf-8 # Your code here! K = int(input()) A, B = map(int, input().split()) for i in range(A, B + 1): if i % K == 0: print('OK') exit() else: print('NG')
[["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
62
k = int(input()) data = input().split() a = int(data[0]) b = int(data[1]) largest = b //k * k if largest >= a: print("OK") else: print("NO")
k = int(input()) data = input().split() a = int(data[0]) b = int(data[1]) largest = b //k * k if largest >= a: 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
61
#include <stdio.h> int main() { int A, B, K; scanf("%d", &K); scanf("%d", &A); scanf("%d", &B); for (; A <= B; A++) { if (A % K == 0) { printf("OK"); return 0; } } printf("NO"); return 0; }
#include <stdio.h> int main() { int A, B, K; scanf("%d", &K); scanf("%d", &A); scanf("%d", &B); for (; A <= B; A++) { if (A % K == 0) { printf("OK"); return 0; } } printf("NG"); return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
87
#include <iostream> #include <string> using namespace std; int main() { int k, a, b; string d; cin >> k; cin >> a >> b; d == "NG"; while (a <= b) { if (a % k == 0) { cout << "OK" << endl; d = "OK"; break; } a = a + 1; } if (d == "NG") { cout << "NG" << endl; } }
#include <iostream> #include <string> using namespace std; int main() { int k, a, b; string d; cin >> k; cin >> a >> b; d = "NG"; while (a <= b) { if (a % k == 0) { cout << "OK" << endl; d = "OK"; break; } a = a + 1; } if (d == "NG") { cout << "NG" << endl; } }
[["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 60], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32]]
1
98
#include <stdio.h> int main(void) { int k, a, b; int largest; scanf("%d", &k); scanf("%d%d", &a, &b); largest = (b / k) * k; if (largest > a) { printf("OK"); } else { printf("NG"); } return 0; }
#include <stdio.h> int main(void) { int k, a, b; int largest; scanf("%d", &k); scanf("%d%d", &a, &b); largest = (b / k) * k; if (largest >= a) { printf("OK"); } else { printf("NG"); } return 0; }
[["-", 8, 9, 0, 57, 15, 23, 0, 16, 17, 47], ["+", 8, 9, 0, 57, 15, 23, 0, 16, 17, 20]]
0
80
#include <iostream> using namespace std; int main() { int k, a, b, flag; cin >> k >> a >> b; for (int i = a; i <= b; i++) { if (i % k == 0) { flag = 1; break; } } if (flag) cout << "OK" << endl; else cout << "NO" << endl; return 0; }
#include <iostream> using namespace std; int main() { int k, a, b, flag; flag = 0; cin >> k >> a >> b; for (int i = a; i <= b; i++) { if (i % k == 0) { flag = 1; break; } } if (flag) cout << "OK" << endl; else cout << "NG" << endl; return 0; }
[["+", 0, 14, 8, 9, 0, 1, 0, 11, 31, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 17, 32], ["+", 0, 14, 8, 9, 0, 1, 0, 11, 12, 13], ["+", 0, 30, 0, 14, 8, 9, 0, 1, 0, 35], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
85
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() print("No")
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")
[["+", 64, 196, 0, 1, 0, 652, 3, 4, 0, 612], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6]]
5
62
k = int(input()) a,b = map(int,input().split()) if (a//k)*k<=b: print('OK') else: print('NG')
k = int(input()) a,b = map(int,input().split()) if (b//k)*k>=a: print('OK') else: print('NG')
[["-", 15, 666, 0, 657, 31, 23, 0, 657, 31, 22], ["+", 15, 666, 0, 657, 31, 23, 0, 657, 31, 22], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 667, 19], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 667, 20], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 22]]
5
49
#include <algorithm> #include <bitset> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdint.h> #include <string> #include <vector> using namespace std; #define PI (3.14159265358979323846) #define INF (2147483647) #define INF_LL (9223372036854775807) ...
#include <algorithm> #include <bitset> #include <iomanip> #include <iostream> #include <map> #include <math.h> #include <queue> #include <set> #include <stdint.h> #include <string> #include <vector> using namespace std; #define PI (3.14159265358979323846) #define INF (2147483647) #define INF_LL (9223372036854775807) ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
184
#include <bits/stdc++.h> using namespace std; int k, a, b; bool flag = false; int main() { cin >> k; cin >> a >> b; for (int i = b - a; i <= b; i++) { if (i % k == 0) { flag = true; } } if (flag) { printf("OK"); } else { printf("NG"); } return 0; }
#include <bits/stdc++.h> using namespace std; int k, a, b; bool flag = false; int main() { cin >> k; cin >> a >> b; for (int i = a; i <= b; i++) { if (i % k == 0) { flag = true; } } if (flag) { printf("OK"); } else { printf("NG"); } return 0; }
[["-", 0, 7, 10, 43, 49, 50, 51, 16, 31, 22], ["-", 0, 7, 10, 43, 49, 50, 51, 16, 17, 33]]
1
92
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b; scanf("%d%d%d", &k, &a, &b); if ((b + 1) / k == (a - 1) / k) puts("NG"); else puts("OK"); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b; scanf("%d%d%d", &k, &a, &b); if (b / k == (a - 1) / k) puts("NG"); else puts("OK"); return 0; }
[["-", 15, 339, 51, 16, 31, 16, 31, 23, 0, 24], ["-", 51, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["-", 51, 16, 31, 16, 31, 23, 0, 16, 12, 13], ["-", 15, 339, 51, 16, 31, 16, 31, 23, 0, 25]]
1
71
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b; cin >> k >> a >> b; int flag = 0; for (int i = a; i < b + 1; i++) { if (k % i == 0) { flag += 1; } } if (flag > 0) { 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 flag = 0; for (int i = a; i < b + 1; i++) { if (i % k == 0) { flag += 1; } } if (flag > 0) { cout << "OK" << endl; } else { cout << "NG" << endl; } }
[["-", 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
91
def solve(): k=int(input()) a,b=map(int,input().split()) ans='NG' for i in range(a,b+1): if(k%i==0): ans="OK" break print(ans) solve()
def solve(): k=int(input()) a,b=map(int,input().split()) ans='NG' for i in range(a,b+1): if(i%k==0): ans="OK" break print(ans) solve()
[["-", 0, 57, 15, 23, 0, 666, 0, 657, 31, 22], ["-", 0, 57, 15, 23, 0, 666, 0, 657, 17, 109], ["+", 0, 57, 15, 23, 0, 666, 0, 657, 17, 109], ["+", 0, 57, 15, 23, 0, 666, 0, 657, 12, 22]]
5
68
k = int(input()) a, b = map(int, input().split()) flag = False for i in range(a, b): if (i%k==0): flag = True if flag : print('OK') else: print('NG')
k = int(input()) a, b = map(int, input().split()) flag = False for i in range(a, b+1): if (i%k==0): flag = True if flag : 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
66
k = input() a,b = map(int,input().split()) han = False for i in range(a,b,1): if i%k == 0: han = True if han == True: print("OK") else: print("NG")
k = int(input()) a,b = map(int,input().split()) han = False for i in range(a,b+1): if i%k == 0: han = True if han == True: print("OK") else: print("NG")
[["+", 0, 656, 0, 1, 0, 662, 12, 652, 63, 22], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 24], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25], ["-", 0, 656, 0, 7, 12, 652, 3, 4, 0, 21], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72]]
5
65
#include <stdio.h> int main() { int k, a, b, x = 0; scanf("%d %d %d", &k, &a, &b); while (x <= b) { if (a <= x) { puts("OK"); return 0; } x += a; } puts("NG"); return 0; }
#include <stdio.h> int main() { int k, a, b, x = 0; scanf("%d %d %d", &k, &a, &b); while (x <= b) { if (a <= x) { puts("OK"); return 0; } x += k; } puts("NG"); return 0; }
[["-", 0, 52, 8, 9, 0, 1, 0, 11, 12, 22], ["+", 0, 52, 8, 9, 0, 1, 0, 11, 12, 22]]
1
75
#include <bits/stdc++.h> using namespace std; #define int long long int #define ld long double #define mod 1000000007 #define endl "\n" #define pb push_back #define mp make_pair #define ff first #define ss second #define MAXX 1000000000000000000 int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ...
#include <bits/stdc++.h> using namespace std; #define int long long int #define ld long double #define mod 1000000007 #define endl "\n" #define pb push_back #define mp make_pair #define ff first #define ss second #define MAXX 1000000000000000000 int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); ...
[["-", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["-", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 12, 22]]
1
101
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iostream> #include <iterator> #include <limits> #include <map> #include <memory> #include <numeric> #includ...
#define _CRT_SECURE_NO_WARNINGS #include <algorithm> #include <bitset> #include <cassert> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <functional> #include <iostream> #include <iterator> #include <limits> #include <map> #include <memory> #include <numeric> #includ...
[["-", 49, 50, 51, 23, 0, 16, 31, 16, 12, 22], ["+", 49, 50, 51, 23, 0, 16, 31, 16, 12, 22], ["-", 49, 50, 51, 23, 0, 16, 12, 16, 31, 22], ["+", 49, 50, 51, 23, 0, 16, 12, 16, 31, 22]]
1
2,041
#include <bits/stdc++.h> 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; } }
#include <bits/stdc++.h> 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; }
[["+", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46], ["-", 0, 14, 8, 9, 0, 7, 8, 9, 0, 46]]
1
72
k = int(input()) a,b = map(int, input().split()) i = 1 while(1): i=i+1 if i*k >= a and i*k <= b: print("OK") break elif i*k > b: print("NG") break
k = int(input()) a,b = map(int, input().split()) i = 0 while(1): i=i+1 if i*k >= a and i*k <= b: print("OK") break elif i*k > b: print("NG") break
[["-", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612], ["+", 36, 36, 0, 656, 0, 1, 0, 662, 12, 612]]
5
71
import sys input = sys.stdin.readline def main(): K = int(input()) A, B = map(int, input().split()) for i in range(A, B): if i % K == 0: print("OK") exit() print("NG") if __name__ == '__main__': main()
import sys input = sys.stdin.readline def main(): 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") if __name__ == '__main__': main()
[["+", 0, 7, 12, 652, 3, 4, 0, 657, 17, 72], ["+", 0, 7, 12, 652, 3, 4, 0, 657, 12, 612]]
5
80
K=input() A, B=input().split() f="NG" for i in range(int(A),int(B)): c=i%int(K) if c==0: f="OK" print(f)
K=input() A, B=input().split() f="NG" for i in range(int(A),int(B)+1): c=i%int(K) if c==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
59
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define FIO \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define FIO \ ios_base::sync_with_stdio(false); \ cin.tie(NULL); ...
[["+", 8, 9, 0, 1, 0, 16, 31, 16, 12, 22], ["+", 0, 14, 8, 9, 0, 1, 0, 16, 17, 152]]
1
711
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define rp(i, n) for (int i = 1; i <= (int)n; i++) int main() { int k, a, b; int s = 0; cin >> k >> a >> b; for (int i = a; i <= b; i++) { if (i % k == 0) s = 1; } if (s == 1) ...
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define rp(i, n) for (int i = 1; i <= (int)n; i++) int main() { int k, a, b; int s = 0; cin >> k >> a >> b; for (int i = a; i <= b; i++) { if (i % k == 0) s = 1; } if (s == 1) ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
104
K, A, B = gets.split.map(&:to_i) count = 0 A.upto B do |num| if num % K == 0 count = 1 break end end if count == 1 print "OK" else print "NG" end
K = gets.to_i A, B = gets.split.map(&:to_i) count = 0 A.upto B do |num| if num % K == 0 count = 1 break end end if count == 1 print "OK" else print "NG" end
[["-", 36, 36, 0, 493, 0, 662, 31, 761, 0, 21], ["+", 36, 36, 36, 36, 0, 493, 0, 662, 0, 32], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 486, 22], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 17, 131], ["+", 36, 36, 0, 493, 0, 662, 12, 652, 735, 22]]
4
52
#define _USE_MATH_DEFINES #include <algorithm> #include <cmath> #include <cstdio> #include <ctgmath> #include <fstream> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef long dou...
#define _USE_MATH_DEFINES #include <algorithm> #include <cmath> #include <cstdio> #include <ctgmath> #include <fstream> #include <iostream> #include <list> #include <map> #include <queue> #include <set> #include <string> #include <utility> #include <vector> using namespace std; typedef long long ll; typedef long dou...
[["+", 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
650
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b; cin >> k >> a >> b; for (int i = a; i <= b; i++) { if (k % i == 0) { cout << "OK"; return 0; } } cout << "NG"; return 0; }
#include <bits/stdc++.h> 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"; return 0; } } cout << "NG"; return 0; }
[["-", 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
71
from sys import stdin K = int(stdin.readline().rstrip()) [A, B] = [int(x) for x in input().rstrip().split()] flag=0 K_temp=K while(True): if(K_temp>B): break if(K_temp>=A and K_temp<=B): flag=2 break else: K_temp+=K if flag==1: print("OK") else: print("NG")
from sys import stdin K = int(stdin.readline().rstrip()) [A, B] = [int(x) for x in input().rstrip().split()] flag=0 K_temp=K while(True): if(K_temp>B): break if(K_temp>=A and K_temp<=B): flag=1 break else: K_temp+=K if flag==1: print("OK") else: print("NG")
[["-", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612], ["+", 0, 57, 64, 196, 0, 1, 0, 662, 12, 612]]
5
102
k=int(input()) a,b=map(int,input().split()) largest=(b//a)*a if a<=largest: print('OK') else: print("NG")
k=int(input()) a,b=map(int,input().split()) largest=(b//k)*k if a<=largest: print('OK') else: print("NG")
[["-", 0, 662, 12, 657, 31, 23, 0, 657, 12, 22], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 12, 22], ["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22]]
5
52
K = input() A, B = map(int, input().split()) result = False for i in range(A, B + 1): if (i % K) == 0: result = True print("OK" if result else "NG")
K = int(input()) A, B = map(int, input().split()) result = False for i in range(A, B + 1): if (i % K) == 0: result = True print("OK" if result else "NG")
[["+", 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
60
from math import sqrt,ceil,floor def mi():return map(int,input().split()) def li():return list(mi()) def ii():return int(input()) k=ii() a,b=mi() a1=ceil(a/k)*a if(a1<=b): print("OK") else: print("NG")
from math import sqrt,ceil,floor def mi():return map(int,input().split()) def li():return list(mi()) def ii():return int(input()) k=ii() a,b=mi() a1=ceil(a/k)*k if(a1<=b): print("OK") else: print("NG")
[["-", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22], ["+", 0, 656, 0, 1, 0, 662, 12, 657, 12, 22]]
5
93
#include <bits/stdc++.h> using namespace std; int main() { int K, A, B; cin >> K >> A >> B; int count = 0; for (int i = 0; i < 1000; i++) { if (A <= K * i <= B) { count++; } } if (count > 0) { 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 count = 0; for (int i = 0; i < 1000; i++) { if (A <= K * i && K * i <= B) { count++; } } if (count > 0) { cout << "OK" << endl; } else { cout << "NG" << endl; } }
[["+", 8, 9, 0, 57, 15, 339, 51, 16, 17, 98], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 31, 22], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 17, 48], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 12, 22]]
1
90
#include <iostream> using namespace std; int a, b, k; int main() { cin >> k >> a >> b; if (b / k - a / k > 0) cout << "OK"; else cout << "NG"; }
#include <iostream> using namespace std; int a, b, k; int main() { cin >> k >> a >> b; if (b / k - (a - 1) / k > 0) cout << "OK"; else cout << "NG"; }
[["+", 51, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 33], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 51, 16, 31, 16, 12, 16, 31, 23, 0, 25]]
1
52
k=int(input()) x,y = map(int, input().split()) for i in range(y-x): if (x+i)%k==0: print("OK") exit() print("NG")
k=int(input()) x,y = map(int, input().split()) for i in range(y-x+1): if (x+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
60
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b; cin >> k >> a >> b; bool d = 0; for (int i = a; i <= b; i++) { if (i % k == 0) { d += 1; } } if (d == 1) { cout << "OK" << endl; } else cout << "NO" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b; cin >> k >> a >> b; bool d = 0; for (int i = a; i <= b; i++) { if (i % k == 0) { d += 1; break; } } if (d == 1) { cout << "OK" << endl; } else cout << "NG" << endl; }
[["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 94], ["+", 8, 9, 0, 57, 64, 9, 0, 93, 0, 35], ["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
87
#include <bits/stdc++.h> using namespace std; #define int long long #define all(x) (x).begin(), (x).end() #define fi first #define se second #define pb push_back #define pii pair<long long, long long> #define endl '\n' #define N 300001 int mod = 1000000007; int dx[] = {1, -1, 0, 0}; int dy[] = {0, 0, 1, -1}; vector<int...
#include <bits/stdc++.h> using namespace std; #define int long long #define all(x) (x).begin(), (x).end() #define fi first #define se second #define pb push_back #define pii pair<long long, long long> #define endl '\n' #define N 300001 int mod = 1000000007; int dx[] = {1, -1, 0, 0}; int dy[] = {0, 0, 1, -1}; vector<int...
[["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
467
#include <bits/stdc++.h> using namespace std; int main() { int K, A, B; cin >> K >> A >> B; string C = "NG"; for (int i = A; i <= B; i++) { if (A % K == 0) { C = "OK"; } } cout << C << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int K, A, B; cin >> K >> A >> B; string C = "NG"; for (int i = A; i <= B; i++) { if (i % K == 0) { C = "OK"; } } cout << C << endl; }
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22]]
1
72
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b, i; cin >> k >> a >> b; bool flag = false; for (i = a; i <= b; i++) { if (i % 7 == 0) { flag = true; } } if (flag == true) { cout << "OK"; } else { cout << "NG"; } }
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b, i; cin >> k >> a >> b; bool flag = false; for (i = a; i <= b; i++) { if (i % k == 0) { flag = true; } } if (flag == true) { cout << "OK"; } else { cout << "NG"; } }
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 12, 13], ["+", 0, 57, 15, 339, 51, 16, 31, 16, 12, 22]]
1
86
#!/usr/bin/env python3 k = int(input()) a, b = list(map(int, input().split())) if (b//k)*k >= a: print("Yes") else: print("No")
#!/usr/bin/env python3 k = int(input()) a, b = list(map(int, input().split())) if (b//k)*k >= a: 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
53
k = int(input()) a, b = map(int, input().split()) p = a % k q = k - p if (p == 0) or ((a + p) <= b): print('OK') else: print('NG')
k = int(input()) a, b = map(int, input().split()) p = a % k q = k - p if (p == 0) or ((a + q) <= b): print('OK') else: print('NG')
[["-", 12, 23, 0, 666, 0, 23, 0, 657, 12, 22], ["+", 12, 23, 0, 666, 0, 23, 0, 657, 12, 22]]
5
65
#include <ctype.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define STR 100 int main() { int k, a, b; scanf("%d %d %d", &k, &a, &b); for (int i = a; i < b + 1; i++) { if (i % k == 0) { printf("OK"); return 0; } } printf("No"); return 0; }
#include <ctype.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define STR 100 int main() { int k, a, b; scanf("%d %d %d", &k, &a, &b); for (int i = a; i < b + 1; i++) { if (i % k == 0) { printf("OK"); return 0; } } printf("NG"); return 0; }
[["-", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6], ["+", 0, 1, 0, 2, 3, 4, 0, 5, 0, 6]]
0
90
#include <cstdio> using namespace std; int dis, ud, dd; int main() { scanf("%d%d%d", &dis, &dd, &ud); (dis <= (ud - dd + dd % dis)) ? printf("%s\n", "OK") : printf("%s\n", "NG"); return 0; }
#include <cstdio> using namespace std; int dis, ud, dd; int main() { scanf("%d%d%d", &dis, &dd, &ud); (dis <= (ud - dd + 1 + (dd - 1) % dis)) ? printf("%s\n", "OK") : printf("%s\n", "NG"); return 0; }
[["+", 0, 16, 12, 23, 0, 16, 31, 16, 12, 13], ["+", 15, 23, 0, 16, 12, 23, 0, 16, 17, 72], ["+", 12, 23, 0, 16, 12, 16, 31, 23, 0, 24], ["+", 0, 16, 12, 16, 31, 23, 0, 16, 17, 33], ["+", 0, 16, 12, 16, 31, 23, 0, 16, 12, 13], ["+", 12, 23, 0, 16, 12, 16, 31, 23, 0, 25]]
1
76
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <n...
#include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <n...
[["-", 15, 339, 51, 16, 31, 16, 31, 23, 0, 24], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 85], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 12, 22], ["+", 51, 16, 31, 16, 12, 16, 31, 23, 0, 24], ["-", 51, 16, 31, 16, 31, 23, 0, 16, 17, 72], ["+", 31, 16, 12, 16, 31, 23, 0, 16, 17, 33]]
1
333
/* Auther:_Destiny time:2020.5.3 */ #include <bits/stdc++.h> #define ll long long #define N 100010 #define M 1010 using namespace std; int k, l, r; int read() { int s = 0, f = 0; char ch = getchar(); while (!isdigit(ch)) f |= (ch == '-'), ch = getchar(); while (isdigit(ch)) s = s * 10...
/* Auther:_Destiny time:2020.5.3 */ #include <bits/stdc++.h> #define ll long long #define N 100010 #define M 1010 using namespace std; int k, l, r; int read() { int s = 0, f = 0; char ch = getchar(); while (!isdigit(ch)) f |= (ch == '-'), ch = getchar(); while (isdigit(ch)) s = s * 10...
[["-", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 8, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
167
k=int(input()) suzi_list=input().split() a=int(suzi_list[0]) b=int(suzi_list[1]) c=(b/k)*k if a<=c: print('ok') else: print('ng')
k=int(input()) suzi_list=input().split() a=int(suzi_list[0]) b=int(suzi_list[1]) c=(b//k)*k if a<=c: print('OK\n') else: print('NG\n')
[["-", 0, 662, 12, 657, 31, 23, 0, 657, 17, 85], ["+", 0, 662, 12, 657, 31, 23, 0, 657, 17, 676], ["-", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 1, 0, 652, 3, 4, 0, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 557, 0, 6, 0, 44]]
5
63
k = int(input()) a, b = map(int, input()) if k == 1 or (a // k == a / k): print('OK') else: n = a // k m = b // k if m - n >= 1: print('OK') else: print('NG')
k = int(input()) a, b = map(int, input().split()) if k == 1 or (a // k == a / k): print('OK') else: n = a // k m = b // k if m - n >= 1: print('OK') else: print('NG')
[["+", 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], ["+", 0, 1, 0, 662, 12, 652, 3, 4, 0, 25]]
5
74
#include <algorithm> #include <bits/stdc++.h> #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"; return 0; } if (a / k == b / k) { cout << "NG"; return 0; } cout << "OK"; return 0;...
#include <algorithm> #include <bits/stdc++.h> #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"; return 0; } if (a / k == b / k) { cout << "NG"; return 0; } cout << "OK"; return 0;...
[["-", 15, 339, 51, 16, 31, 16, 31, 16, 17, 85], ["+", 15, 339, 51, 16, 31, 16, 31, 16, 17, 109], ["-", 15, 339, 51, 16, 12, 16, 31, 16, 17, 85], ["+", 15, 339, 51, 16, 12, 16, 31, 16, 17, 109]]
1
90
import sys input=sys.stdin.readline k=int(input().rstrip()) a,b=map(int,input().split()) for i in range(a,b+1): if i%k==0: print("OK") exit() print("NO")
import sys input=sys.stdin.readline k=int(input().rstrip()) a,b=map(int,input().split()) for i in range(a,b+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
71
#include <bits/stdc++.h> #define PI 3.141592653 #define rep(i, a, n) for (int i = a; i < (int)n; ++i) #define SZ(x) ((int)(x).size()) // size() unsigned -> int #define descSort(a) sort(a.begin(), a.end(), std::greater<int>()) using namespace std; typedef long long ll; const ll INF = 1e9 + 7; ll gcd(ll x, ll y) { if...
#include <bits/stdc++.h> #define PI 3.141592653 #define rep(i, a, n) for (int i = a; i < (int)n; ++i) #define SZ(x) ((int)(x).size()) // size() unsigned -> int #define descSort(a) sort(a.begin(), a.end(), std::greater<int>()) using namespace std; typedef long long ll; const ll INF = 1e9 + 7; ll gcd(ll x, ll y) { if...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
154
K = int(input()) A,B = map(int, input().split()) C = K count = 1 ans = "NG" while (C<B): #print("test") if(A<=C and C<=B): ans ="OK" C = K*count count += 1 #print(C) print(ans)
K = int(input()) A,B = map(int, input().split()) C = K count = 1 ans = "NG" while (C<=B): #print("test") if(A<=C and C<=B): ans ="OK" C = K*count count += 1 #print(C) print(ans)
[["-", 0, 656, 0, 52, 15, 23, 0, 666, 667, 18], ["+", 0, 656, 0, 52, 15, 23, 0, 666, 667, 19]]
5
72
import java.util.*; 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(); scan.close(); int flag = 0; for (int i = a; a <= b; i++) { if (i % k == 0) { flag =...
import java.util.*; 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(); scan.close(); int flag = 0; for (int i = a; i <= b; i++) { if (i % k == 0) { flag =...
[["-", 0, 195, 8, 196, 0, 7, 15, 16, 31, 22], ["+", 0, 195, 8, 196, 0, 7, 15, 16, 31, 22]]
3
138
#include <bits/stdc++.h> using namespace std; int main() { int K, A, B, i; cin >> K >> A >> B; bool ans = false; for (i = A; i < B + 1; i++) { if (i % K == 0) ans = true; } if (ans) cout << "OK" << endl; else cout << "NO" << endl; }
#include <bits/stdc++.h> using namespace std; int main() { int K, A, B, i; cin >> K >> A >> B; bool ans = false; for (i = A; i < B + 1; i++) { if (i % K == 0) ans = true; } if (ans) 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
84
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { int k, a, b; cin >> k >> a >> b; if (b - b % k >= a) { cout << "YES\n"; } else cout << "NG\n"; return 0; }
#include <bits/stdc++.h> using namespace std; typedef long long int ll; int main() { int k, a, b; cin >> k >> a >> b; if (b - b % k >= a) { cout << "OK\n"; } else cout << "NG\n"; return 0; }
[["-", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6], ["+", 64, 9, 0, 1, 0, 16, 12, 5, 0, 6]]
1
63
#include <iostream> using namespace std; int main() { short k, a, b; cin >> k >> a >> b; if (a <= ((a + k - 1) / k) * k <= b) cout << "OK"; else cout << "NG"; }
#include <iostream> using namespace std; int main() { short k, a, b; cin >> k >> a >> b; if (((a + k - 1) / k) * k <= b) cout << "OK"; else cout << "NG"; }
[["-", 0, 57, 15, 339, 51, 16, 31, 16, 31, 22], ["-", 0, 57, 15, 339, 51, 16, 31, 16, 17, 19]]
1
60
k = gets.strip.to_i a, b = gets.strip.split.map(&:to_i) if a % k == 0 then puts 'OK' exit end if b % k == 0 then puts 'OK' exit end if b / k - a / k then puts 'OK' exit end puts 'NG'
k = gets.strip.to_i a, b = gets.strip.split.map(&:to_i) if a % k == 0 then puts 'OK' exit end if b % k == 0 then puts 'OK' exit end if b / k - a / k > 0 then puts 'OK' exit end puts 'NG'
[["+", 36, 36, 0, 493, 0, 121, 15, 738, 17, 47], ["+", 36, 36, 0, 493, 0, 121, 15, 738, 12, 612]]
4
67
#include <iostream> int main() { int k, a, b; std::cin >> k >> a >> b; int kk = k; while (kk <= b) { if (a <= kk) { std::cout << "Yes" << std::endl; return 0; } kk += k; } std::cout << "No" << std::endl; return 0; }
#include <iostream> int main() { int k, a, b; std::cin >> k >> a >> b; int kk = k; while (kk <= b) { if (a <= kk) { std::cout << "OK" << std::endl; return 0; } kk += k; } std::cout << "NG" << std::endl; return 0; }
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
80
#include <algorithm> #include <iostream> #include <limits.h> #include <math.h> #include <queue> #include <string.h> #include <string> #include <vector> using namespace std; int main() { int K, A, B; cin >> K >> A >> B; for (int i = A; i <= B; i++) { if (K % i == 0) { cout << "OK"; return 0; }...
#include <algorithm> #include <iostream> #include <limits.h> #include <math.h> #include <queue> #include <string.h> #include <string> #include <vector> 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"; return 0; }...
[["-", 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
82
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep2(i, l, r) for (int i = (l); i < (r); i++) #define ALL(x) (x).begin(), (x).end() //昇順 #define RALL(x) (x).rbegin(), (x).rend() // 降順 const long long mod = 1e9 + 7; typedef long long ll; typedef priority_queue<int> ...
#include "bits/stdc++.h" using namespace std; #define rep(i, n) for (int i = 0; i < n; i++) #define rep2(i, l, r) for (int i = (l); i < (r); i++) #define ALL(x) (x).begin(), (x).end() //昇順 #define RALL(x) (x).rbegin(), (x).rend() // 降順 const long long mod = 1e9 + 7; typedef long long ll; typedef priority_queue<int> ...
[["-", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6], ["+", 0, 1, 0, 16, 31, 16, 12, 5, 0, 6]]
1
433
k = int(input()) a,b = input().split() a,b = int(a), int(b) ans='NG' for i in range(a,b+1): if i%k==0: ans='YES' print(ans)
k = int(input()) a,b = input().split() a,b = int(a), int(b) ans='NG' for i in range(a,b+1): if i%k==0: ans='OK' print(ans)
[["-", 64, 196, 0, 1, 0, 662, 12, 557, 0, 6], ["+", 64, 196, 0, 1, 0, 662, 12, 557, 0, 6]]
5
65
#include <bits/stdc++.h> using namespace std; int k, a, b, c; int main() { cin >> k >> a >> b; for (int i = 0;; i++) { c = k * i; if (a < c && b > c) { cout << "OK"; return 0; } else { if (a > c) continue; if (b < c) { cout << "NG"; return 0; } }...
#include <bits/stdc++.h> using namespace std; int k, a, b, c; int main() { cin >> k >> a >> b; for (int i = 0;; i++) { c = k * i; if (a <= c && b >= c) { cout << "OK"; return 0; } else { if (a > c) continue; if (b < c) { cout << "NG"; 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
100
A #input K = int(input()) A, B = map(int, input().split()) #output answer = "NG" for i in range(A, B+1): if i % K == 0: answer = "OK" else: continue print(answer)
#input K = int(input()) A, B = map(int, input().split()) #output answer = "NG" for i in range(A, B+1): if i % K == 0: answer = "OK" else: continue print(answer)
[["-", 36, 36, 36, 36, 0, 656, 0, 1, 0, 22]]
5
63
#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"; return 0; } } cout << "NG"; return 0; }
#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"; return 0; } } cout << "NG"; return 0; }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
72
k=int(input()) a,b=map(int,input().split()) print('ONKG'[a//k==b//k and a%k::2])
k=int(input()) a,b=map(int,input().split()) print('NOGK'[a//k<b//k or a%k<1::2])
[["-", 0, 652, 3, 4, 0, 206, 51, 557, 0, 6], ["+", 0, 652, 3, 4, 0, 206, 51, 557, 0, 6], ["-", 0, 206, 206, 663, 0, 679, 31, 666, 667, 60], ["+", 0, 206, 206, 663, 0, 679, 31, 666, 667, 18], ["-", 3, 4, 0, 206, 206, 663, 0, 679, 17, 355], ["+", 3, 4, 0, 206, 206, 663, 0, 679, 17, 354], ["+", 0, 206, 206, 663, 0, 679, 1...
5
46
#include <bits/stdc++.h> using namespace std; int main() { int A, B; int K; int judge = 0; cin >> K; cin >> A >> B; for (int i = A; i < B; i++) { if (i % K == 0) judge++; } if (judge > 0) { cout << "OK" << endl; } else { cout << "NG" << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int A, B; int K; int judge = 0; cin >> K; cin >> A >> B; for (int i = A; i <= B; i++) { if (i % K == 0) judge++; } if (judge > 0) { cout << "OK" << endl; } else { cout << "NG" << endl; } }
[["-", 0, 14, 8, 9, 0, 7, 15, 16, 17, 18], ["+", 0, 14, 8, 9, 0, 7, 15, 16, 17, 19]]
1
89
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b, flag = 0; cin >> k >> a >> b; for (int i = a; i <= b; i++) if (i % k == 0) { flag = 0; break; } if (flag) cout << "OK"; else cout << "NG"; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b, flag = 0; cin >> k >> a >> b; for (int i = a; i <= b; i++) if (i % k == 0) { flag = 1; break; } if (flag) cout << "OK"; else cout << "NG"; return 0; }
[["-", 8, 57, 64, 9, 0, 1, 0, 11, 12, 13], ["+", 8, 57, 64, 9, 0, 1, 0, 11, 12, 13]]
1
81
#include <bits/stdc++.h> using namespace std; #define E "\n" #define int long long #define f(i, l, n) for (int i = l; i < n; i++) int32_t main() { int k, a, b; cin >> k >> a >> b; if (a % k == 0 || b % k == 0 || ((b - a) / k) > 0) cout << "OK"; else cout << "NG"; }
#include <bits/stdc++.h> using namespace std; #define E "\n" #define int long long #define f(i, l, n) for (int i = l; i < n; i++) int32_t main() { int k, a, b; cin >> k >> a >> b; if (a % k == 0 || b % k == 0 || (b / k - a / k) > 0) cout << "OK"; else cout << "NG"; }
[["-", 12, 16, 31, 23, 0, 16, 31, 23, 0, 24], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 17, 85], ["+", 12, 16, 31, 23, 0, 16, 31, 16, 12, 22], ["-", 12, 16, 31, 23, 0, 16, 31, 23, 0, 25]]
1
82
#!/usr/bin/env python # -*- coding: utf-8 -*- def main(): K = int(input()) A, B = map(int, input().split()) print("OK" if B // K * K else "NG") if __name__ == "__main__": main()
#!/usr/bin/env python # -*- coding: utf-8 -*- def main(): K = int(input()) A, B = map(int, input().split()) print("OK" if (B // K) * K >= A else "NG") if __name__ == "__main__": main()
[["+", 0, 41, 0, 666, 0, 657, 31, 23, 0, 24], ["+", 0, 41, 0, 666, 0, 657, 31, 23, 0, 25], ["+", 0, 652, 3, 4, 0, 41, 0, 666, 667, 20], ["+", 0, 652, 3, 4, 0, 41, 0, 666, 0, 22]]
5
57
k=input() a,b=input().split() c=int(a) d=int(b) l=int(k) e=d-d%l if e>=c: print('ok') else: print('ng')
k=input() a,b=input().split() c=int(a) d=int(b) l=int(k) e=d-d%l if e>=c: 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
60
K=int(input()) A,B=map(int,input().split()) m=A//K*K if m<A: m+=K if m>=A and m<=B: print("OK") else: print("NO")
K=int(input()) A,B=map(int,input().split()) m=A//K*K if m<A: m+=K if m>=A and m<=B: 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
62
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b; bool ans = false; cin >> k >> a >> b; for (int i = a; i <= b; i++) { if (k % i == 0) ans = true; } cout << (ans ? "OK" : "NG") << endl; return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int k, a, b; bool ans = false; cin >> k >> a >> b; for (int i = a; i <= b; i++) { if (i % k == 0) ans = true; } cout << (ans ? "OK" : "NG") << endl; return 0; }
[["-", 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
79
K = int(input()) A,B = map(int,input().split()) C = "NG" if K == 1: C = "OK" else: if A//K != B//K: C = "OK" print(C)
K = int(input()) A,B = map(int,input().split()) C = "NG" if A%K == 0: C = "OK" else: if A//K != B//K: C = "OK" print(C)
[["+", 0, 656, 0, 57, 15, 666, 0, 657, 31, 22], ["+", 0, 656, 0, 57, 15, 666, 0, 657, 17, 109], ["-", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612], ["+", 36, 36, 0, 656, 0, 57, 15, 666, 0, 612]]
5
59
k = int(input()) a, b = map(int, input().split()) print('OK' if b//k >= a//k else 'NG')
k = int(input()) a, b = map(int, input().split()) print('OK' if b//k*k >= a else 'NG')
[["+", 3, 4, 0, 41, 0, 666, 0, 657, 17, 48], ["+", 3, 4, 0, 41, 0, 666, 0, 657, 12, 22], ["-", 3, 4, 0, 41, 0, 666, 0, 657, 17, 676], ["-", 3, 4, 0, 41, 0, 666, 0, 657, 12, 22]]
5
42
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, e, i; cin >> a >> b >> c; if (b > c) swap(b, c); for (i = b; i <= c; i++) { if (i % a == 0) cout << "OK"; return 0; } cout << "NG"; }
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c, e, i; cin >> a >> b >> c; if (b > c) swap(b, c); for (i = b; i <= c; i++) { if (i % a == 0) { cout << "OK"; return 0; } } cout << "NG"; }
[["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 45], ["+", 0, 7, 8, 9, 0, 57, 64, 9, 0, 46]]
1
82