修正循环错误
This commit is contained in:
parent
eef818e5c8
commit
f16758019b
3
ceshi/Readme.md
Normal file
3
ceshi/Readme.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# 标题
|
||||||
|
|
||||||
|
* 内容
|
1
ceshi/doc/Readme.md
Normal file
1
ceshi/doc/Readme.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
#
|
6
ceshi/main.cpp
Normal file
6
ceshi/main.cpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include <iostream>
|
||||||
|
using namespace std;
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
BIN
ceshi/main.exe
Normal file
BIN
ceshi/main.exe
Normal file
Binary file not shown.
0
ceshi/test/in.txt
Normal file
0
ceshi/test/in.txt
Normal file
0
ceshi/test/in2.txt
Normal file
0
ceshi/test/in2.txt
Normal file
0
ceshi/test/in3.txt
Normal file
0
ceshi/test/in3.txt
Normal file
7
ceshi/test/out.txt
Normal file
7
ceshi/test/out.txt
Normal 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
|
||||||
|
|
@ -1,4 +1,5 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <cstring>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
int nn, zhe, a[1000001] = { 0 };
|
int nn, zhe, a[1000001] = { 0 };
|
||||||
int tou = 0, wei = 0, f[1000001] = { 0 }, pai[1000001] = { 0 };
|
int tou = 0, wei = 0, f[1000001] = { 0 }, pai[1000001] = { 0 };
|
||||||
@ -23,9 +24,11 @@ int main()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
cout<<endl;
|
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++) {
|
for (int i = 1; i <= nn; i++) {
|
||||||
while (tou < wei && i - f[tou] >= zhe) {
|
while (tou < wei && i - pai[tou] >= zhe) {
|
||||||
tou++;
|
tou++;
|
||||||
}
|
}
|
||||||
while (tou < wei && f[wei-1] < a[i]) {
|
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
Loading…
x
Reference in New Issue
Block a user