-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdiff_Main.cpp
More file actions
50 lines (45 loc) · 1.41 KB
/
Copy pathdiff_Main.cpp
File metadata and controls
50 lines (45 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
diff --git a/CodeJam/Main.cpp b/examples/2021/Round2/A_interactive/Main.cpp
index 2150379..346df75 100644
--- a/CodeJam/Main.cpp
+++ b/examples/2021/Round2/A_interactive/Main.cpp
@@ -1,7 +1,7 @@
// #define DEFAULT_VAL_MODE //remove comment on this line, to activate default value trigger
#define DEFAULT_VAL_TRIGGER result.sz == 0
#define DEFAULT_VAL "IMPOSSIBLE"
-// #define IA_MODE //remove comment on this line, to activate interactive problem mode
+#define IA_MODE //remove comment on this line, to activate interactive problem mode
#define IA_ERROR_CODE -1
#define IA_COMM_LOG //add comment on this line, to deactivate the interactive communication error log
// #define XY_NOTATION //remove commment on this line, to activate xy notation on complex numbers
@@ -1566,8 +1566,10 @@ using namespace std;
namespace task {
+ll N;
+
void init(){
- cin >> T;
+ cin >> T >> N;
}
void readInput(){
@@ -1575,6 +1577,24 @@ void readInput(){
// write to COMM_TYPE result
void calcFunction() {
+ forn(i, N-1){
+ v(str) q;
+ q.pb("M");
+ q.pb(to_string(i+1));
+ q.pb(to_string(N));
+ out(q);
+ ll pos = in();
+ if(pos!=i+1){
+ q.cl;
+ q.pb("S");
+ q.pb(to_string(i+1));
+ q.pb(to_string(pos));
+ out(q);
+ in();
+ }
+ }
+ out("D");
+ in();
}
} // namespace task