-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdiff_Main.cpp
More file actions
41 lines (37 loc) · 1.21 KB
/
Copy pathdiff_Main.cpp
File metadata and controls
41 lines (37 loc) · 1.21 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
diff --git a/CodeJam/Main.cpp b/examples/2022/Qualification/A/Main.cpp
index 2150379..0aea8b3 100644
--- a/CodeJam/Main.cpp
+++ b/examples/2022/Qualification/A/Main.cpp
@@ -5,7 +5,7 @@
#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
-#define COMM_TYPE ll
+#define COMM_TYPE str
// The maintained and empty code template can be found at:
// https://github.com/demmerichs/CodeJamTemplate
@@ -1570,11 +1570,27 @@ void init(){
cin >> T;
}
+d(p(bool, bool), char) draw = {{{false, false}, '.'}, {{false, true}, '|'}, {{true, false}, '-'}, {{true, true}, '+'}};
+ll R, C;
+
void readInput(){
+ cin >> R >> C;
}
// write to COMM_TYPE result
void calcFunction() {
+ sstr out;
+ out << endl;
+ forn(r, R*2+1){
+ forn(c, C*2+1){
+ bool horiline = r%2 == 0 && (r>1 || c>1);
+ bool vertline = c%2 == 0 && (r>1 || c>1);
+ out << draw[mp(horiline, vertline)];
+ }
+ out << endl;
+ }
+ result = out.str();
+ result = result.substr(0, result.sz-1);
}
} // namespace task