迷路
This commit is contained in:
parent
5016ebf497
commit
e1f8beba1b
3
4068_loseway/Readme.md
Normal file
3
4068_loseway/Readme.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# 标题
|
||||||
|
|
||||||
|
* 内容
|
3
4068_loseway/doc/Readme.md
Normal file
3
4068_loseway/doc/Readme.md
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# 标题
|
||||||
|
|
||||||
|
* 内容
|
BIN
4068_loseway/doc/迷路.pdf
Normal file
BIN
4068_loseway/doc/迷路.pdf
Normal file
Binary file not shown.
31
4068_loseway/loseway.cpp
Normal file
31
4068_loseway/loseway.cpp
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#include<iostream>
|
||||||
|
using namespace std;
|
||||||
|
string a[100],s;
|
||||||
|
int ce(int now){
|
||||||
|
for(int i=0;i<now;i++){
|
||||||
|
//cout<<a[i]<<" "<<a[now]<<";";
|
||||||
|
if(a[i]==a[now]){
|
||||||
|
//cout<<endl;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//cout<<endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
int main(){
|
||||||
|
int n;
|
||||||
|
cin>>n;
|
||||||
|
cin>>s;
|
||||||
|
for(int i=1;i<=n;i++){
|
||||||
|
int ge=0;
|
||||||
|
for(int j=i;j<=n;j++){
|
||||||
|
a[j-i]+=s[j-1];
|
||||||
|
ge+=ce(j-i);
|
||||||
|
//cout<<j<<" "<<a[j-i]<<" "<<ge<<endl;
|
||||||
|
}
|
||||||
|
if(ge==n-i+1){
|
||||||
|
cout<<i;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
BIN
4068_loseway/loseway.exe
Normal file
BIN
4068_loseway/loseway.exe
Normal file
Binary file not shown.
6
4068_loseway/main.cpp
Normal file
6
4068_loseway/main.cpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
std::cout << "Hello Easy C++ project!" << std::endl;
|
||||||
|
}
|
BIN
4068_loseway/main.exe
Normal file
BIN
4068_loseway/main.exe
Normal file
Binary file not shown.
2
4068_loseway/test/In1 (11).txt
Normal file
2
4068_loseway/test/In1 (11).txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
10
|
||||||
|
IXMVDKIXMV
|
2
4068_loseway/test/In2 (3).txt
Normal file
2
4068_loseway/test/In2 (3).txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
20
|
||||||
|
RBLRRWSOFSWRRWSOFSAD
|
2
4068_loseway/test/in.txt
Normal file
2
4068_loseway/test/in.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
7
|
||||||
|
ABCDABC
|
18
4068_loseway/test/out.txt
Normal file
18
4068_loseway/test/out.txt
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
## z:\Chao\src\4068_loseway\test\in.txt
|
||||||
|
2020/03/29 ÖÜÈÕ 9:05:50.92
|
||||||
|
4
|
||||||
|
-----------------------------------------------
|
||||||
|
Process exited after 200 ms with return value 0
|
||||||
|
|
||||||
|
## z:\Chao\src\4068_loseway\test\In1 (11).txt
|
||||||
|
2020/03/29 ÖÜÈÕ 9:05:50.92
|
||||||
|
5
|
||||||
|
-----------------------------------------------
|
||||||
|
Process exited after 130 ms with return value 0
|
||||||
|
|
||||||
|
## z:\Chao\src\4068_loseway\test\In2 (3).txt
|
||||||
|
2020/03/29 ÖÜÈÕ 9:05:50.92
|
||||||
|
8
|
||||||
|
-----------------------------------------------
|
||||||
|
Process exited after 330 ms with return value 0
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user