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
#ある数より前のリストl1から選ぶよ | |
#ある数より後ろのリストはl2だよ | |
def choose_l1(l1,l2,zigzaglist): | |
global zigzagnum,write_flag | |
#前のリストがなかったら終わるよ | |
if l1==[]: | |
if l2==[]: | |
zigzagnum +=1 | |
return 1 | |
else: |
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 itertools | |
import numpy | |
def getZigZagNumber(num): | |
# 0, 1, 2番目のZig-Zag Numberは1と定義 | |
if (num == 0) or (num == 1) or (num == 2): | |
return 1 | |
else: | |
alterPerm = 0 | |
for perm in itertools.permutations(list(range(num))): | |
frontSign = 0 |
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 <cmath> | |
#include <vector> | |
#include <fstream> | |
#include <functional> | |
double fp(double phi, double a, double x, double y) { | |
return std::tan(0.5 * (phi + std::atan(y / (x - a)))); | |
} |
OlderNewer