This file contains 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 <iostream> | |
#include <utility> | |
#include <algorithm> | |
#include <vector> | |
int calc_bonus(int streak) { | |
if (streak == 2 || streak == 3) { | |
return 1; | |
} else if (streak == 4) { | |
return 2; |
This file contains 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
#pragma GCC optimize ("O3") | |
#include <algorithm> | |
#include <cstdlib> | |
#include <iostream> | |
#include <map> | |
#include <sstream> | |
#include <vector> | |
#include <set> | |
#include <string> |
This file contains 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 <bits/stdc++.h> | |
using namespace std; | |
typedef long long ll; | |
int main(int argc, char** argv) { | |
if (argc != 4) { | |
cerr << "arguments" << endl; | |
return 0; | |
} | |
int n = atoi(argv[1]); |
This file contains 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
// C++11 | |
#include <cstdlib> | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <string.h> | |
#include <random> | |
using namespace std; |
This file contains 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 <time.h> | |
#include <unistd.h> | |
#include <stdint.h> | |
#include <intrin.h> | |
uint64_t rdtsc(){ | |
return __rdtsc(); | |
} | |
int name[4], a1[4], a2[4]; |
This file contains 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
import java.util.Random; | |
final int SIZE = 500; | |
int TIMER = 0; | |
int[][][] board = new int[SIZE][SIZE][3]; | |
int[][][] buffer = new int[SIZE][SIZE][3]; | |
boolean inside_board(int x, int y) | |
{ |
This file contains 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 <bits/stdc++.h> | |
#define rep(i,n) for(int i = 0; i < n; i++) | |
using namespace std; | |
//1-indexed, var..maxnum | |
vector<int> SA_IS(vector<int> str, int var) { | |
if(str.size() == 1) { | |
vector<int> ret(1,0); | |
return ret; | |
} |
This file contains 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 print_function | |
from PIL import Image | |
import copy | |
train = [] | |
test = [] | |
for loop in range(1,3): | |
train.append([]) | |
im = Image.open(str(loop)+".png") |
This file contains 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
import time | |
time_start = time.time() | |
import numpy as np | |
import chainer | |
from chainer import cuda, Function, gradient_check, Variable, optimizers, serializers, utils | |
from chainer import Link, Chain, ChainList | |
import chainer.functions as F | |
import chainer.links as L |
This file contains 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 <cstdio> | |
#include <vector> | |
#include <cstring> | |
using namespace std; | |
#define MAX_N 1000 | |
int n, m; //頂点数、辺数 | |
int cmp[MAX_N*2]; //属する強連結成分のトポロジカル順序 | |
vector<int> vs; //帰りがけ順の並び |
NewerOlder