HDOJ1015看懂題之後的簡單粗暴

2021-06-26 21:33:10 字數 909 閱讀 2420

/*

看懂題意之後,給定target和大寫字串,即是:

把abcde……轉換為12345……

在給定的不重複數之中找5個數,使得其

滿足a-b^2+c^3-d^4+e^5等於給定的數target

由於資料量不大,最大為20個不重複大寫字母,

不多說,5重for迴圈搞定

*/#include #include #include #include #include #include #include #include #include #include using namespace std;

#define input freopen("input.txt","r",stdin);

#define output freopen("output.txt","w",stdout);

#define for1(i,a,b) for (i=a;ib;i--)

#define dec2(i,a,b) for (i=a;i>=b;i--)

#define sca_d(x) scanf("%d",&x)

#define sca_s(x) scanf("%s",x)

#define sca_c(x) scanf("%c",&x)

#define sca_f(x) scanf("%f",&x)

#define sca_lf(x) scanf("%lf",&x)

#define fill(x,a) memset(x,a,sizeof(x))

#define maxn 0x7fffffff

int a,b,c,d,e;

int book[30];

int ans[10];

int main()

return 0;

}

hdoj 雜湊表題hdoj1425

github鏈結 include include using namespace std const int offset 500000 bool hash offset 500001 int main for int i offset 500001 i 0 n 0 i return0 這道題資料是...

PTA乙級題 1015 德才論

1015 德才論 25 分 宋代史學家司馬光在 資治通鑑 中有一段著名的 德才論 是故才德全盡謂之聖人,才德兼亡謂之愚人,德勝才謂之君子,才勝德謂之小人。凡取人之術,苟不得聖人,君子而與之,與其得小人,不若得愚人。現給出一批考生的德才分數,請根據司馬光的理論給出錄取排名。輸入第一行給出 3 個正整數...

hdoj水題練習(一)

刷了不少劍指offer和leetcode練習演算法,都是只要寫個函式,結果被要求格式的輸入輸出打敗!哭!趕快練習!按這個順序 hdoj1089 針對行數未知的輸入 include 要有.h int main return 0 hdoj1091 針對以0 0結尾的輸入 include include ...