-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdiff_Main.cpp
More file actions
36 lines (33 loc) · 725 Bytes
/
Copy pathdiff_Main.cpp
File metadata and controls
36 lines (33 loc) · 725 Bytes
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
diff --git a/CodeJam/Main.cpp b/examples/2022/Round1B/A/Main.cpp
index 2150379..bef56fa 100644
--- a/CodeJam/Main.cpp
+++ b/examples/2022/Round1B/A/Main.cpp
@@ -1570,11 +1570,31 @@ void init(){
cin >> T;
}
+ll N;
+dq(ll) Di;
+
void readInput(){
+ cin >> N;
+ Di.resize(N);
+ forn(i, N)
+ cin >> Di[i];
}
// write to COMM_TYPE result
void calcFunction() {
+ result = 0;
+ ll dmin = 0;
+ while(Di.sz){
+ if(Di.ft < Di.bk){
+ result += Di.ft >= dmin;
+ dmin = max(Di.ft, dmin);
+ Di.popf;
+ } else {
+ result += Di.bk >= dmin;
+ dmin = max(Di.bk, dmin);
+ Di.popb;
+ }
+ }
}
} // namespace task