锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品久久久久9999高清,色99久久久久高潮综合影院,国内高清久久久久久http://www.shnenglu.com/logics-space/category/9681.htmlmath & geometryzh-cnTue, 13 Oct 2009 16:23:09 GMTTue, 13 Oct 2009 16:23:09 GMT60鍏蜂綋闂,鍏蜂綋鍒嗘瀽http://www.shnenglu.com/logics-space/articles/95836.htmllogics_spacelogics_spaceThu, 10 Sep 2009 12:02:00 GMThttp://www.shnenglu.com/logics-space/articles/95836.htmlhttp://www.shnenglu.com/logics-space/comments/95836.htmlhttp://www.shnenglu.com/logics-space/articles/95836.html#Feedback0http://www.shnenglu.com/logics-space/comments/commentRss/95836.htmlhttp://www.shnenglu.com/logics-space/services/trackbacks/95836.html   璁板緱partychen璇磋繃acm鐪熺殑寰堟湁鎰忔?姣忎竴閬撻閮戒笉涓鏍?浠婂ぉ榪欓亾棰樿瀵熷嚭瑙勫緥鍚?闇瑕佺敤澶ф暟,浜庢槸鐢╦ava鍐欎簡涓閬?TLE,涓嶇煡閬撳師鍥?涓鐩翠氦,涓鐩磋秴鏃?涓寮濮嬫鐤慾ava鐨勮緭鍑轟笉鑳界敤Scanner, 鏀逛簡BufferReader榪樻槸瓚呮椂,鏈鍚庣敤C++鐨勫ぇ鏁版ā鏉胯繕鏄秴鏃?鍗存槸涓鐩存病鎯沖埌瀹冨彧瑕侀櫎2,鍙鍑?
  
 1 #include<stdio.h>
 2 #include<string.h>
 3 
 4 #define maxlen 2005
 5 struct HP {int len,s[maxlen];};
 6 
 7 void PrintHP(HP x){
 8     for(int i=x.len;i>=1;i--) printf("%d",x.s[i]);
 9 }
10 
11 void Str2HP(const char* s ,HP &x)
12 {
13     x.len=strlen(s);
14     for(int i=1;i<=x.len;i++)
15         x.s[i]=s[x.len-i]-'0';
16 }
17 
18 void dell(HP & a){
19     int i;
20     for(i = 1; i <= a.len; i++)
21         if(a.s[i]==0)a.s[i] = 9else break;
22     a.s[i]--;
23     if(a.s[a.len]==0)a.len--;
24 }
25 
26 
27 bool div2(HP & a){
28    int i; a.s[0= 0;
29    for(i = a.len; i >= 1; i--)
30    {
31        a.s[i-1+= 10*(a.s[i]%2);
32        a.s[i] /= 2;
33    }
34    if(a.s[a.len]==0)a.len--;
35    return a.s[0]==10;
36 }
37 
38 
39 char num[maxlen];
40 
41 int main(){
42     HP a;
43     int T;
44     for( scanf("%d"&T), getchar(); T > 0; T--){
45         gets(num);
46         gets(num);
47         Str2HP(num,a);
48         if( div2(a) )
49             PrintHP(a);
50         else{
51             HP b = a; 
52             if(div2(a) ){
53                 dell(b); dell(b);
54                 PrintHP(b);
55             }
56             else{
57                 dell(b);
58                 PrintHP(b);
59             }
60         }
61         printf("\n");
62         if( T > 1)printf("\n");
63     }
64     return 0;
65 }
66 
67 /*
68 2
69 
70 7
71 
72 6
73 
74 */
75 




logics_space 2009-09-10 20:02 鍙戣〃璇勮
]]>
pku 1286 Necklace of Beadshttp://www.shnenglu.com/logics-space/articles/95106.htmllogics_spacelogics_spaceWed, 02 Sep 2009 08:10:00 GMThttp://www.shnenglu.com/logics-space/articles/95106.htmlhttp://www.shnenglu.com/logics-space/comments/95106.htmlhttp://www.shnenglu.com/logics-space/articles/95106.html#Feedback0http://www.shnenglu.com/logics-space/comments/commentRss/95106.htmlhttp://www.shnenglu.com/logics-space/services/trackbacks/95106.htmlpku 2154璺熸鎷夋暟鏈夊叧錛?br>
 1 #include<iostream>
 2 #include<stdio.h>
 3 using namespace std;
 4 typedef long long ll;
 5 ll ans[24], three[24];
 6 
 7 int c[24];
 8 bool visit[24];
 9 
10 int xunhuan(int c[], int n) {
11     int i, j, cnt = 0;
12     for (i = 0; i < n; i++)
13         visit[i] = false;
14     for (i = 0; i < n; i++)
15         if (!visit[i]) {
16             cnt++;
17             j = i;
18             while (!visit[j]) {
19                 visit[j] = true;
20                 j = c[j];
21             }
22         }
23     return cnt;
24 }
25 
26 ll solve_odd(int n) {
27     int i, j;
28     ll ans = 0;
29     for(i = 0; i < n; i++)
30     {
31         for(j = 0; j < n; j++)
32             c[j] = (j+i)%n;
33         ans += three[ xunhuan(c, n) ];
34     }
35     ans += n * three[n/2+1];
36     return ans / ( 2 * n );
37 }
38 
39 ll solve_even(int n) {
40     int i, j;
41     ll ans = 0;
42     for(i = 0; i < n; i++)
43     {
44         for(j = 0; j < n; j++)
45             c[j] = (j+i)%n;
46         ans += three[ xunhuan(c, n) ];
47     }
48     ans += n / 2 * ( three[n/2+ three[n/2+1] );
49     return ans / ( 2 * n );
50 }
51 
52 void init() {
53     int i;
54     three[0= 1;
55     for (i = 1; i < 24; i++)
56         three[i] = three[i - 1]*3;
57 
58     for (i = 1; i < 24; i += 2) {
59         ans[i] = solve_odd(i);
60         //printf("%lld\n",ans[i]);
61     }
62     for (i = 2; i < 24; i += 2) {
63         ans[i] = solve_even(i);
64         //printf("%lld\n",ans[i]);
65     }
66 }
67 
68 int main() {
69     int i;
70 //    while(scanf("%d",&i)!=EOF)
71 //        solve_odd(i);
72     init();
73     while (scanf("%d"&i) != EOF) {
74         if (i == -1)break;
75         printf("%lld\n", ans[i]);
76     }
77 }




logics_space 2009-09-02 16:10 鍙戣〃璇勮
]]>
3252 Round Numbershttp://www.shnenglu.com/logics-space/articles/94953.htmllogics_spacelogics_spaceTue, 01 Sep 2009 02:57:00 GMThttp://www.shnenglu.com/logics-space/articles/94953.htmlhttp://www.shnenglu.com/logics-space/comments/94953.htmlhttp://www.shnenglu.com/logics-space/articles/94953.html#Feedback0http://www.shnenglu.com/logics-space/comments/commentRss/94953.htmlhttp://www.shnenglu.com/logics-space/services/trackbacks/94953.html 1 #include<stdio.h>
 2 #include<string.h>
 3 #define max(x, y) ((x)>(y)?(x):(y))
 4 int C[32][32]; //C[n][k]琛ㄧず灝忎簬2^n鐨勬墍鏈夌殑鏁板惈鑷沖皯k涓?鐨勪釜鏁?/span>
 5 
 6 void init(){
 7     int i, j;
 8 
 9     for(i = 0; i < 32; i++)
10         C[i][0= C[i][i] = 1;
11 
12     for(i = 1; i < 32; i++)
13         for(j = 1; j < i; j++)
14             C[i][j] = C[i-1][j-1+C[i-1][j];
15 
16     for(i = 0; i < 32; i++)
17         for(j = i-1; j >= 0; j--)
18             C[i][j] += C[i][j+1];
19 }
20 
21 int gao(int u){
22     int value[32], n = 0;
23     while(u){
24         value[n++= u%2;
25         u/=2;
26     }
27  
28     int i, j, ans = 0;
29     for(i = 1; i < n-1; i++)
30         ans += C[i][ i/2 + 1 ];
31 
32     int  cnt = 1, least;
33     least = n % 2==0 ? n/2 : n/2+1;
34     for(i = n-2; i >= 0; i--)
35         if(value[i]){
36             j = max( 0, least-(n-i-cnt) );
37             if(j > i)return ans;
38             ans += C[i][j];
39             cnt++;
40         }
41 
42     return ans;
43 }
44 
45 int main(){
46     int a, b;
47     init();
48 
49     while(scanf("%d %d"&a, &b)!=EOF)
50     printf("%d\n",gao(b+1- gao(a) );
51 }

榪欑被棰樼洰瑕佸啓鐨勫揩





]]>
Burnside瀹氱悊http://www.shnenglu.com/logics-space/articles/78835.htmllogics_spacelogics_spaceFri, 03 Apr 2009 07:58:00 GMThttp://www.shnenglu.com/logics-space/articles/78835.htmlhttp://www.shnenglu.com/logics-space/comments/78835.htmlhttp://www.shnenglu.com/logics-space/articles/78835.html#Feedback0http://www.shnenglu.com/logics-space/comments/commentRss/78835.htmlhttp://www.shnenglu.com/logics-space/services/trackbacks/78835.html   burnside鏄竴縐嶈鏁版柟娉曪紝鐢ㄦ潵璁$畻鍚湁涓嶇瓑浠風被鐨勬暟閲忥紝 綆鍗曡灝辨槸瀵逛簬姣忎釜緗崲 fi 錛屼粬閮藉涓瀹氶噺鐨勭潃鑹叉棤鏁堬紙璇ョ潃鑹茬粡榪噁i緗崲涓嶅彉錛夛紝璁捐繖浜涚潃鑹叉暟閲忎負ai錛?nbsp; 鎵鏈塧i鐨勫鉤鍧囨暟灝辨槸涓嶇瓑浠風被鐨勬暟閲忥紝 褰撶劧涔熷彲浠ュ彉鎹㈡眰鍜岄『搴忥紝 鍏堣冭檻姣忎腑鐫鑹詫紝 鍐嶆眰浠栫殑紼沖畾鏍革紝 浣嗕竴鑸儏鍐墊槸緗崲鏁板緢灝戯紝 鐫鑹叉暟寰堝錛?鎵浠ュ墠鑰呭緢甯哥敤
   榪欓亾棰樻槸姣旇緝緇忓吀鐨勫驚鐜帓鍒楄鏁幫紝鏈?N 涓疆鎹 P^0 = r, P^1, P^2, P^(n-1)} r涓哄崟浣嶇疆鎹?br>   鍐欎釜灝忕▼搴忚瀵?錛屽彂鐜?P^x 鐨勫驚鐜粨鎭板ソ鏄痝cd錛坸 , N錛?br>
   榪欐牱鎴戜滑灝辨湁涓涓緝濂界殑姹傚拰寮忓瓙 錛?br>                                      
   浣哊鍙埌10^9錛岃繖涓眰鍜屽紡鐩存帴鐢ㄤ笉鐜板疄錛岀戶緇瀵燂紝鍙戠幇榪欎簺鏁伴兘鏄疦鐨勭害鏁幫紝鑷劧浼氭兂鏀瑰彉姹傚拰欏哄簭錛屽厛鑰冭檻姣忎釜綰︽暟錛屾垜鍙堝啓浜嗕釜灝忕▼搴忚緭鍑烘瘡涓害鏁扮殑鏁伴噺錛堜竴寮濮嬪氨鐭ラ亾浠栧ぇ姒傝窡嬈ф媺鏁版湁鍏崇郴錛屼絾娌℃湁鍙戠幇鏄庢樉鐨勭Н鎬э級錛屾墦鍑鴻〃鏉ヤ竴鐪嬶紝鍘熸潵鍥犲瓙x鐨勬暟閲忔槸Phi錛圢/x錛夛紱榪欐牱寮忓瓙灝卞彉鎴愪簡                   

     φ(N/pi)灝辨槸 1 -- N 涓墍鏈夋弧瓚砱cd(i,N)=pi 鐨?i 鐨勪釜鏁?br>                      (Hint gcd錛坕,N錛?pi 絳変環(huán)浜?gcd(i/pi,N/pi)=1 )

   瑕佺害鏁板敖閲忕殑澶氾紝灝辮涓嶅悓鐨勭礌鍥犲瓙灝介噺澶氾紝N鏈澶氫笉浼氭湁10涓笉鍚岀殑绱犲洜瀛愶紝綰︽暟涓嶄細瓚呰繃1024涓紝鑰屼笖綰︽暟瓚婂錛岀害鏁板氨浼氬彉灝忥紝姹傜害鏁扮殑嬈ф媺鏁拌櫧鐒舵槸O( sqrt(N) )鐨勶紝浣嗛渶瑕佸浜庡叾涓竴涓害鏁拌綆楄秴榪?0嬈$殑涓嶄細瓚呰繃3涓紝鏈変簡榪欎簺浼拌錛岃櫧鐒跺叿浣撶殑綆楁硶澶嶆潅搴︿笉鐭ラ亾錛?鎴戝喅瀹氬啋闄╄瘯璇曪紝搴旇涓嶄細瓚呮椂銆傜粨鏋滆窇浜?00ms錛岃繕鏄瘮杈冪悊鎯崇殑




logics_space 2009-04-03 15:58 鍙戣〃璇勮
]]>
亚洲色欲久久久综合网| 91久久九九无码成人网站| 欧美一区二区久久精品| 思思久久99热只有频精品66| 久久精品国产亚洲AV蜜臀色欲 | 久久精品女人天堂AV麻| 久久婷婷人人澡人人| 无码久久精品国产亚洲Av影片 | 99久久精品九九亚洲精品| 久久精品国产精品亚洲艾草网美妙| 亚洲欧美一级久久精品| 久久久久国产一级毛片高清版| 亚洲国产一成久久精品国产成人综合| 伊人久久大香线蕉av一区| 久久精品国产一区二区三区| 色88久久久久高潮综合影院| 久久天天躁狠狠躁夜夜av浪潮| 久久亚洲AV成人无码电影| 亚洲国产综合久久天堂| 国产精品无码久久久久| 久久久久久午夜成人影院| 亚洲日本va午夜中文字幕久久 | 岛国搬运www久久| 久久A级毛片免费观看| 伊人久久综合精品无码AV专区| 久久久久女教师免费一区| 久久亚洲精品中文字幕三区| 欧美大香线蕉线伊人久久| 久久无码高潮喷水| 久久夜色精品国产噜噜亚洲a| 久久精品国产一区二区电影| 色综合久久精品中文字幕首页| 久久亚洲精品成人av无码网站| 新狼窝色AV性久久久久久| 久久国产AVJUST麻豆| 久久精品亚洲AV久久久无码| 国产精品久久久久a影院| 2021最新久久久视精品爱| 国产香蕉久久精品综合网| 久久天天婷婷五月俺也去| 久久人人爽人人爽人人av东京热 |