Problem BClaw DecompositionInput: Standard InputOutput: Standard Output A claw is defined as a pointed curved nail on the end of each toe in birds, some reptiles, and some mammals. However, if you are a graph theory enthusiast, you may understand
Semi-prime H-numbersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6750 Accepted: 2868DescriptionThis problem is based on an exercise of David Hilbert, who pedagogically suggested that one study the theory of 4n+1 numbers. Here, we do
#include <stdio.h>#include <string.h>#define N 23#define INF 0x3F3F3F3Fint main(){ int n, w[ N ][ N ], i, j, k, td = 0; while ( 1 == scanf( "%d", &k ) ) { memset( w, 0x3F, sizeof(w) ); for ( i = 0; i < k; ++i )
J. Pie我的生日來臨,通常會用餡餅招待客人。是N個大小不同,口味不同的餡餅。我有F個朋友,他們會來參加我的生日宴會,他們每個人都會從某一塊餅中分到一部分,而不是從某幾塊餅中各自分一部分(這麼做會顯得很亂的!)。我們每個人得到的都是同樣大小的餅(形狀可以不同),所有的餡餅都是圓柱形的,它們有同樣的高度,但是半徑可以是不一樣的。我們所能得到的最大的餡餅尺寸是多少?Input一行包括一正整數:測試組數。接下來是每組資料說明:l 一行有2個整數N和F(1≤N,F≤10
253 - Cube paintingWe have a machine for painting cubes. It is supplied with three different colors: blue, red and green. Each face of the cube gets one of these colors. The cube's faces are numbered as in Figure 1.Figure 1.Since a cube has 6 faces,
A + B ProblemTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 458 Accepted Submission(s): 153Problem DescriptionDo you know the famous Fibonacci sequence? It is defined by the recurrenceF0 = 0
我用的是比較笨的辦法A的。應該可以用庫函數strchr( )解決的,但我試了好幾次都沒成功。所以還是用這個比較保守安全。注意A,F,K,4.......之類的單個字元是迴文字串,而B,E,1,3......之類的單個字元是鏡像迴文字串。鏡像字串還必須滿足:字串中所有的字元必須都是鏡像字元。比如:E3,EI3,EII3都是鏡像字元,而EF3,E33之類的不是鏡像字元。即字串字元個數為單數時中間的那個字元必須自己跟自己對稱。(原題:are their own