update
This commit is contained in:
parent
976ebb2b03
commit
dddf880547
2
.vscode/launch.json
vendored
2
.vscode/launch.json
vendored
@ -8,7 +8,7 @@
|
|||||||
"type": "lldb",
|
"type": "lldb",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"name": "Debug",
|
"name": "Debug",
|
||||||
"program": "${workspaceFolder}/<executable file>",
|
"program": "${workspaceFolder}/?",
|
||||||
"args": [],
|
"args": [],
|
||||||
"cwd": "${workspaceFolder}"
|
"cwd": "${workspaceFolder}"
|
||||||
}
|
}
|
||||||
|
BIN
day2/U111091/U111091
Executable file
BIN
day2/U111091/U111091
Executable file
Binary file not shown.
@ -1,33 +1,109 @@
|
|||||||
#include<bits/stdc++.h>
|
#include<bits/stdc++.h>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
#define int long long
|
||||||
|
|
||||||
const int MAX_N = 5'0000+5;
|
const int MAX_N = 5'0000+5;
|
||||||
int times;
|
int times;
|
||||||
int n,k,m;
|
|
||||||
int x[MAX_N];
|
int x[MAX_N];
|
||||||
int l[MAX_N];
|
int l[MAX_N];
|
||||||
|
int prefix_r[MAX_N];
|
||||||
|
int r[MAX_N];
|
||||||
|
|
||||||
|
void debug_array(int array[],size_t size,string name){
|
||||||
|
cout<<"\n"<<name<<" [";
|
||||||
|
for(int i=0;i<size;i++){
|
||||||
|
cout<<array[i]<<(i!=size-1?",":"");
|
||||||
|
}
|
||||||
|
cout<<"]\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int main(){
|
signed main(){
|
||||||
cin.sync_with_stdio(false);
|
cin.sync_with_stdio(false);
|
||||||
cin.tie(0);
|
cin.tie(0);
|
||||||
|
|
||||||
cin>>times;
|
cin>>times;
|
||||||
for(int t=1;t<=times;t++){
|
for(int t=1;t<=times;t++){
|
||||||
|
int max_house = INT_MIN;
|
||||||
|
prefix_r[0]=0;
|
||||||
|
int n,k,m;
|
||||||
cin>>n>>k>>m;
|
cin>>n>>k>>m;
|
||||||
for (int i=1; i<=n; i++) {
|
for (int i=1; i<=n; i++) {
|
||||||
cin>>x[i];
|
cin>>x[i];
|
||||||
|
if (max_house<=x[i])max_house=x[i];
|
||||||
}
|
}
|
||||||
|
//RM
|
||||||
|
cout<<"\nmaxhouse:"<<max_house<<"\n";
|
||||||
|
// max_house=x[n];
|
||||||
|
//RM
|
||||||
|
debug_array(x, n, "x");
|
||||||
|
|
||||||
string s;
|
string s;
|
||||||
cin>>s;
|
cin>>s;
|
||||||
|
|
||||||
|
//RM
|
||||||
assert(s.size()==n-1);
|
assert(s.size()==n-1);
|
||||||
for(int i=0;i<=s.size();i++){
|
|
||||||
if (s[i]=='0') {
|
for(int i=1;i<=s.size();i++){
|
||||||
l[i+1]=0;
|
if (s[i-1]=='1') {
|
||||||
|
l[i]=1;
|
||||||
|
for (int j=x[i]+1; j<=x[i+1]; j++) {
|
||||||
|
r[j]=l[i];
|
||||||
|
}
|
||||||
}else {
|
}else {
|
||||||
l[i+1]=1;
|
l[i]=0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
int cnt=0;
|
||||||
|
for (int j=1; j<=k; j++) {
|
||||||
|
//RM
|
||||||
|
cout<<"\nk:"<<j<<"\n";
|
||||||
|
debug_array(r, max_house, "r");
|
||||||
|
|
||||||
|
for(int i=1;i<=max_house;i++){
|
||||||
|
prefix_r[i]=prefix_r[i-1]+r[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
//RM
|
||||||
|
debug_array(prefix_r, max_house, "prefix_r");
|
||||||
|
|
||||||
|
int max_dir=INT_MIN;
|
||||||
|
int max_num=INT_MIN;
|
||||||
|
for (int i=0; i<=max_house-m; i++) {
|
||||||
|
if (prefix_r[i+m]-prefix_r[i]>max_num) {
|
||||||
|
max_dir=i;
|
||||||
|
max_num=prefix_r[i+m]-prefix_r[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//RM
|
||||||
|
debug_array(prefix_r, max_house, "prefix_r");
|
||||||
|
|
||||||
|
//RM
|
||||||
|
cout<<"\nMAX_DIR:"<<max_dir<<"\n";
|
||||||
|
for (int i=max_dir+1; i<=max_dir+m; i++) {
|
||||||
|
r[i]=0;
|
||||||
|
}
|
||||||
|
cnt=0;
|
||||||
|
for (int i=1; i<=max_house; i++) {
|
||||||
|
cnt+=r[i];
|
||||||
|
}
|
||||||
|
//RM
|
||||||
|
cout<<"\ncnt:"<<cnt<<"\n";
|
||||||
|
}
|
||||||
|
cout<<cnt<<"\n";
|
||||||
|
//RM
|
||||||
|
cout<<"\nNEXT------------\n"<<endl;
|
||||||
|
|
||||||
|
/*
|
||||||
|
cout<<"\nl:\n";
|
||||||
|
for(int i=1;i<=n;i++){
|
||||||
|
cout<<l[i]<<",";
|
||||||
|
}
|
||||||
|
cout<<"\n";
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,20 @@
|
|||||||
|
|
||||||
输出 $T$ 行,对于每组数据输出1个整数代表答案
|
输出 $T$ 行,对于每组数据输出1个整数代表答案
|
||||||
|
|
||||||
|
## 自检样例
|
||||||
|
### 输入
|
||||||
|
```
|
||||||
|
1
|
||||||
|
2 1 2
|
||||||
|
2 3
|
||||||
|
0
|
||||||
|
|
||||||
|
```
|
||||||
|
### 输出
|
||||||
|
```
|
||||||
|
0
|
||||||
|
```
|
||||||
|
|
||||||
## 样例 #1
|
## 样例 #1
|
||||||
|
|
||||||
### 样例输入 #1
|
### 样例输入 #1
|
||||||
|
4
day2/U111091/in.txt
Normal file
4
day2/U111091/in.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
1
|
||||||
|
9 2 47
|
||||||
|
0 26 34 40 71 75 79 98 99
|
||||||
|
11111101
|
110
day2/U111091/out.txt
Normal file
110
day2/U111091/out.txt
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
|
||||||
|
x [0,0,6]
|
||||||
|
|
||||||
|
k:1
|
||||||
|
|
||||||
|
prefix_r [0,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,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79]
|
||||||
|
|
||||||
|
MAX_DIR:0
|
||||||
|
|
||||||
|
cnt:67
|
||||||
|
|
||||||
|
k:2
|
||||||
|
|
||||||
|
prefix_r [0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66]
|
||||||
|
|
||||||
|
MAX_DIR:13
|
||||||
|
|
||||||
|
cnt:54
|
||||||
|
54
|
||||||
|
|
||||||
|
NEXT------------
|
||||||
|
|
||||||
|
|
||||||
|
x [0,0,50,80,83,86,97]
|
||||||
|
|
||||||
|
k:1
|
||||||
|
|
||||||
|
prefix_r [0,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,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,83,83,83,84,85,86,87,88,89,90,91,92,93]
|
||||||
|
|
||||||
|
MAX_DIR:0
|
||||||
|
|
||||||
|
cnt:83
|
||||||
|
|
||||||
|
k:2
|
||||||
|
|
||||||
|
prefix_r [0,0,0,0,0,0,0,0,0,0,0,0,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,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,72,72,72,73,74,75,76,77,78,79,80,81,82]
|
||||||
|
|
||||||
|
MAX_DIR:11
|
||||||
|
|
||||||
|
cnt:72
|
||||||
|
72
|
||||||
|
|
||||||
|
NEXT------------
|
||||||
|
|
||||||
|
|
||||||
|
x [0,0]
|
||||||
|
|
||||||
|
k:1
|
||||||
|
|
||||||
|
prefix_r [0,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,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82]
|
||||||
|
|
||||||
|
MAX_DIR:0
|
||||||
|
|
||||||
|
cnt:40
|
||||||
|
|
||||||
|
k:2
|
||||||
|
|
||||||
|
prefix_r [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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]
|
||||||
|
|
||||||
|
MAX_DIR:40
|
||||||
|
|
||||||
|
cnt:0
|
||||||
|
0
|
||||||
|
|
||||||
|
NEXT------------
|
||||||
|
|
||||||
|
|
||||||
|
x [0,0,26,34,40,71,75,79,98]
|
||||||
|
|
||||||
|
k:1
|
||||||
|
|
||||||
|
prefix_r [0,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,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,79,79,79,79,79,79,79,80,81,82,83,84,85,86,87,88,89,90,90]
|
||||||
|
|
||||||
|
MAX_DIR:0
|
||||||
|
|
||||||
|
cnt:44
|
||||||
|
|
||||||
|
k:2
|
||||||
|
|
||||||
|
prefix_r [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,32,32,32,32,32,32,32,33,34,35,36,37,38,39,40,41,42,43,43]
|
||||||
|
|
||||||
|
MAX_DIR:47
|
||||||
|
|
||||||
|
cnt:4
|
||||||
|
4
|
||||||
|
|
||||||
|
NEXT------------
|
||||||
|
|
||||||
|
|
||||||
|
x [0,0,14,28,29,30,37,55,64,65]
|
||||||
|
|
||||||
|
k:1
|
||||||
|
|
||||||
|
prefix_r [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,16,16,16,16,16,16,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34,34]
|
||||||
|
|
||||||
|
MAX_DIR:14
|
||||||
|
|
||||||
|
cnt:5
|
||||||
|
|
||||||
|
k:2
|
||||||
|
|
||||||
|
prefix_r [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5]
|
||||||
|
|
||||||
|
MAX_DIR:19
|
||||||
|
|
||||||
|
cnt:0
|
||||||
|
0
|
||||||
|
|
||||||
|
NEXT------------
|
||||||
|
|
64
day2/U111091/out_old.txt
Normal file
64
day2/U111091/out_old.txt
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
NEXT------------
|
||||||
|
|
||||||
|
|
||||||
|
maxhouse:99
|
||||||
|
|
||||||
|
x [0,0,26,34,40,71,75,79,98]
|
||||||
|
|
||||||
|
k:1
|
||||||
|
|
||||||
|
r [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0]
|
||||||
|
|
||||||
|
prefix_r [0,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,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,79,79,79,79,79,79,79,80,81,82,83,84,85,86,87,88,89,90,90]
|
||||||
|
|
||||||
|
prefix_r [0,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,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,79,79,79,79,79,79,79,80,81,82,83,84,85,86,87,88,89,90,90]
|
||||||
|
|
||||||
|
MAX_DIR:0
|
||||||
|
|
||||||
|
cnt:44
|
||||||
|
|
||||||
|
k:2
|
||||||
|
|
||||||
|
r [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0]
|
||||||
|
|
||||||
|
prefix_r [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,32,32,32,32,32,32,32,33,34,35,36,37,38,39,40,41,42,43,43]
|
||||||
|
|
||||||
|
prefix_r [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,32,32,32,32,32,32,32,33,34,35,36,37,38,39,40,41,42,43,43]
|
||||||
|
|
||||||
|
MAX_DIR:47
|
||||||
|
|
||||||
|
cnt:4
|
||||||
|
4
|
||||||
|
|
||||||
|
NEXT------------
|
||||||
|
|
||||||
|
maxhouse:99
|
||||||
|
|
||||||
|
x [0,0,26,34,40,71,75,79,98]
|
||||||
|
|
||||||
|
k:1
|
||||||
|
|
||||||
|
r [0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
|
||||||
|
|
||||||
|
prefix_r [0,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,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79]
|
||||||
|
|
||||||
|
prefix_r [0,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,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79,79]
|
||||||
|
|
||||||
|
MAX_DIR:0
|
||||||
|
|
||||||
|
cnt:33
|
||||||
|
|
||||||
|
k:2
|
||||||
|
|
||||||
|
r [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
|
||||||
|
|
||||||
|
prefix_r [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32]
|
||||||
|
|
||||||
|
prefix_r [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32]
|
||||||
|
|
||||||
|
MAX_DIR:32
|
||||||
|
|
||||||
|
cnt:1
|
||||||
|
1
|
||||||
|
|
||||||
|
NEXT------------
|
BIN
day2/U111091/tempCodeRunnerFile
Executable file
BIN
day2/U111091/tempCodeRunnerFile
Executable file
Binary file not shown.
81
day2/U111091/tempCodeRunnerFile.cpp
Normal file
81
day2/U111091/tempCodeRunnerFile.cpp
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
#include<bits/stdc++.h>
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
const int MAX_N = 5'0000+5;
|
||||||
|
int times;
|
||||||
|
int n,k,m;
|
||||||
|
int x[MAX_N];
|
||||||
|
int l[MAX_N];
|
||||||
|
int prefix_r[MAX_N];
|
||||||
|
int r[MAX_N];
|
||||||
|
int max_house = INT_MIN;
|
||||||
|
|
||||||
|
|
||||||
|
int main(){
|
||||||
|
cin.sync_with_stdio(false);
|
||||||
|
cin.tie(0);
|
||||||
|
|
||||||
|
cin>>times;
|
||||||
|
for(int t=1;t<=times;t++){
|
||||||
|
max_house = INT_MIN;
|
||||||
|
prefix_r[0]=0;
|
||||||
|
cin>>n>>k>>m;
|
||||||
|
for (int i=1; i<=n; i++) {
|
||||||
|
cin>>x[i];
|
||||||
|
if (max_house<=x[i])max_house=x[i];
|
||||||
|
}
|
||||||
|
string s;
|
||||||
|
cin>>s;
|
||||||
|
assert(s.size()==n-1);
|
||||||
|
for(int i=1;i<=s.size();i++){
|
||||||
|
if (s[i-1]=='1') {
|
||||||
|
l[i]=1;
|
||||||
|
for (int j=x[i]+1; j<=x[i+1]; j++) {
|
||||||
|
r[j]=l[i];
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
l[i]=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int j=1; j<=k; j++) {
|
||||||
|
for(int i=1;i<=max_house;i++){
|
||||||
|
prefix_r[i]=prefix_r[i-1]+r[i];
|
||||||
|
}
|
||||||
|
int max_dir=INT_MIN;
|
||||||
|
int max_num=INT_MIN;
|
||||||
|
for (int i=1; i<=max_house-m; i++) {
|
||||||
|
if (prefix_r[i+m]-prefix_r[i]>max_num) {
|
||||||
|
max_dir=i;
|
||||||
|
max_num=prefix_r[i+m]-prefix_r[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//RM
|
||||||
|
// cout<<"\nMAX_DIR:"<<max_dir<<"\n";
|
||||||
|
for (int i=max_dir+1; i<=max_dir+m; i++) {
|
||||||
|
r[i]=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int cnt=0;
|
||||||
|
for (int i=1; i<=max_house; i++) {
|
||||||
|
cnt+=r[i];
|
||||||
|
}
|
||||||
|
//RM
|
||||||
|
// cout<<"\ncnt:"<<cnt<<"\n";
|
||||||
|
|
||||||
|
cout<<cnt<<"\n";
|
||||||
|
}
|
||||||
|
//RM
|
||||||
|
// cout<<"\nNEXT------------\n"<<endl;
|
||||||
|
|
||||||
|
/*
|
||||||
|
cout<<"\nl:\n";
|
||||||
|
for(int i=1;i<=n;i++){
|
||||||
|
cout<<l[i]<<",";
|
||||||
|
}
|
||||||
|
cout<<"\n";
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user