1-04-01から1ヶ月間の記事一覧

クッキークリッカー戦略、一周目

J

-- hour 000(000): Chips 0 : Acv 1 -- 1.00e-01 C001 +15 clicks 2.00e-01 C[1] (16 s) +98 clicks [Achievement: 100 cookies] 4.00e-01 C[2] (33 s) +196 clicks 8.00e-01 C002 +4 clicks 1.20e+00 C003 +4 clicks 1.60e+00 C004 +5 clicks 2.00e+00 C005…

クッキークリッカー戦略、旧データ

J

Old, V1.036 -- hour 000: 0 Chips : 1 Acv -- CpS Buy Wait time 1.00e-01 C001 +15 clicks 2.00e-01 C[1] (16 s) +98 clicks 4.00e-01 C[2] (33 s) +196 clicks 8.00e-01 C002 +4 clicks 1.20e+00 C003 +4 clicks 1.60e+00 C004 +5 clicks 2.00e+00 C005 +…

クッキークリッカー3周目以降の戦略

J

リセットするタイミング。その周での獲得HC/その周のプレイ時間、が最大になる時点。 Reset 2 HC 642 (+247) hour 1.8875e+02 HC/H 1.31 Cookie 206,430,000,000,000 Reset 3 HC 922 (+279) hour 3.7772e+02 HC/H 1.48 Cookie 425,079,000,000,000 Reset 4 H…

クッキークリッカー二周目以降の戦略

J

Achievementは86〜88持ち越しを想定。 リセット一回目はチップ168枚でスタートし、+227枚獲得でリセット Start HC 168 +HC 227 Cookies 78,210,000,000,000,000 -- hour 000: 0 Chips : 86 Acv -- 4.60e-01 C001 +3 clicks 9.20e-01 C[1] (15 s) +20 clicks …

Seating Optimization

Solve http://q.hatena.ne.jp/1355418360 #include <stdio.h> #include <math.h> #include <stdlib.h> class WangLandau { public: // 1-dim constructor WangLandau(long long emin, long long emax,double pip = 0.2, int histmin=10000); // constructor for multi-dimensional energ</stdlib.h></math.h></stdio.h>…

Enumeration of Self-Avoiding Walks

up.c #include <stdio.h> #include <stdlib.h> #define DIM 2 // square lattice #define NDIR (2*DIM) int L; // grid size int nsite; // = (L+1)^2 int *f_visited; // 0/1 = un/occupied int *nnp; // neighbour index int drvec[NDIR][DIM] = { {-1,0}, {0,-1}, {1,0}, {0,</stdlib.h></stdio.h>…

Maximize (L1+L2+..)!/L1!L2!..

Under restriction of Li>1 and L1+2L2+3L3..=N #include <stdio.h> #include <stdlib.h> #include <math.h> #define NMAX 300 int N; double lfactab[NMAX]; // log(n!) double logfac(int n) { double res=0; int i; for(i=2;i<=n;i++)res += log(i*1.0); return res; } // tabulize l</math.h></stdlib.h></stdio.h>…

French fry Length distribution Monte Carlo

#include <stdio.h> #include <stdlib.h> #include <math.h> #include "mymath.h" #define RAD1 13.0 #define RAD2 10.0 #define RAD3 10.0 double ax1[3], ax2[3], ax3[3]; double co2; void i_axis() { double th1=rand()*1.0/RAND_MAX*3.14159*2; // 0 to 2pi double z=rand()*2.0/RA</math.h></stdlib.h></stdio.h>…

Optimization of grouping of 10 to 30 attendants

http://q.hatena.ne.jp/1317373518 #include <stdio.h> #include <stdlib.h> #include <strings.h> #include "wl.h" // default group size #define GS 4 int np;// number of attendants int ngroup; // number of groups int ns; // number of stages int *groupid, *nmember, *g_ofs; in</strings.h></stdlib.h></stdio.h>…

isort.h isort.cc

isort.h #ifndef BTREEH #define BTREEH // binary tree class class Btree { public: // insert a pointer associated with a key into the list class BtNode *Insert(int key, void *iptr); // delete a node class BtNode *Delete(class BtNode *bt); //…

multi-dimensional data comparison: using sort list

#include <stdio.h> #include <stdlib.h> #include "isort.h" #define NDAT 100000 #define DIM 10 class Obj { public: BtNode *bn[DIM]; int val[DIM]; int rank[DIM]; int idx; int flag; int flag2; class Obj *next; class Obj *prev; }; //simple list Obj *oHead=NULL; v</stdlib.h></stdio.h>…

multi-dimensional data comparison: simple comparison

#include <stdio.h> #include <stdlib.h> #define NDAT 10000000 #define DIM 3 class Obj { public: int val[DIM]; int rank[DIM]; int idx; int flag; int flag2; class Obj *next; class Obj *prev; }; //simple list Obj *oHead=NULL; void AddObj(Obj *o) { o->prev=NULL; </stdlib.h></stdio.h>…

Risk/Return calculation

//risk and return calculation #include <stdio.h> #include <stdlib.h> #include <math.h> // number of games #define N 100 // return #define R 1.5 // win prob #define P 0.8 // log of binary distribution probability // log( nCm p^n (1-p)^m) double logBP(double p, int n,</math.h></stdlib.h></stdio.h>…

Prime number table

#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <math.h> int main(int argc, char **argv) { long long start = atoll(argv[1]); long long end = atoll(argv[2]); // make start even start -= start&1; printf("start = %015lld end=%015lld ",start, end); long long l</math.h></strings.h></stdlib.h></stdio.h>…

Z^Z^Z.. Julia set

#include <stdio.h> #include <stdlib.h> #include <math.h> // color stuff void hue2rgb(int hue, int vmax, int *r, int *g, int *b) { int *max=r; int *p1=g; int *p2=b; int h0= hue+60; if(h0>=360)h0-=360; if(h0>=240) { max=b; p1=r; p2=g; h0-=240; } else if(h0>=120) { max</math.h></stdlib.h></stdio.h>…

Z^Z^Z^Z .. Mandelblot set

#include <stdio.h> #include <stdlib.h> #include <math.h> // color stuff void hue2rgb(int hue, int vmax, int *r, int *g, int *b) { int *max=r; int *p1=g; int *p2=b; int h0= hue+60; if(h0>=360)h0-=360; if(h0>=240) { max=b; p1=r; p2=g; h0-=240; } else if(h0>=120) { max</math.h></stdlib.h></stdio.h>…

Marhjong win check: ver 0.1

%a.out 1112345678999 Initial:1112345678999 [OK]:(99)(*111)(*123)(456)(789) [OK]:(99)(*123)(*111)(456)(789) [OK]:(*22)(111)(345)(678)(999) [OK]:(11)(12*3)(*345)(678)(999) [OK]:(99)(111)(23*4)(*456)(789) [OK]:(*55)(111)(234)(678)(999) [OK]:(…

Marhjong win check: ver 0.2

%a.out 1112345678999 [23](111)(456)(789)(99) (123)[11](456)(789)(99) (111)(345)(678)(999)[2] (123)[45](678)(999)(11) (111)(234)[56](789)(99) (111)(234)(678)(999)[5] (123)(456)[78](999)(11) (111)(234)(567)[89](99) (111)(234)(567)(999)[8] (1…

Tetris AllRGB

// Block shapes // block type *7, rotation*4, x-posision*4 int nrot[7]; // number of rotated shapes int bs_wid[7][4]; // width int bs_ofs[7][4][4]; int bs_hei[7][4][4]; int bs_min[7][4]; //min y at x int bs_pos[7][4][4]; void init_bs_aux(i…

RingBuffer Code

RingBuf.h #ifndef RINGBUFH #define RINGBUFH // Ring Buffer manager class RingBuf { public: RingBuf(int size); void Loop1(); bool Loop2(); void Loop3(); int LoopIdx(); #define RBFOR(x) for((x)->Loop1();(x)->Loop2();(x)->Loop3()) // example:…

Diffusion-limited aggregation code

This code generates this picture http://allrgb.com/dla which uses each 2^24 color once and only once. DLA rule is tweaked a bit to generate nice picture.Save as dla.cc , just compile it cc dla.cc, and run "a.out Number.of.Seeds" // Bits pe…

AllRGB Monte Carlo

// Bits per plane. Must be even and <=8, namely either 2, 4, 6, 8 #define CBIT 8 //Address scheme 4=fastest #define ADR_SCHEME4 //Color Address scheme #define CADR_SCHEME0 //#define CIDX3 // norm L1 or L2N or HIE #define L1 // temperature …

Konpeito

// vis.h extern void cbar(int sx, int sy, int wx, int wy); //extern void draw_line(int x1, int y1, int x2, int y2, double d); //extern void draw_line(int x1, int y1, double z1, int x2, int y2, double z2, double d); extern void screen_range…

3D fractal

#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <math.h> #define L 400 int cnt[L][L]; #define SCALE 0.7 #define CMAX (9) void dump() { FILE *fp=fopen("a.pgm","w"); fprintf(fp, "P5\n%d %d\n255\n",L,L); int ix,iy; for(ix=0;ix</math.h></strings.h></stdlib.h></stdio.h>

AllRGB Annealing code

#include <stdio.h> #include <stdlib.h> #include <strings.h> #include <math.h> // Bits per plane. Must be even and <=8, namely either 2, 4, 6, 8 #define CBIT 4 // temperature range #define BMAX 10.0 #define BMIN (1e-2) // steps #define TDIV 1000 #define MAXS 1000 // Penalty for</math.h></strings.h></stdlib.h></stdio.h>…

SuperCon 2006

#include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> #define N 3000 typedef unsigned char mtype; mtype mij0[N][N]; // for compressed row matrix storage int nnz[N]; unsigned short *jnz[N]; mtype *mij[N]; // Number of switch #define MAXQ 6 unsigned char </string.h></math.h></stdlib.h></stdio.h>…

tab-leap.c ver 0.7

#include <stdio.h> #include <stdlib.h> typedef unsigned long long U64; typedef unsigned short gtype; typedef struct leap_data { // Transform x = (x>>LEAP_BITS)*a+b U64 a, b; // Threshold to switch 64+48 bit op. U64 threshold; gtype g; } leap_data; extern voi</stdlib.h></stdio.h>…

tab-co.c ver 0.7

#include <stdio.h> #include <stdlib.h> typedef unsigned long long U64; typedef unsigned short gtype; typedef struct filter_data { unsigned int val; U64 amin; U64 bmin; gtype gmin; } filter_data; void init_filter_data(int bits, filter_data *f) { U64 a = (1<<bits); U64 b = (f->va</bits);></stdlib.h></stdio.h>…

main.c Ver 0.7

#include <stdio.h> #include <stdlib.h> typedef unsigned long long U64; typedef unsigned short gtype; typedef struct filter_data { unsigned int val; U64 amin; U64 bmin; gtype gmin; } filter_data; typedef struct leap_data { // Transform x = (x>>LEAP_BITS)*a+b </stdlib.h></stdio.h>…

#include <stdio.h> #include <stdlib.h> typedef unsigned long long U64; typedef unsigned short gtype; gtype gmax = 1; U64 kmax = 1; #define LEAP_BITS 10 #define LEAP_N (1<</stdlib.h></stdio.h>