We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0cbecc8 + 5f8e39e commit 981699aCopy full SHA for 981699a
khj20006/202507/20 BOJ G4 젓가락으로 메추리알 집기.md
@@ -0,0 +1,23 @@
1
+```java
2
+import java.util.*;
3
+import java.io.*;
4
+
5
+public class Main {
6
+ static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
7
+ static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
8
9
+ public static void main(String[] args) throws Exception {
10
+ StringTokenizer st = new StringTokenizer(br.readLine());
11
+ int N = Integer.parseInt(st.nextToken());
12
+ int M = Integer.parseInt(st.nextToken());
13
14
+ for(int i=1;i<=N;i++) for(int j=(i%2==1 ? 2 : 1);j<=M;j+=2) {
15
+ bw.write("? " + i + " " + j + "\n");
16
+ bw.flush();
17
+ if(br.readLine().equals("1")) return;
18
+ }
19
20
21
22
+}
23
+```
0 commit comments