锘??xml version="1.0" encoding="utf-8" standalone="yes"?>婷婷久久综合九色综合98,欧美成人免费观看久久,久久久久亚洲精品天堂久久久久久
http://m.shnenglu.com/meglory/category/13415.htmlcoding for life zh-cn Tue, 26 Apr 2011 16:22:42 GMT Tue, 26 Apr 2011 16:22:42 GMT 60 UVA 10815 http://m.shnenglu.com/meglory/archive/2011/04/03/143349.htmlmeglory meglory Sun, 03 Apr 2011 09:05:00 GMT http://m.shnenglu.com/meglory/archive/2011/04/03/143349.html http://m.shnenglu.com/meglory/comments/143349.html http://m.shnenglu.com/meglory/archive/2011/04/03/143349.html#Feedback 0 http://m.shnenglu.com/meglory/comments/commentRss/143349.html http://m.shnenglu.com/meglory/services/trackbacks/143349.html I hate this type of problems... The key to this problem is the definition of a "word": a word is defined as a consecutive sequence of alphabets, in upper and/or lower case so, "won't" consists of two words, "won" and "t"......
]]> UVA 10878 http://m.shnenglu.com/meglory/archive/2011/03/24/142673.htmlmeglory meglory Thu, 24 Mar 2011 13:11:00 GMT http://m.shnenglu.com/meglory/archive/2011/03/24/142673.html http://m.shnenglu.com/meglory/comments/142673.html http://m.shnenglu.com/meglory/archive/2011/03/24/142673.html#Feedback 0 http://m.shnenglu.com/meglory/comments/commentRss/142673.html http://m.shnenglu.com/meglory/services/trackbacks/142673.html 鐪嬪埌緗戜笂涓涓唬鐮佹尯鏈夋剰鎬濈殑錛岃鎴戣偗瀹氬啓涓嶄簡榪欎箞綆媧併俥xp鐨勪嬌鐢ㄥ緢綺鵑珦銆?br> 鍘熸枃錛?a href="http://m.shnenglu.com/syhd142/articles/130347.html">http://m.shnenglu.com/syhd142/articles/130347.html
1 #include < stdio.h > 2 #include < string .h > 3 4 #define N 20 5 6 const int exp[ 11 ] = { 0 , 128 , 64 , 32 , 16 , 8 , 0 , 4 , 2 , 1 }; 7 8 int main() 9 { 10 // freopen("out.txt", "w", stdout); 11 char data[N]; 12 while (gets(data)) 13 { 14 int sum = 0 ; 15 int l = strlen(data); 16 if (data[ 0 ] != ' | ' ) continue ; 17 for ( int i = 1 ; i < l - 1 ; i ++ ) 18 { 19 if (data[i] == ' . ' ) continue ; 20 if (data[i] == ' o ' ) sum += exp[i]; 21 } 22 printf( " %c " , sum); 23 } 24 return 0 ; 25 }
]]>UVA 10010 http://m.shnenglu.com/meglory/archive/2011/03/15/141922.htmlmeglory meglory Tue, 15 Mar 2011 15:16:00 GMT http://m.shnenglu.com/meglory/archive/2011/03/15/141922.html http://m.shnenglu.com/meglory/comments/141922.html http://m.shnenglu.com/meglory/archive/2011/03/15/141922.html#Feedback 0 http://m.shnenglu.com/meglory/comments/commentRss/141922.html http://m.shnenglu.com/meglory/services/trackbacks/141922.html I learned that devising and testing program on a paper is quite effective. It's easier to edit and modify. Once you've finished coding, it's harder to modify your program. And devising at least several test cases before submitting your program. It's quite often that the Sample is somewhat misleading, there used to be long way between YES and merely making your program pass the Sample test. Most importantly, I can feel some improvement on my coding skills no matter how easy the problem I'm trying to solve seems to be. Just write your code, once day you will feel the improvements. ]]>UVA 401 http://m.shnenglu.com/meglory/archive/2011/03/14/141829.htmlmeglory meglory Mon, 14 Mar 2011 15:08:00 GMT http://m.shnenglu.com/meglory/archive/2011/03/14/141829.html http://m.shnenglu.com/meglory/comments/141829.html http://m.shnenglu.com/meglory/archive/2011/03/14/141829.html#Feedback 0 http://m.shnenglu.com/meglory/comments/commentRss/141829.html http://m.shnenglu.com/meglory/services/trackbacks/141829.html 榪欎釜棰樼洰鑺變簡涓浜涙椂闂達(dá)紝鎬葷粨涓涓嬪洜涓轟笅闈袱涓師鍥狅細(xì) 1. 榪樻槸璇婚鐨勯棶棰樸?/strong>棰樼洰鏈変袱涓湴鏂規(guī)病鏈夋敞鎰忓埌錛歛.姣忎釜杈撳嚭鍚庨潰蹇呴』鍦ㄨ緭鍑轟竴涓┖琛岋紱b. 棰樼洰鍏充簬0(zero)鍜孫(letter)鐨勯棶棰樻垜瀹屽叏娌℃湁鐪嬫噦灝卞幓鍐欎唬鐮佷簡銆?br> 涓哄暐鎬繪槸鍑虹幇璇婚鐨勯棶棰樺憿錛熸葷粨涓鏉¤繕鏄嚜宸卞お鎬ヤ簬鍘誨啓浠g爜浜嗭紝涓嶆効鎰忔妸闀塊暱鐨勮鏄庤浠旂粏銆傚叾瀹炰綘鍦ㄨ棰樼洰鏃跺欏洜涓哄嚑縐掗挓鐨勭枏蹇藉彲鑳藉湪鏈鍚庤皟寮忎唬鐮佺殑鏃跺欒鑺卞幓鍑犱釜灝忔椂鐨勬椂闂達(dá)紝寰椾笉鍋垮け鍟娿傚垏璁板垏璁般?br> 2.浠g爜涔?fàn)鎯?鎴戠殑涓澶勫嚭闂鐨勪唬鐮?while(s[i++]==t[j--] && j>=i) 錛屼箥涓鐪嬭繖涔堜唬鐮佹病鍟ラ棶棰橈紝榪樼渷浜嗗驚鐜噷闈㈢殑浠g爜銆備絾鏄紝鍦ㄥ悓涓琛屼笂闈㈠悓鏃朵嬌鐢╥++鍜宨鏄潪甯稿樊鐨勪唬鐮佷範(fàn)鎯紝鑰岃繖涓潖涔?fàn)鎯堫C簡鎴戣繖閲屽氨鎴愪簡涓涓猙ug銆?/p>
]]> UVA 457 | 浠涔堟槸Core Dump錛?/title> http://m.shnenglu.com/meglory/archive/2011/03/14/141755.htmlmeglory meglory Mon, 14 Mar 2011 00:24:00 GMT http://m.shnenglu.com/meglory/archive/2011/03/14/141755.html http://m.shnenglu.com/meglory/comments/141755.html http://m.shnenglu.com/meglory/archive/2011/03/14/141755.html#Feedback 0 http://m.shnenglu.com/meglory/comments/commentRss/141755.html http://m.shnenglu.com/meglory/services/trackbacks/141755.html UVA457鏄釜姘撮錛屼絾鏄垜榪樻槸紕板埌浜嗕竴浜涘皬闂銆?br> 1.寮浜嗕竴涓猻tate[50][42]鏁扮粍鍦╩ain鍑芥暟閲岄潰錛岀粨鏋滄彁浜や箣鍚庡彂鐜皉untime error錛岃鐫鏄爢鏍堟孩鍑轟簡銆傜獊鐒舵兂璧鋒潵50*42>2000錛岃繖縐嶆暟緇勪竴瀹氭槸寮鍦╩ain澶栭潰鐨勶紝涓嶇劧蹇呯劧鍫嗘爤婧㈠嚭銆?br>2.鏄棰樹笉浠旂粏錛屽綋鎴愪簡澶氶噸杈撳叆錛屾悶浜嗕竴涓獁hile(scanf(...))錛岀粨鏋滆秴鏃朵簡銆傜涓嬈″湪UVA OJ涓婇潰瓚呮椂銆?br> 浣嗘槸榪欑瘒鏂囩珷閲嶇偣涓嶆槸璁茶繖涓紝鑰屾槸璁叉垜鍦ㄨ繍琛岃繃紼嬩腑緇忓父閬囧埌鐨刢ore dumped鐜拌薄銆傛垜鍦ㄧ綉涓婃壘鍒頒竴鐐硅祫鏂欙紝璐村湪涓嬮潰錛?br> 鍘熷笘錛?a >http://blogold.chinaunix.net/u3/98822/showart_2093542.html浠涔堟槸Core Dump? Core鐨勬剰鎬濇槸鍐呭瓨, Dump鐨勬剰鎬濇槸鎵斿嚭鏉? 鍫嗗嚭鏉? 寮鍙戝拰浣跨敤Unix紼嬪簭鏃? 鏈夋椂紼嬪簭鑾悕鍏跺鐨刣own浜? 鍗存病鏈変換浣曠殑鎻愮ず(鏈夋椂鍊欎細(xì)鎻愮ずcore dumped). 榪欐椂鍊欏彲浠ユ煡鐪嬩竴涓嬫湁娌℃湁褰㈠core.榪涚▼鍙風(fēng)殑鏂囦歡鐢熸垚, 榪欎釜鏂囦歡渚挎槸鎿嶄綔緋葷粺鎶婄▼搴廳own鎺夋椂鐨勫唴瀛樺唴瀹規(guī)墧鍑烘潵鐢熸垚鐨? 瀹冨彲浠ュ仛涓鴻皟璇曠▼搴忕殑鍙傝? core dump鍙堝彨鏍稿績杞偍, 褰撶▼搴忚繍琛岃繃紼嬩腑鍙戠敓寮傚父, 紼嬪簭寮傚父閫鍑烘椂, 鐢辨搷浣滅郴緇熸妸紼嬪簭褰撳墠鐨勫唴瀛樼姸鍐靛瓨鍌ㄥ湪涓涓猚ore鏂囦歡涓? 鍙玞ore dump.濡備綍浣跨敤core鏂囦歡? gdb -c core鏂囦歡璺緞 [搴旂敤紼嬪簭鐨勮礬寰刔 榪涘幓鍚庤緭鍏here鍥炶濺, 灝卞彲浠ユ樉紺虹▼搴忓湪鍝竴琛屽綋鎺夌殑, 鍦ㄥ摢涓嚱鏁頒腑.涓轟粈涔堟病鏈塩ore鏂囦歡鐢熸垚鍛? 鏈夋椂鍊欑▼搴廳own浜? 浣嗘槸core鏂囦歡鍗存病鏈夌敓鎴? core鏂囦歡鐨勭敓鎴愯窡浣犲綋鍓嶇郴緇熺殑鐜璁劇疆鏈夊叧緋? 鍙互鐢ㄤ笅闈㈢殑璇彞璁劇疆涓涓? 鐒跺悗鍐嶈繍琛岀▼搴忎究鎴愮敓鎴恈ore鏂囦歡. ulimit -c unlimited 銆?span style="TEXT-DECORATION: underline">娌℃湁鎵懼埌core鏂囦歡錛屾垜浠敼鏀箄limit鐨勮緗紝璁╁畠浜х敓銆?024鏄殢渚垮彇鐨勶紝瑕佹槸core鏂囦歡澶т簬1024涓潡錛屽氨浜х敓涓嶅嚭鏉ヤ簡銆傦級(jí)$ ulimit -c 1024 錛堣漿鑰呮敞: 浣跨敤-c unlimited涓嶉檺鍒禼ore鏂囦歡澶у皬 銆?br> core鏂囦歡鐢熸垚鐨勪綅緗竴鑸簬榪愯紼嬪簭鐨勮礬寰勭浉鍚? 鏂囦歡鍚嶄竴鑸負(fù)core.榪涚▼鍙?br> 4. 鐢╣db鏌ョ湅core鏂囦歡: 涓嬮潰鎴戜滑鍙互鍦ㄥ彂鐢熻繍琛屾椂淇″彿寮曡搗鐨勯敊璇椂鍙戠敓core dump浜? 鍙戠敓core dump涔嬪悗, 鐢╣db榪涜鏌ョ湅core鏂囦歡鐨勫唴瀹? 浠ュ畾浣嶆枃浠朵腑寮曞彂core dump鐨勮.gdb [exec file] [core file] 濡?gdb ./test test.core 鍦ㄨ繘鍏db鍚? 鐢╞t鍛戒護(hù)鏌ョ湅backtrace浠ユ鏌ュ彂鐢熺▼搴忚繍琛屽埌鍝噷, 鏉ュ畾浣峜ore dump鐨勬枃浠?>琛? ===========================================================================
閫犳垚紼嬪簭core dump鐨勫師鍥犲緢澶氾紝榪欓噷鏍規(guī)嵁浠ュ線鐨勭粡楠屾葷粨涓涓嬶細(xì)
1 鍐呭瓨璁塊棶瓚婄晫
a) 鐢變簬浣跨敤閿欒鐨勪笅鏍囷紝瀵艱嚧鏁扮粍璁塊棶瓚婄晫
b) 鎼滅儲(chǔ)瀛楃涓叉椂錛屼緷闈犲瓧絎︿覆緇撴潫絎︽潵鍒ゆ柇瀛楃涓叉槸鍚︾粨鏉燂紝浣嗘槸瀛楃涓叉病鏈夋甯哥殑浣跨敤緇撴潫絎?/p>
c) 浣跨敤strcpy, strcat, sprintf, strcmp, strcasecmp絳夊瓧絎︿覆鎿嶄綔鍑芥暟錛屽皢鐩爣瀛楃涓茶/鍐欑垎銆傚簲璇ヤ嬌鐢╯trncpy, strlcpy, strncat, strlcat, snprintf, strncmp, strncasecmp絳夊嚱鏁伴槻姝㈣鍐欒秺鐣屻?/p>
2 澶氱嚎紼嬬▼搴忎嬌鐢ㄤ簡綰跨▼涓嶅畨鍏ㄧ殑鍑芥暟銆?/p>
搴旇浣跨敤涓嬮潰榪欎簺鍙噸鍏ョ殑鍑芥暟錛屽挨鍏舵敞鎰忕孩鑹叉爣紺哄嚭鏉ョ殑鍑芥暟錛屽畠浠緢瀹規(guī)槗琚敤閿欙細(xì)
asctime_r(3c) gethostbyname_r(3n) getservbyname_r(3n) ctermid_r(3s) gethostent_r(3n) getservbyport_r(3n) ctime_r(3c) getlogin_r(3c) getservent_r(3n) fgetgrent_r(3c) getnetbyaddr_r(3n) getspent_r(3c) fgetpwent_r(3c) getnetbyname_r(3n) getspnam_r(3c) fgetspent_r(3c) getnetent_r(3n) gmtime_r(3c) gamma_r(3m) getnetgrent_r(3n) lgamma_r(3m) getauclassent_r(3) getprotobyname_r(3n) localtime_r(3c) getauclassnam_r(3) etprotobynumber_r(3n) nis_sperror_r(3n) getauevent_r(3) getprotoent_r(3n) rand_r(3c) getauevnam_r(3) getpwent_r(3c) readdir_r(3c) getauevnum_r(3) getpwnam_r(3c) strtok_r(3c) getgrent_r(3c) getpwuid_r(3c) tmpnam_r(3s) getgrgid_r(3c) getrpcbyname_r(3n) ttyname_r(3c) getgrnam_r(3c) getrpcbynumber_r(3n) gethostbyaddr_r(3n) getrpcent_r(3n)
3 澶氱嚎紼嬭鍐欑殑鏁版嵁鏈姞閿佷繚鎶ゃ?/p>
瀵逛簬浼?xì)琚涓U跨▼鍚屾椂璁塊棶鐨勫叏灞鏁版嵁錛屽簲璇ユ敞鎰忓姞閿佷繚鎶わ紝鍚﹀垯寰堝鏄撻犳垚core dump
4 闈炴硶鎸囬拡
a) 浣跨敤絀烘寚閽?/p>
b) 闅忔剰浣跨敤鎸囬拡杞崲銆備竴涓寚鍚戜竴孌靛唴瀛樼殑鎸囬拡錛岄櫎闈炵‘瀹氳繖孌靛唴瀛樺師鍏堝氨鍒嗛厤涓烘煇縐嶇粨鏋勬垨綾誨瀷錛屾垨鑰呰繖縐嶇粨鏋勬垨綾誨瀷鐨勬暟緇勶紝鍚﹀垯涓嶈灝嗗畠杞崲涓鴻繖縐嶇粨鏋勬垨綾誨瀷鐨勬寚閽堬紝鑰屽簲璇ュ皢榪欐鍐呭瓨鎷瘋礉鍒頒竴涓繖縐嶇粨鏋勬垨綾誨瀷涓紝鍐嶈闂繖涓粨鏋勬垨綾誨瀷銆傝繖鏄洜涓哄鏋滆繖孌靛唴瀛樼殑寮濮嬪湴鍧涓嶆槸鎸夌収榪欑緇撴瀯鎴栫被鍨嬪榻愮殑錛岄偅涔堣闂畠鏃跺氨寰堝鏄撳洜涓篵us error鑰宑ore dump.
5 鍫嗘爤婧㈠嚭
涓嶈浣跨敤澶х殑灞閮ㄥ彉閲忥紙鍥犱負(fù)灞閮ㄥ彉閲忛兘鍒嗛厤鍦ㄦ爤涓婏級(jí)錛岃繖鏍峰鏄撻犳垚鍫嗘爤婧㈠嚭錛岀牬鍧忕郴緇熺殑鏍堝拰鍫嗙粨鏋勶紝瀵艱嚧鍑虹幇鑾悕鍏跺鐨勯敊璇? ------- 鎴戣嚜宸辯▼搴廲ore dumped灝辨槸鍥犱負(fù)絎?涓師鍥狅紝鍫嗘爤婧㈠嚭銆傛垜鐨勫眬閮ㄦ暟緇勫紑鐨勮繃澶э紝鑰屽眬閮ㄥ彉閲忓垎閰嶅湪鏍堜笂錛屽鑷村爢鏍堟孩鍑恒?/p>
]]>UVA 489 http://m.shnenglu.com/meglory/archive/2011/03/12/141679.htmlmeglory meglory Sat, 12 Mar 2011 15:07:00 GMT http://m.shnenglu.com/meglory/archive/2011/03/12/141679.html http://m.shnenglu.com/meglory/comments/141679.html http://m.shnenglu.com/meglory/archive/2011/03/12/141679.html#Feedback 0 http://m.shnenglu.com/meglory/comments/commentRss/141679.html http://m.shnenglu.com/meglory/services/trackbacks/141679.html 鍙戝笘鍓嶅啀嬈℃姳鎬ㄤ竴涓婥++鍗氬涓嶆敮鎸佹渶鏂扮殑Firefox鍙戝笘鐨勬儏鍐碉紝璁╂垜杈涜緵鑻﹁嫤鐮佺殑瀛楀張鎵句笉鍒頒簡銆?br> 榪欎釜棰樼洰鎶樿吘浜嗘垜涓孌墊椂闂達(dá)紝鏄洜涓轟笅闈㈢殑鎯呭喌鑷繁娌℃湁鑰冭檻錛?br> 琚寽嫻嬬殑瀛楃涓蹭負(fù)錛歛b 1. 鐚滄祴abcdefghijklmn錛岀粨鏋滀負(fù)win 2.鐚滄祴cdefghijklmnab錛岀粨鏋滀負(fù)lose 榪欏氨瑕佹眰澶勭悊鐨勬椂鍊欙紝 a. 濡傛灉琚寽嫻嬩覆涓墍鏈夊瓧絎﹂兘琚寽涓紝搴斿嵆鏃跺仠姝㈢粺璁★紝璺沖嚭寰幆錛?br>b.濡傛灉閿欒鐚滄祴鐨勬鏁板凡緇忓埌杈句簡7嬈★紝搴旇鍗蟲椂鍋滄緇熻錛岃煩鍑哄驚鐜?br> 鎴戜箣鍓嶇殑紼嬪簭娌℃湁瀵逛笂榪版儏鍐靛鐞嗭紝鎵浠ュ鑷?鎯呭喌杈撳嚭澶辮觸錛屽洜涓烘垜鎶婂悗闈㈢殑閿欒嬈℃暟閮界粺璁″畬涔嬪悗錛屾墠璺沖嚭寰幆鐪嬫槸鍚﹂敊璇秴榪?嬈★紝榪欎箞綆楀綋鐒跺氨鏄痩ose浜嗭紱鑰屽浜?鎯呭喌錛屽洜涓虹‘瀹炵寽鍒頒簡ab錛屽湪閲岄潰鎶婂瓧絎︾粺璁′箣鍚庡啀璺沖嚭鏉ョ湅琚寽嫻嬬┛錛屽弽鑰屾槸鎵鏈夊瓧絎﹀埌鐚滃埌浜嗭紝鎵浠in浜嗐?br> 琚姌鑵句簡涓涓嬭繕鏄尯楂樺叴錛屽嵆鏃舵按棰樹篃鏈夐渶瑕佺暀蹇冪殑鍦版柟銆傝皚璁般?br>
]]> UVA 445 http://m.shnenglu.com/meglory/archive/2011/03/07/141315.htmlmeglory meglory Mon, 07 Mar 2011 15:23:00 GMT http://m.shnenglu.com/meglory/archive/2011/03/07/141315.html http://m.shnenglu.com/meglory/comments/141315.html http://m.shnenglu.com/meglory/archive/2011/03/07/141315.html#Feedback 0 http://m.shnenglu.com/meglory/comments/commentRss/141315.html http://m.shnenglu.com/meglory/services/trackbacks/141315.html 鑰冨療 1a3x3 1a3a 灝眔k銆?/p>
]]> 鍏繪垚鑷繁鐨勫仛棰樹範(fàn)鎯?锝?闅忔劅 http://m.shnenglu.com/meglory/archive/2010/07/16/120596.htmlmeglory meglory Fri, 16 Jul 2010 15:07:00 GMT http://m.shnenglu.com/meglory/archive/2010/07/16/120596.html http://m.shnenglu.com/meglory/comments/120596.html http://m.shnenglu.com/meglory/archive/2010/07/16/120596.html#Feedback 0 http://m.shnenglu.com/meglory/comments/commentRss/120596.html http://m.shnenglu.com/meglory/services/trackbacks/120596.html 2010-7-16 -------------------- 鍦ㄨ璁$畻娉曠殑鏃跺欙紝鎷垮嚭涓寮犵焊鑷繁鍒楀嚭鏉ユ濊礬錛屽茍涓斿疄鐜扮畻娉曘傚鏋滃彧鏄竴鍛崇殑絀烘兂瀹規(guī)槗浣滄棤鐢ㄥ姛錛屽緢涔呮兂涓嶆槑鐧界殑涓滆タ鐢諱釜鍥懼垪琛ㄥ氨鍙兘娓呮浜嗐傚疄鐜板畬鎴愪箣鍚庯紝鎴戜箣鍓嶇殑涔?fàn)鎯槸杩囦簡Sample绔嬮┈Submit錛屽畬鍏ㄥ氨鏄挒榪愭皵銆傝繖涓椂鍊欏簲璇ョ戶緇湪綰鎬笂璺戜竴閬嶈嚜宸辯殑紼嬪簭錛岀湅鏄惁姣忎釜杈圭晫鏉′歡閮芥寜鐓ч鏈熻揪鍒頒簡錛岀▼搴忔槸涓嶆槸璧頒簡涔嬪墠棰勬兂鐨勮礬寰勩?/span> ]]>鍒烽絎竴娉?/title> http://m.shnenglu.com/meglory/archive/2010/07/16/120594.htmlmeglory meglory Fri, 16 Jul 2010 15:01:00 GMT http://m.shnenglu.com/meglory/archive/2010/07/16/120594.html http://m.shnenglu.com/meglory/comments/120594.html http://m.shnenglu.com/meglory/archive/2010/07/16/120594.html#Feedback 0 http://m.shnenglu.com/meglory/comments/commentRss/120594.html http://m.shnenglu.com/meglory/services/trackbacks/120594.html uva 490 杞姩瀛楃涓詫細(xì)Linux涓嬮潰鐨凜trl-D鍜學(xué)indows涓嬮潰鐨凜trl-Z涓鏍峰彲浠ユā鎷烢OF. ]]> 銆婄畻娉曠珵璧涘叆闂ㄧ粡鍏搞嬪涔?fàn)绗旇畮图嶆灇鋴D http://m.shnenglu.com/meglory/archive/2010/07/15/120483.htmlmeglory meglory Thu, 15 Jul 2010 14:02:00 GMT http://m.shnenglu.com/meglory/archive/2010/07/15/120483.html http://m.shnenglu.com/meglory/comments/120483.html http://m.shnenglu.com/meglory/archive/2010/07/15/120483.html#Feedback 0 http://m.shnenglu.com/meglory/comments/commentRss/120483.html http://m.shnenglu.com/meglory/services/trackbacks/120483.html 闄ゆ硶 杈撳叆姝f暣鏁皀,鎸変粠灝忓埌澶х殑欏哄簭杈撳嚭鎵鏈夊艦濡?abcde/fghij=n鐨勮〃杈懼紡錛屽叾涓璦~j鎭板ソ涓烘暟瀛?~9鐨勪竴涓帓鍒楋紝2<=n<=79銆?br>鏍蜂緥杈撳叆錛?br>62 鏍蜂緥杈撳嚭錛?br>79546/01283=62 94736/01528=62 濡備綍瑙e喅榪欎釜闂錛?br> 2010-7-16鏇存柊 涓婇潰鐨勯棶棰樿鎴戜竴涓嬪瓙鎯沖埌浜嗗浣曟眰涓涓簭鍒楃殑鍏ㄦ帓鍒楃殑闂錛屼簬鏄『鐫榪欎釜鎬濊礬鎽哥儲(chǔ)浜嗕竴涓嬨侴oogle鍒頒簡涓涓畻娉曘?br>閫掑綊
渚嬭鏄庡浣曠紪鍐欏叏鎺掑垪鐨勯掑綊綆楁硶銆?br>1銆侀鍏堢湅鏈鍚庝袱涓暟4, 5銆?瀹冧滑鐨勫叏鎺掑垪涓? 5鍜? 4, 鍗充互4寮澶寸殑5鐨勫叏鎺掑垪鍜屼互5寮澶寸殑4鐨勫叏鎺掑垪銆傜敱浜庝竴涓暟鐨勫叏鎺掑垪灝辨槸鍏舵湰韜紝浠庤屽緱鍒頒互涓婄粨鏋溿?br>2銆佸啀鐪嬪悗涓変釜鏁?, 4, 5銆傚畠浠殑鍏ㄦ帓鍒椾負(fù)3 4 5銆? 5 4銆?4 3 5銆?4 5 3銆?5 3 4銆?5 4 3 鍏粍鏁般?br>鍗充互3寮澶寸殑鍜?,5鐨勫叏鎺掑垪鐨勭粍鍚堛佷互4寮澶寸殑鍜?,5鐨勫叏鎺掑垪鐨勭粍鍚堝拰浠?寮澶寸殑鍜?,4鐨勫叏鎺掑垪鐨勭粍鍚? 浠庤屽彲浠ユ帹鏂紝璁句竴緇勬暟p = {r1, r2, r3, ... ,rn}, 鍏ㄦ帓鍒椾負(fù)perm(p)錛宲n = p - {rn}銆?br>鍥犳perm(p) = r1perm(p1), r2perm(p2), r3perm(p3), ... , rnperm(pn)銆傚綋n = 1鏃秔erm(p} = r1銆?br>涓轟簡鏇村鏄撶悊瑙o紝灝嗘暣緇勬暟涓殑鎵鏈夌殑鏁板垎鍒笌絎竴涓暟浜ゆ崲錛岃繖鏍峰氨鎬繪槸鍦ㄥ鐞嗗悗n-1涓暟鐨勫叏鎺掑垪銆?/span> ]]> 绱犳暟絳涢夋硶瀹炵幇鐨勯棶棰?/title> http://m.shnenglu.com/meglory/archive/2010/07/14/120320.htmlmeglory meglory Wed, 14 Jul 2010 05:22:00 GMT http://m.shnenglu.com/meglory/archive/2010/07/14/120320.html http://m.shnenglu.com/meglory/comments/120320.html http://m.shnenglu.com/meglory/archive/2010/07/14/120320.html#Feedback 0 http://m.shnenglu.com/meglory/comments/commentRss/120320.html http://m.shnenglu.com/meglory/services/trackbacks/120320.html 鎴戝疄鐜頒簡涓涓師鐢熺殑鐗堟湰錛屽悗鏉ュ湪Wikipedia鐪嬪埌嬈ф媺鐨勪紭鍖栫増鏈紝浣嗘槸涓嶅ぇ鐭ラ亾濡備綍瀹炵幇銆?br>鍘熸潵鐨勭増鏈槸鐩存帴鍒ゆ柇鏄惁鏄礌鏁幫紝鎵浠ョ┖闂村崰鐨勬瘮杈冨皯錛屾椂闂存瘮杈冨銆傛墦琛ㄦ硶浠ュ悗錛屽簲璇ユ槸絀洪棿鎹㈡椂闂寸殑鍔炴硶錛屼絾鏄負(fù)鍟ユ椂闂村拰絀洪棿閮藉彉澶т簡鍛紵 搴旇鏄垜瀹炵幇鐨勬湁闂錛屼粖澶╂濊冧竴涓嬨?br>
7152474
meGLORY
3006
Accepted
4056K
641MS
C
551B
2010-07-14 11:35:03
7150446
meGLORY
3006
Accepted
156K
250MS
C
405B
2010-07-14 00:15:01
澶ф鎬濊冧簡涓涓嬶紝鍔犱簡鍑犱釜鍒ゆ柇璇彞錛屾椂闂存垚鍔熺殑闄嶅埌浜?00澶氫竴鐐逛簡錛屽唴瀛樿繕鏄?056K.
]]> POJ 3006 Dirichlet's Theorem on Arithmetic Progressions http://m.shnenglu.com/meglory/archive/2010/07/12/120116.htmlmeglory meglory Mon, 12 Jul 2010 05:07:00 GMT http://m.shnenglu.com/meglory/archive/2010/07/12/120116.html http://m.shnenglu.com/meglory/comments/120116.html http://m.shnenglu.com/meglory/archive/2010/07/12/120116.html#Feedback 0 http://m.shnenglu.com/meglory/comments/commentRss/120116.html http://m.shnenglu.com/meglory/services/trackbacks/120116.html 榪欎袱澶╅兘鏄按棰橈紝娌℃湁浠涔堟兂娉曡岃█錛屽氨鏄負(fù)浜嗙啛鎮(zhèn)変竴涓嬫劅瑙夈傛垜鍙堢粰浜掕仈緗戜笂澧炲姞浜嗕笉灝戝瀮鍦炬棩蹇椼?br>鏄ㄦ櫄鍑轟簡鐐圭獊鍙戜簨浠訛紝鍘熷畾鐨勫啓紼嬪簭浜嬩歡琚敤鏉ュ鐞嗕簨鎯呬簡銆備笉榪囧悗鏉ユ垜鍊掓槸鏈夌偣鎯蟲槑鐧戒簡錛岄鐩彧鏄緢灝戜竴鐐規(guī)椂闂村湪鐪嬮鐩紝寰堝繖鐨勬椂鍊欏彲浠ュ厛鑺卞嚑鍒嗛挓鎶婇鐩紕鏄庣櫧浜嗭紝鐒跺悗鍦ㄥ幓蹇欏埆鐨勪簨鎯咃紝榪欑浠剁殑絀洪殭榪樿兘鎯充竴鎯蟲濊礬銆備笉鐭OJ鏈変粈涔堝姙娉曞彲浠ユ妸棰樼洰鎵歸噺瀵煎嚭鐨勶紝鎴戝氨涓嶇敤澶╁ぉ璐瑰姴涓婄綉璇婚鐩簡錛屽湪鍗曚綅涔熻兘鎶界┖鐬呬袱鐪箋?br> 鎴戝潥鎸佷袱浠朵簨鎯咃細(xì)1銆傚喅涓嶇洿鎺ヨ創(chuàng)棰樼洰 鐨?/span>浠g爜 2銆傛瘡澶╅兘鍐欓鐩?br> POJ 3006 璁″垝鎵撲釜琛紝鐒跺悗鐩存帴鎼烇紝鐪嬩簡涓涓嬫暟鎹緢灝忥紝搴旇娌℃湁浠涔堥棶棰樸?br> 鍦ㄨ繖閲岄『渚塊涓涓嬬礌鏁扮瓫閫夋硶銆?br>浠ヤ笅鍐呭鏉ヨ嚜Wikipedia:
To find all the prime numbers less than or equal to a given integer n by Eratosthenes' method:
Create a list of consecutive integers from two to n : (2, 3, 4, ..., n ).
Initially, let p equal 2, the first prime number.
Strike from the list all multiples of p less than or equal to n . (2p, 3p, 4p, etc. )
Find the first number remaining on the list after p (this number is the next prime); replace p with this number.
Repeat steps 3 and 4 until p 2 is greater than n .
All the remaining numbers in the list are prime
鍚庢潵錛屾鎷夊悓瀛︽彁鍑轟簡鍙﹀涓涓姙娉曪紝璁╂瘡涓暟鍙鏍囪涓嬈″氨ok
A) Start with all the natural numbers except '1' which is not a prime: 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ... ^ B) The leftmost number is prime. Multiply each number in the list by this prime and then discard the products: (4 6 8 10 12 14 16 18 20 22 24 26 28 30 ... ) These are removed: 4 6 8 10 12 14 16 18 20 22 24 26 28 30 These are left: 2 3 5 7 9 11 13 15 17 19 21 23 25 27 29 ... ^ C) The number after the previous prime is also a prime. Multiply by it each number in the new list starting from this prime and then discard the products: (9 15 21 27 33 39 45 51 57 63 69 75 81 87 ...) These are removed: 9 15 21 27 These are left: 2 3 5 7 11 13 17 19 23 25 29 ... ^
================================================= 2010-7-13 23:47 鎷嗘帀浜嗚嚜宸辯殑鎯犳櫘V3159絎旇鏈紝蹇冩儏涓鐗囧ぇ濂斤紝绔熺劧瑁呬笂浠ュ悗榪愯姝e父浜嗐傚嚭鏉ユ販錛岃繜鏃╄榪橈紝涔嬪墠涓鐩村浜庢媶鏈哄櫒鐨勪簨鎯呬笉鎰熷叴瓚o紝鐜板湪鍙湡鏄閫煎緱銆?br>鎴戠粓浜庡彲浠ュ幓涓叧鏉戣禋鍙栭偅90鍧楃殑鎷嗘満璐逛簡: ) PS:浠婂ぉ涓崍淇ソ浜嗗眿瀛愰噷闈㈢殑鎶芥按椹《錛屽績鎯呬竴鐗囧ぇ濂姐?br> ]]> POJ 1153 Integer Inquiry http://m.shnenglu.com/meglory/archive/2010/07/11/120056.htmlmeglory meglory Sat, 10 Jul 2010 17:47:00 GMT http://m.shnenglu.com/meglory/archive/2010/07/11/120056.html http://m.shnenglu.com/meglory/comments/120056.html http://m.shnenglu.com/meglory/archive/2010/07/11/120056.html#Feedback 0 http://m.shnenglu.com/meglory/comments/commentRss/120056.html http://m.shnenglu.com/meglory/services/trackbacks/120056.html 闈炲父綆鍗曠殑棰樼洰錛屾病鏈夋柟娉曞彲璦銆?br>1銆備箣鍓嶅繕璁版嬁char璇誨叆鐨勶紝鎵浠ョ洿鎺ユ妸int鍜宑har鐩稿姞鎵浠ョ粨鏋滀竴鐩村緢濂囨?br>2銆傞鐩殑鏁板瓧浼?xì)鍑虹庮C互0寮澶寸殑闈為浂鏁板瓧錛岃繖涓綋鍒濊棰樺畬鍏ㄦ病鏈夋兂鍒般備絾鏄湅鍒癲iscuss涔嬪悗鍥炲幓璇婚錛屽彂鐜伴鐩‘瀹為鐩病鏈夎涓嶅彲浠ャ傝繖涓繕鏄嚜宸辨病鏈夎冭檻鍛ㄥ叏銆?br> ]]> POJ 2262 Goldbach's Conjecture http://m.shnenglu.com/meglory/archive/2010/07/09/119806.htmlmeglory meglory Thu, 08 Jul 2010 16:26:00 GMT http://m.shnenglu.com/meglory/archive/2010/07/09/119806.html http://m.shnenglu.com/meglory/comments/119806.html http://m.shnenglu.com/meglory/archive/2010/07/09/119806.html#Feedback 0 http://m.shnenglu.com/meglory/comments/commentRss/119806.html http://m.shnenglu.com/meglory/services/trackbacks/119806.html 1.WA鏁版錛屽洜涓鴻竟鐣岀殑闂錛屾妸2涔熷綋鎴愬欓夋暟浜嗭紝娌℃湁鐣欏績two odd primes. 2.gcc緙栬瘧math.h鏃訛紝闇瑕?lm. 3.濡備綍浠巚im閲岄潰鎶婁唬鐮佹嫹鍑烘潵鎻愪氦鍒癙OJ鐨勯偅涓妗嗛噷闈紵鎴戞悶浜嗗崐澶╂病鏈夎В鍐?br> 闄勶細(xì)
gcc -l鍙傛暟
-l鍙傛暟灝辨槸鐢ㄦ潵鎸囧畾紼嬪簭瑕侀摼鎺ョ殑搴擄紝-l鍙傛暟绱ф帴鐫灝辨槸搴撳悕錛岄偅涔堝簱鍚嶈窡鐪熸鐨勫簱鏂囦歡鍚嶆湁浠涔堝叧緋誨憿錛熷氨鎷挎暟瀛﹀簱鏉ヨ錛屼粬鐨勫簱鍚嶆槸m錛屼粬鐨勫簱鏂囦歡鍚嶆槸libm.so錛屽緢瀹規(guī)槗鐪嬪嚭錛屾妸搴撴枃浠跺悕鐨勫ごlib鍜屽熬.so鍘繪帀灝辨槸搴撳悕浜?/p>
]]>UVA 494鐨勮棰橀敊璇?/title> http://m.shnenglu.com/meglory/archive/2010/04/04/111600.htmlmeglory meglory Sun, 04 Apr 2010 10:21:00 GMT http://m.shnenglu.com/meglory/archive/2010/04/04/111600.html http://m.shnenglu.com/meglory/comments/111600.html http://m.shnenglu.com/meglory/archive/2010/04/04/111600.html#Feedback 0 http://m.shnenglu.com/meglory/comments/commentRss/111600.html http://m.shnenglu.com/meglory/services/trackbacks/111600.html
榪欓亾棰樻槸寰堢畝鍗曠殑涓涓鐩傛垜鐨勯鐩悊瑙g◢寰湁鐐歸棶棰橈紝鎵浠ヨ姳浜嗕竴浜涙椂闂存墠鎼炴竻妤氥?/p>
榪樼宸у彂鐜頒簡涓涓璁簎va鐨勮鍧涳紝寰堝ソ寰堝己澶с傚氨鏄噷闈竴浣嶈佸ぇ鐨勪竴鍙ヨ瘽璁╂垜璞佺劧寮鏈椼?br>鍏抽敭鍦ㄤ簬棰樼洰閲岄潰鍏充簬word鐨勫畾涔夈?/p>
A “word” is defined as a consecutive sequence of letters (upper and/or lower case).
Your program should output a word count for each line of input. Each word count should be printed on a separate line.
涓寮濮嬫垜浠ヤ負(fù)鐩存帴鍒ゆ柇scanf(“%s”,s)鐨勬鏁板氨ok銆傚悗鏉ヤ笉鍋滃湴wa銆傚彂鐜伴鐩噷闈㈡庝箞榪瀌id!涔熺畻浣滀竴涓崟璇嶏紝涓嶆槸榪炵畫鐨勫瓧姣嶅悧錛?
I did! I did! I did taw a putty tat.
姣斿榪欎釜瀛楃涓茬敤鎴戠殑鐞嗚В灝辨槸搴旇鏄叓涓獁ord銆傚悗鏉ユ兂鍒幫紝鏄竴寮濮嬬敤璇誨叆瀛楃浼犵殑鎬濈淮瀵艱嚧浜嗘垜鐨勯敊璇傝繖涓鐩槸涓涓瓧絎︿竴涓瓧絎︾殑澶勭悊鐨勶紝騫朵笉鏄竴涓嬭榪涙潵涓涓瓧絎︿覆鐒跺悗涓涓釜鐨勫垽鏂?/p>
鎯沖埌榪欓噷錛屾垜璞佺劧寮鏈椼?/p>
]]> 銆婄畻娉曠珵璧涘叆闂ㄧ粡鍏搞?璇諱功絎旇-铔囧艦濉暟 http://m.shnenglu.com/meglory/archive/2010/03/29/110937.htmlmeglory meglory Mon, 29 Mar 2010 14:53:00 GMT http://m.shnenglu.com/meglory/archive/2010/03/29/110937.html http://m.shnenglu.com/meglory/comments/110937.html http://m.shnenglu.com/meglory/archive/2010/03/29/110937.html#Feedback 0 http://m.shnenglu.com/meglory/comments/commentRss/110937.html http://m.shnenglu.com/meglory/services/trackbacks/110937.html 涓寮濮嬪湪瀹墮噷闈㈡湁浜嗕竴鐐規(guī)濊礬錛岀敤涓ら噸寰幆銆傚悗鏉ョ湡姝e紑濮嬪湪綰鎬笂鍐欎唬鐮佺殑鏃跺欏彂鐜板彧瑕佷竴閲嶅驚鐜嵆鍙?nbsp;
#include < stdio.h > int main() { int a[ 10 ][ 10 ]; int dx[] = { 1 , 0 , - 1 , 0 }; int dy[] = { 0 , - 1 , 0 , 1 }; int value = 1 ; int i,j,n,x,y; scanf( " %d " , & n); for (i = 1 ;i <= n;i ++ ) for (j = 1 ;j <= n;j ++ ) a[i][j] = 0 ; // 鍒濆浣嶇疆涓?1,n),鍒濆鍊間負(fù)1 x = 1 ; y = n; i = 0 ; a[x][y] = value ++ ; // 寰幆緇撴潫鐨勬潯浠朵負(fù)n*n涓煎凡緇忚祴瀹?/span> while (value <= n * n) { // 鎸夌収褰撳墠鐨勬柟鍚戣繘琛屾帰嫻?/span> x += dx[i]; y += dy[i]; // 濡傛灉絎﹀悎鏉′歡錛岃祴鍊?/span> if (x >= 1 && x <= n && y >= 1 && y <= n && a[x][y] == 0 ) a[x][y] = value ++ ; // 濡傛灉涓嶇鍚堟潯浠訛紝鎶婂潗鏍囬鍥烇紝鏂瑰悜榪涜閫嗘椂閽堟棆杞?/span> else { x-= dx[i]; y -= dy[i]; i = (i + 1 ) % 4 ; } printf( " \nvalue=%d\n " ,value); } for (i = 1 ;i <= n;i ++ ) { for (j = 1 ;j <= n;j ++ ) printf( " %d " ,a[i][j]); printf( " \n " ); } return 0 ; }
鍚庢潵鐪嬪埌涔︿笂鐨剆ample浠g爜錛屾垜瑙夌潃鎴戠殑浠g爜鏄劇劧瑕佸ソ寰堝:-)
]]> 銆婄畻娉曠珵璧涘叆闂ㄧ粡鍏搞?璇諱功絎旇-鎺掑垪&鍒嗘暟鍖栧皬鏁?/title> http://m.shnenglu.com/meglory/archive/2010/03/29/110938.htmlmeglory meglory Mon, 29 Mar 2010 14:53:00 GMT http://m.shnenglu.com/meglory/archive/2010/03/29/110938.html http://m.shnenglu.com/meglory/comments/110938.html http://m.shnenglu.com/meglory/archive/2010/03/29/110938.html#Feedback 0 http://m.shnenglu.com/meglory/comments/commentRss/110938.html http://m.shnenglu.com/meglory/services/trackbacks/110938.html 鐢?,2,3,路路路,9 緇勬垚 3 涓笁浣嶆暟 abc , def 鍜?/span>ghi, 姣忎釜鏁板瓧鎭板ソ浣跨敤涓嬈★紝瑕佹眰abc:def:ghi=1:2:3銆傝緭鍑烘墍鏈夎В銆?/span> 棰樼洰鐗瑰埆鍐欏嚭浜嗘彁紺猴細(xì)涓嶅繀澶姩鑴戠瓔銆?鍏跺疄榪欏彞璇濊鎴戠幇鍦ㄩ兘涓嶆竻妤氭垜鐨勮В娉曟槸涓嶆槸絎﹀悎瑕佹眰......)
1 #include < stdio.h > 2 #include < stdlib.h > 3 int main() 4 { 5 int num; 6 char chr; 7 char a[ 10 ]; 8 char temp[ 3 ]; 9 char pos; 10 // num*3<=987 鎵浠?num<=329 11 for (num = 123 ;num <= 329 ;num ++ ) 12 { 13 itoa(num,temp, 10 ); 14 strcpy(a,temp); 15 itoa(num * 2 ,temp, 10 ); 16 strcat(a,temp); 17 itoa(num * 3 ,temp, 10 ); 18 strcat(a,temp); // a淇濆瓨浜唍um浠ュ強(qiáng)num*2鍜宯um*3緇勬垚鐨勫瓧絎︿覆 19 20 for (chr = ' 1 ' ;chr <= ' 9 ' && (pos = strchr(a,chr)) != NULL;chr ++ ) 21 ; 22 if (pos != NULL) 23 printf( " %d:%d:%d=1:2:3\n " ,num,num * 2 ,num * 3 ); 24 } 25 return 0 ; 26 } 27
浠婂ぉ緇х畫璇誨埌浜嗗垎鏁板寲灝忔暟棰樼洰錛屾劅瑙夋尯綆鍗曠殑涓涓棶棰樸傚疄闄呰棌鐫涓涓垜騫朵笉鐭ラ亾鐨刾rintf濡欑敤銆?/span>
銆銆 杈撳叆姝f暣鏁癮,b,c,杈撳嚭a/b鐨勫皬鏁板艦寮忥紝綺劇‘鍒板皬鏁扮偣鍚巆浣嶃俛,b<=10^6,c<=100.渚嬪a=1,b=6,c=4鏃跺簲杈撳嚭0.1667.
printf鐨勭壒孌婄敤娉曪紝瀵逛簬m.n鐨勬牸寮忓彲浠ョ敤濡備笅鏂規(guī)硶琛ㄧず
char ch[20]; printf("%*.*s\n",m,n,ch); 鍓嶈竟鐨?瀹氫箟鐨勬槸鎬葷殑瀹藉害錛屽悗杈圭殑瀹氫箟鐨勬槸杈撳嚭鐨勪釜鏁般傚垎鍒搴斿闈㈢殑鍙傛暟m鍜宯 銆?榪欑鏂規(guī)硶鐨勫ソ澶勬槸鍙互鍦ㄨ鍙ヤ箣澶栧鍙傛暟m鍜宯璧嬪鹼紝浠庤屾帶鍒惰緭鍑烘牸寮忋?/span> 1 #include < stdio.h > 2 int main() 3 { 4 int a,b,c; 5 scanf( " %d %d %d " , & a, & b, & c); 6 printf( " %.*lf " ,c,( double )a / b); 7 return 0 ; 8 }
]]>
久久久久久国产精品免费免费 |
国产精品久久久久久福利漫画 |
看全色黄大色大片免费久久久 |
亚洲AⅤ优女AV综合久久久 |
久久99久国产麻精品66 |
91久久精一区二区三区大全 |
欧美一级久久久久久久大 |
欧美国产成人久久精品 |
99久久99这里只有免费费精品 |
久久国产影院 |
97精品国产91久久久久久 |
一本大道久久东京热无码AV
|
国产午夜电影久久 |
欧美亚洲国产精品久久高清 |
亚洲国产精品热久久 |
一本色道久久综合亚洲精品 |
亚洲国产精品久久久久 |
欧美va久久久噜噜噜久久 |
久久毛片免费看一区二区三区 |
97久久超碰国产精品旧版 |
久久久SS麻豆欧美国产日韩 |
久久久久九国产精品 |
成人精品一区二区久久久 |
国产精品禁18久久久夂久 |
伊人久久综合精品无码AV专区 |
久久久精品久久久久久 |
青青青国产精品国产精品久久久久 |
色综合久久久久无码专区 |
久久亚洲国产最新网站 |
亚洲性久久久影院 |
久久久久久国产a免费观看黄色大片
|
久久久久久久精品成人热色戒
|
无码人妻少妇久久中文字幕蜜桃 |
日本精品久久久久久久久免费 |
精品久久久久久久久久久久久久久 |
国产精品久久国产精麻豆99网站 |
久久婷婷五月综合97色一本一本 |
中文字幕久久精品无码 |
少妇久久久久久被弄高潮 |
久久久久久人妻无码 |
久久久久无码精品国产不卡 |