还款(有误(未完成))
This commit is contained in:
parent
8b02d52112
commit
a9e5279bc9
3
4065_returnmoney/Readme.md
Normal file
3
4065_returnmoney/Readme.md
Normal file
@ -0,0 +1,3 @@
|
||||
# 标题
|
||||
|
||||
* 内容
|
3
4065_returnmoney/doc/Readme.md
Normal file
3
4065_returnmoney/doc/Readme.md
Normal file
@ -0,0 +1,3 @@
|
||||
# 标题
|
||||
|
||||
* 内容
|
BIN
4065_returnmoney/doc/还款.pdf
Normal file
BIN
4065_returnmoney/doc/还款.pdf
Normal file
Binary file not shown.
6
4065_returnmoney/main.cpp
Normal file
6
4065_returnmoney/main.cpp
Normal file
@ -0,0 +1,6 @@
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Hello Easy C++ project!" << std::endl;
|
||||
}
|
BIN
4065_returnmoney/main.exe
Normal file
BIN
4065_returnmoney/main.exe
Normal file
Binary file not shown.
23
4065_returnmoney/returnmoney.cpp
Normal file
23
4065_returnmoney/returnmoney.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
long long n,k,m;
|
||||
bool pan(long long now,long long x){
|
||||
long long y=now/x;
|
||||
if(y<x){
|
||||
y=m;
|
||||
}
|
||||
now-=y;
|
||||
|
||||
}
|
||||
long long dg(long long t,long long w) {
|
||||
long long mid=(w-t)/2+t;
|
||||
if(pan(n,mid)==1){
|
||||
return dg(mid+1,w);
|
||||
}else{
|
||||
return dg(t,mid-1);
|
||||
}
|
||||
}
|
||||
int main(){
|
||||
cin>>n>>k>>m;
|
||||
cout<<dg(1,n);
|
||||
}
|
0
4065_returnmoney/test/in.txt
Normal file
0
4065_returnmoney/test/in.txt
Normal file
7
4065_returnmoney/test/out.txt
Normal file
7
4065_returnmoney/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
|
||||
|
Loading…
x
Reference in New Issue
Block a user