91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 482KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-30
  • 語言: 其他
  • 標簽: 算法??

資源簡介

算法設計與分析的中位數、Gray碼、歸并排序、找零錢問題、租用游艇問題、裝在問題、0-1背包問題

資源截圖

代碼片段和文件信息

//Create?by?劉斌?on?17/10/17

#include??
#include??
using?namespace?std;
template?
T?mid(T?*a?T?*b?int?len)
{
if?(len?==?1)
return?*a<*b???*a?:?*b;
if?(len?==?2)
{
int?temp?=?*a?>=?*b???*a?:?*b;
if?(temp?==?*a)
return?temp<*(b?+?1)???temp?:?*(b?+?1);
else
return?temp<*(a?+?1)???temp?:?*(a?+?1);
}
int?n;
if?(len?%?2?==?0)
n?=?len?/?2;
else
n?=?len?/?2?+?1;
if?(*(a?+?n?-?1)?==?*(b?+?n?-?1))
return?*(a?+?n?-?1);
else?if?(*(a?+?n?-?1)<*(b?+?n?-?1))
return?mid(a?+?n?-?1?b?n);
else?if?(*(a?+?n?-?1)>*(b?+?n?-?1))
return?mid(a?b?+?n?-?1?n);
}
int?main()
{
int?a[5];
int?b[5];
ifstream?f1(“input.txt“);
ofstream?f2(“output.txt“);
int?len;
f1?>>?len;
for?(int?i?=?0;?i f1?>>?a[i];
for?(int?i?=?0;?i f1?>>?b[i];
int?*pa?=?a;
int?*pb?=?b;
int?m?=?mid(pa?pb?len);
cout?< f2?< f1.close();
f2.close();
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-12-22?17:14??算法-劉斌-20154943\
?????目錄???????????0??2017-10-27?17:48??算法-劉斌-20154943\代碼\
?????目錄???????????0??2017-10-27?17:48??算法-劉斌-20154943\代碼\1.1-中位數\
?????文件??????????21??2017-10-20?15:41??算法-劉斌-20154943\代碼\1.1-中位數\input.txt
?????文件???????????2??2017-10-20?15:42??算法-劉斌-20154943\代碼\1.1-中位數\output.txt
?????文件?????????968??2017-10-24?12:24??算法-劉斌-20154943\代碼\1.1-中位數\中位數.cpp
?????目錄???????????0??2017-10-27?17:48??算法-劉斌-20154943\代碼\1.2-Gray碼\
?????文件???????????1??2017-10-22?21:34??算法-劉斌-20154943\代碼\1.2-Gray碼\input.txt
?????文件????????1363??2017-10-24?12:33??算法-劉斌-20154943\代碼\1.2-Gray碼\main.cpp
?????文件??????????64??2017-10-22?21:34??算法-劉斌-20154943\代碼\1.2-Gray碼\output.txt
?????目錄???????????0??2017-10-27?17:48??算法-劉斌-20154943\代碼\1.3?-?歸并排序\
?????文件??????????82??2017-10-22?21:34??算法-劉斌-20154943\代碼\1.3?-?歸并排序\input.txt
?????文件????????4021??2017-10-24?12:32??算法-劉斌-20154943\代碼\1.3?-?歸并排序\main.cpp
?????文件??????????84??2017-10-22?21:34??算法-劉斌-20154943\代碼\1.3?-?歸并排序\output.txt
?????目錄???????????0??2017-10-27?17:48??算法-劉斌-20154943\代碼\2.1?-?找零錢問題\
?????文件??????????11??2017-10-22?21:34??算法-劉斌-20154943\代碼\2.1?-?找零錢問題\input.txt
?????文件????????1299??2017-10-24?12:24??算法-劉斌-20154943\代碼\2.1?-?找零錢問題\main.cpp
?????文件???????????1??2017-10-22?21:34??算法-劉斌-20154943\代碼\2.1?-?找零錢問題\output.txt
?????目錄???????????0??2017-10-27?17:48??算法-劉斌-20154943\代碼\2.2?-?租用游艇問題\
?????文件??????????10??2017-10-22?21:34??算法-劉斌-20154943\代碼\2.2?-?租用游艇問題\input.txt
?????文件?????????924??2017-10-24?12:27??算法-劉斌-20154943\代碼\2.2?-?租用游艇問題\main.cpp
?????文件???????????2??2017-10-22?21:34??算法-劉斌-20154943\代碼\2.2?-?租用游艇問題\output.txt
?????目錄???????????0??2017-10-27?17:48??算法-劉斌-20154943\代碼\3.1?-?裝載問題\
?????文件??????????14??2017-10-22?21:34??算法-劉斌-20154943\代碼\3.1?-?裝載問題\input.txt
?????文件????????2041??2017-10-24?12:29??算法-劉斌-20154943\代碼\3.1?-?裝載問題\main.cpp
?????文件???????????0??2017-10-22?21:34??算法-劉斌-20154943\代碼\3.1?-?裝載問題\output.txt
?????目錄???????????0??2017-10-27?17:48??算法-劉斌-20154943\代碼\3.2?-?0-1背包問題\
?????文件??????????26??2017-10-22?21:34??算法-劉斌-20154943\代碼\3.2?-?0-1背包問題\input.txt
?????文件????????3341??2017-10-24?12:34??算法-劉斌-20154943\代碼\3.2?-?0-1背包問題\main.cpp
?????文件???????????4??2017-10-22?21:34??算法-劉斌-20154943\代碼\3.2?-?0-1背包問題\output.txt
?????文件??????553984??2017-10-24?12:10??算法-劉斌-20154943\軟件1504劉斌20154934.doc
............此處省略0個文件信息

評論

共有 條評論