Skip to content

Instantly share code, notes, and snippets.

@miura1729
miura1729 / gist:a130a7ba29a80ea167c054e0af9de60d
Created October 18, 2020 06:32
個人的に一番速いと思うナベアツ問題のプログラム
#include <unistd.h>
#define BUFSIZE 65536
char buf[BUFSIZE];
int
main(int argc, char *argv)
{
unsigned int i;
unsigned int ketapos = 0;
unsigned int bufpos = 0;
i = 0;
MTypeInf::LiteralType#== 24954.78657
79661110 738.81190 OP_ENTER 1:0:0:0:0:0:0
79661110 394.97754 OP_LOADSELF R3
79661110 3864.99854 OP_SEND R3 :class 0
79661110 475.33513 OP_MOVE R4 R1
79661110 3163.00693 OP_SEND R4 :class 0
79661110 2013.31926 OP_EQ R3 :== 1
79661110 611.30177 OP_JMPNOT R3 005
54258651 777.50481 OP_GETIV R3 @class_object
54258651 335.72749 OP_MOVE R4 R1
#include <mruby.h>
#include <mruby/value.h>
#include <mruby/array.h>
#include <mruby/hash.h>
#include <mruby/throw.h>
#include <mruby/proc.h>
#include <mruby/string.h>
#include <mruby/range.h>
#include <mruby/error.h>
#include <math.h>
class Context
WHITE_SPACES = [" ", "\t", "\r", "\n"]
NUMBER_LETTERS = '0123456789+-.eE'
HEX_LETTERS = '0123456789abcdef'
def initialize(s)
@buf = s
@index = 0
@length = s.size
end
#include <mruby.h>
#include <mruby/value.h>
#include <mruby/array.h>
#include <mruby/hash.h>
#include <mruby/throw.h>
#include <mruby/proc.h>
#include <mruby/string.h>
#include <mruby/range.h>
#include <mruby/error.h>
#include <math.h>
#include <mruby.h>
#include <mruby/value.h>
#include <mruby/array.h>
#include <mruby/hash.h>
#include <mruby/throw.h>
#include <mruby/proc.h>
#include <mruby/string.h>
#include <mruby/range.h>
#include <mruby/error.h>
#include <math.h>
#include <mruby.h>
#include <mruby/value.h>
#include <mruby/array.h>
#include <mruby/hash.h>
#include <mruby/throw.h>
#include <mruby/proc.h>
#include <mruby/string.h>
#include <mruby/range.h>
#include <mruby/error.h>
#include <math.h>
static mrb_value next__Context__4(mrb_state *mrb, struct cls1_29 * self, struct gctab *prevgctab) {
struct env35 env;
struct REnv *venv = NULL;
char *v24890;
mrb_int v24891;
mrb_value v24893;
mrb_int v24895;
struct gctab *gctab = (struct gctab *)alloca(sizeof(struct gctab));
gctab->ret_status = 0;
L1485:;
#include <stdio.h>
main()
{
unsigned char base[] = {0x03, 0x10, 0x21, 0x44, 0xf0, 0xe1, 0x98, 0x21};
unsigned char keys[8] = {0, 0, 0, 0, 0, 0, 0, 0};
unsigned char key = 0xf0;
unsigned char kt;
unsigned char tmp = 0xff;
#include <mruby.h>
#include <mruby/value.h>
#include <mruby/array.h>
#include <mruby/throw.h>
#include <mruby/proc.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#undef mrb_int
typedef mrb_float mrb_float2;