Skip to content

Commit 6c2111f

Browse files
committed
AtCoder Beginner Contest 208
1 parent 8421ddd commit 6c2111f

File tree

2 files changed

+666
-0
lines changed

2 files changed

+666
-0
lines changed

AtCoder Beginner Contest 208/a.java

Lines changed: 322 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,322 @@
1+
import java.text.DecimalFormat;
2+
import java.util.stream.LongStream;
3+
import java.util.stream.IntStream;
4+
import java.io.*;
5+
import java.util.*;
6+
7+
public class Main {
8+
9+
public static void main(String[] args) {
10+
FastScanner sc = new FastScanner();
11+
PrintWriter out = new PrintWriter(System.out);
12+
// int t = sc.nextInt();
13+
// while(t-->0){
14+
Naveen problem = new Naveen(sc);
15+
problem.solve(out);
16+
// }
17+
out.flush();
18+
}
19+
20+
}
21+
22+
class Naveen {
23+
24+
int a,b;
25+
//int[] arr;
26+
27+
28+
Naveen(FastScanner sc) {
29+
30+
a = sc.nextInt();
31+
b= sc.nextInt();
32+
// arr = sc.arrayInt(n);
33+
}
34+
35+
void solve(PrintWriter out) {
36+
37+
My.ans((6*a)>=b && b>=a);
38+
39+
}
40+
41+
42+
}
43+
44+
class FastScanner {
45+
46+
private final InputStream in = System.in;
47+
private final byte[] buffer = new byte[1024];
48+
private int ptr = 0;
49+
private int buflen = 0;
50+
51+
private boolean hasNextByte() {
52+
if (ptr < buflen) {
53+
return true;
54+
} else {
55+
ptr = 0;
56+
try {
57+
buflen = in.read(buffer);
58+
} catch (IOException e) {
59+
e.printStackTrace();
60+
}
61+
if (buflen <= 0) {
62+
return false;
63+
}
64+
}
65+
return true;
66+
}
67+
68+
private int readByte() {
69+
if (hasNextByte()) {
70+
return buffer[ptr++];
71+
} else {
72+
return -1;
73+
}
74+
}
75+
76+
private static boolean isPrintableChar(int c) {
77+
return 33 <= c && c <= 126;
78+
}
79+
80+
public boolean hasNext() {
81+
while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
82+
ptr++;
83+
}
84+
return hasNextByte();
85+
}
86+
87+
public String next() {
88+
if (!hasNext()) {
89+
throw new NoSuchElementException();
90+
}
91+
StringBuilder sb = new StringBuilder();
92+
int b = readByte();
93+
while (isPrintableChar(b)) {
94+
sb.appendCodePoint(b);
95+
b = readByte();
96+
}
97+
return sb.toString();
98+
}
99+
100+
public long nextLong() {
101+
if (!hasNext()) {
102+
throw new NoSuchElementException();
103+
}
104+
long n = 0;
105+
boolean minus = false;
106+
int b = readByte();
107+
if (b == '-') {
108+
minus = true;
109+
b = readByte();
110+
}
111+
if (b < '0' || '9' < b) {
112+
throw new NumberFormatException();
113+
}
114+
while (true) {
115+
if ('0' <= b && b <= '9') {
116+
n *= 10;
117+
n += b - '0';
118+
} else if (b == -1 || !isPrintableChar(b)) {
119+
return minus ? -n : n;
120+
} else {
121+
throw new NumberFormatException();
122+
}
123+
b = readByte();
124+
}
125+
}
126+
127+
public int nextInt() {
128+
long nl = nextLong();
129+
if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {
130+
throw new NumberFormatException();
131+
}
132+
return (int) nl;
133+
}
134+
135+
public double nextDouble() {
136+
return Double.parseDouble(next());
137+
}
138+
139+
public int[] arrayInt(int N) {
140+
int[] array = new int[N];
141+
for (int i = 0; i < N; i++) {
142+
array[i] = nextInt();
143+
}
144+
return array;
145+
}
146+
147+
public long[] arrayLong(int N) {
148+
long[] array = new long[N];
149+
for (int i = 0; i < N; i++) {
150+
array[i] = nextLong();
151+
}
152+
return array;
153+
}
154+
155+
public double[] arrayDouble(int N) {
156+
double[] array = new double[N];
157+
for (int i = 0; i < N; i++) {
158+
array[i] = nextDouble();
159+
}
160+
return array;
161+
}
162+
163+
public String[] arrayString(int N) {
164+
String[] array = new String[N];
165+
for (int i = 0; i < N; i++) {
166+
array[i] = next();
167+
}
168+
return array;
169+
}
170+
171+
public int randomInt() {
172+
Random r = new Random();
173+
int value = r.nextInt((int) 1e6);
174+
System.out.println(value);
175+
return value;
176+
}
177+
178+
public int[] randomInt(int N) {
179+
int[] array = new int[N];
180+
Random r = new Random();
181+
for (int i = 0; i < N; i++) {
182+
array[i] = r.nextInt((int) 1e6);
183+
}
184+
System.out.println(Arrays.toString(array));
185+
return array;
186+
}
187+
188+
}
189+
190+
class My {
191+
192+
public static long lower(long arr[],long key){
193+
int low = 0;
194+
int high = arr.length-1;
195+
while(low < high){
196+
int mid = low + (high - low)/2;
197+
if(arr[mid] >= key){
198+
high = mid;
199+
}
200+
else{
201+
low = mid+1;
202+
}
203+
}
204+
return low;
205+
}
206+
public static int upper(int arr[],int key){
207+
int low = 0;
208+
int high = arr.length-1;
209+
while(low < high){
210+
int mid = low + (high - low+1)/2;
211+
if(arr[mid] <= key){
212+
low = mid;
213+
}
214+
else{
215+
high = mid-1;
216+
}
217+
}
218+
return low;
219+
}
220+
static void ans(boolean b) {
221+
System.out.println(b ? "Yes" : "No");
222+
}
223+
224+
static void ANS(boolean b) {
225+
System.out.println(b ? "YES" : "NO");
226+
}
227+
228+
static String sort(String s) {
229+
char[] ch = s.toCharArray();
230+
Arrays.sort(ch);
231+
return String.valueOf(ch);
232+
}
233+
234+
static String reverse(String s) {
235+
return new StringBuilder(s).reverse().toString();
236+
}
237+
238+
static int[] reverse(int[] array) {
239+
for (int i = 0; i < array.length / 2; i++) {
240+
int temp = array[i];
241+
array[i] = array[array.length - 1 - i];
242+
array[array.length - 1 - i] = temp;
243+
}
244+
return array;
245+
}
246+
247+
static long[] reverse(long[] array) {
248+
for (int i = 0; i < array.length / 2; i++) {
249+
long temp = array[i];
250+
array[i] = array[array.length - 1 - i];
251+
array[array.length - 1 - i] = temp;
252+
}
253+
return array;
254+
}
255+
256+
static double[] reverse(double[] array) {
257+
for (int i = 0; i < array.length / 2; i++) {
258+
double temp = array[i];
259+
array[i] = array[array.length - 1 - i];
260+
array[array.length - 1 - i] = temp;
261+
}
262+
return array;
263+
}
264+
265+
static String[] reverse(String[] array) {
266+
for (int i = 0; i < array.length / 2; i++) {
267+
String temp = array[i];
268+
array[i] = array[array.length - 1 - i];
269+
array[array.length - 1 - i] = temp;
270+
}
271+
return array;
272+
}
273+
274+
static char[] reverse(char[] array) {
275+
for (int i = 0; i < array.length / 2; i++) {
276+
char temp = array[i];
277+
array[i] = array[array.length - 1 - i];
278+
array[array.length - 1 - i] = temp;
279+
}
280+
return array;
281+
}
282+
283+
static long min(long... numbers) {
284+
Arrays.sort(numbers);
285+
return numbers[0];
286+
}
287+
288+
static int min(int... numbers) {
289+
Arrays.sort(numbers);
290+
return numbers[0];
291+
}
292+
293+
static double min(double... numbers) {
294+
Arrays.sort(numbers);
295+
return numbers[0];
296+
}
297+
298+
static long max(long... numbers) {
299+
Arrays.sort(numbers);
300+
return numbers[numbers.length - 1];
301+
}
302+
303+
static int max(int... numbers) {
304+
Arrays.sort(numbers);
305+
return numbers[numbers.length - 1];
306+
}
307+
308+
static double max(double... numbers) {
309+
Arrays.sort(numbers);
310+
return numbers[numbers.length - 1];
311+
}
312+
313+
static int sum(long number) {
314+
int sum = 0;
315+
while (number > 0) {
316+
sum += number % 10;
317+
number /= 10;
318+
}
319+
return sum;
320+
}
321+
322+
}

0 commit comments

Comments
 (0)