-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdiff_Main.cpp
More file actions
47 lines (45 loc) · 1.38 KB
/
Copy pathdiff_Main.cpp
File metadata and controls
47 lines (45 loc) · 1.38 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
diff --git a/CodeJam/Main.cpp b/examples/2022/Round1B/C/Main.cpp
index 2150379..6dd3340 100644
--- a/CodeJam/Main.cpp
+++ b/examples/2022/Round1B/C/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
@@ -1573,8 +1573,33 @@ void init(){
void readInput(){
}
+v(str) Pk(ll k){
+ if(k==0){
+ v(str) ans;
+ ans.pb("1");
+ return ans;
+ }
+ v(str) Pkm1 = Pk(k-1);
+ v(str) dbl;
+ foreach(pk, Pkm1)
+ dbl.pb(pk+pk);
+ v(str) ans = dbl;
+ foreach(pk, Pkm1){
+ ans.pb(pk + str("00000000").substr(0, pk.sz));
+ ans.insert(ans.ed, all(dbl));
+ }
+ return ans;
+}
+
// write to COMM_TYPE result
void calcFunction() {
+ v(str) p3 = Pk(3);
+ foreach(p, p3){
+ out(p);
+ ll ans = in();
+ if(ans==0)
+ break;
+ }
}
} // namespace task