修正循环错误

This commit is contained in:
James 2020-04-29 18:19:46 +08:00
parent eef818e5c8
commit f16758019b
12 changed files with 32 additions and 10 deletions

3
ceshi/Readme.md Normal file
View File

@ -0,0 +1,3 @@
# 标题
* 内容

1
ceshi/doc/Readme.md Normal file
View File

@ -0,0 +1 @@
#

6
ceshi/main.cpp Normal file
View File

@ -0,0 +1,6 @@
#include <iostream>
using namespace std;
int main()
{
}

BIN
ceshi/main.exe Normal file

Binary file not shown.

0
ceshi/test/in.txt Normal file
View File

0
ceshi/test/in2.txt Normal file
View File

0
ceshi/test/in3.txt Normal file
View File

7
ceshi/test/out.txt Normal file
View File

@ -0,0 +1,7 @@
## z:\Chao\src\Template\test\in.txt
2020/03/14 ÖÜÁù 11:41:28.68
Hello Easy C++ project!
-----------------------------------------------
Process exited after 200 ms with return value 0

View File

@ -1,4 +1,5 @@
#include <iostream>
#include <cstring>
using namespace std;
int nn, zhe, a[1000001] = { 0 };
int tou = 0, wei = 0, f[1000001] = { 0 }, pai[1000001] = { 0 };
@ -23,9 +24,11 @@ int main()
}
}
cout<<endl;
tou = 0, wei = 0, pai[1] = 0, f[1] = 0;
/* memset(pai,0,sizeof(pai));
memset(f,0,sizeof(f));*/
tou = 0, wei = 0;
for (int i = 1; i <= nn; i++) {
while (tou < wei && i - f[tou] >= zhe) {
while (tou < wei && i - pai[tou] >= zhe) {
tou++;
}
while (tou < wei && f[wei-1] < a[i]) {

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long