This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ##n番目のフィボナッチ数をLで割ったあまり | |
| def sq((a,b)): | |
| return ((a*a+2*a*b)%L,(a*a+b*b)%L) | |
| def succ((a,b)): | |
| return ((a+b)%L,a%L) | |
| def fibb(n): | |
| if n==1:return (1,0) | |
| if n&1:return succ(fibb(n-1)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sst=""" | |
| import datetime,sys | |
| def put(t,x,y,z): | |
| global st | |
| for i in range(x): | |
| if(([1073733607,2911164709,1067450341,2778089573,1067438055][(z>1)+(z>5)+(z>7)+(z>11)]>>3*ord(t)-144)&y)==y: | |
| sys.stdout.write(st[0]) | |
| st=st[1:]+chr(118) | |
| else:sys.stdout.write(chr(32)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sst=""" | |
| import datetime,sys | |
| def put(t,x,y,z): | |
| global st |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import division | |
| def zenka(a): | |
| p=6 | |
| res=0 | |
| list=[0]*(a-1) | |
| list[0]=6 | |
| for x in range(100000): | |
| res+=(x+2)*list[-1]/(p*6) | |
| p*=6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import division | |
| def zenka(a): | |
| p=6 | |
| res=0 | |
| list=[0]*(a-1) | |
| list[0]=6 | |
| for x in range(10000): | |
| res+=(x+2)*list[-1]/(p*6) | |
| p*=6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import division | |
| from random import randint | |
| def dices(a): | |
| t=randint(1,6) | |
| j=1 | |
| res=1 | |
| while(a!=j): | |
| p=randint(1,6) | |
| if(p==t): | |
| j+=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import pygame | |
| from pygame.locals import * | |
| pygame.init() | |
| N=15 ## w | |
| M=15 ## h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<stdio.h> | |
| #include<string.h> | |
| int n,m,table[20],Fill,Maxima,Answer; | |
| int count_bin(int a){ | |
| int res=0; | |
| while(a>0){ | |
| res+=a&1; | |
| a>>=1; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<stdio.h> | |
| int table; | |
| int solve(int x){ | |
| int n=table,i,y=(1<<25)-1,z=(1<<25)-1; | |
| for(i=0;i<25;i+=5)y-=1<<i; | |
| for(i=4;i<25;i+=5)z-=1<<i; | |
| y&=x; | |
| z&=x; | |
| n^=x; //真ん中 | |
| n^=x<<5; //上 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include<stdio.h> | |
| #include<string.h> | |
| char a[501],b[501]; | |
| int c,table[10][500][3][3][500][3]; | |
| int solve(int num,int mod,int big,int small,int keta,int zigzag){ | |
| int res=0,i; | |
| if(table[num][mod][big][small][keta][zigzag]!=-1)return table[num][mod][big][small][keta][zigzag]; | |
| else if(keta>strlen(b))return table[num][mod][big][small][keta][zigzag]=0; | |
| else{ |