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
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from sklearn.preprocessing import OneHotEncoder | |
| from sklearn.cross_validation import train_test_split | |
| np.random.seed(3) | |
| center0 = 3 * np.random.randint(-2, 2, 2) | |
| center1 = 3 * np.random.randint(-2, 2, 2) |
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
| import java.util.Scanner; | |
| class Hishigata { | |
| public static void main(String[] args) { | |
| int n = 0; | |
| try { | |
| n = Integer.parseInt(args[0]); | |
| } catch (NumberFormatException e) { |
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
| class Uzumaki { | |
| public static void main(String[] args) { | |
| int n = 0; | |
| try { | |
| n = Integer.parseInt(args[0]); | |
| } catch (NumberFormatException e) { | |
| System.err.println("Input Error : must be integer"); | |
| System.exit(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
| import java.util.Arrays; | |
| import java.util.List; | |
| import java.util.ArrayList; | |
| import java.util.Map; | |
| import java.util.HashMap; | |
| class Soroban { | |
| public static void main(String[] args) { | |
| int n = 0; |
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
| import java.util.Scanner; | |
| class Sanmoku { | |
| private int[][] ban; | |
| private static final int N = 3; | |
| Sanmoku() { | |
| ban = new int[N][N]; | |
| } |
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
| import sys | |
| def main(eq): | |
| eq = eq.replace("=", "==") | |
| for i in range(0, 10): | |
| try: | |
| if eval(eq.replace("X", str(i))): | |
| print("X=%d" % i) | |
| return |
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
| # 部分和問題 蟻本 p.34 | |
| # aからいくつか選び合計がkとなるかを判定 | |
| n = 4 | |
| a = [1, 2, 4, 7] | |
| k = 13 | |
| def dfs(i, sum): | |
| if i == n: | |
| return sum == k |
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
| # 水たまりのカウント | |
| # 蟻本 p.35 | |
| lake = """\ | |
| W........WW. | |
| .WWW.....WWW | |
| ....WW...WW. | |
| .........WW. | |
| .........W.. | |
| ..W......W.. |
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
| # 迷路の最短路 | |
| # 蟻本 p.37 | |
| N = 10 | |
| M = 10 | |
| meiro = """\ | |
| #S######.# | |
| ......#..# | |
| .#.##.##.# |
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
| # 迷路の経路を出力 | |
| import copy | |
| N = 10 | |
| M = 10 | |
| meiro = """\ | |
| #S######.# | |
| ......#..# | |
| .#.##.##.# |
OlderNewer