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
# | |
#=Ruby Cheat Sheet for Beginner | |
# | |
################################################## | |
# 複数行コメント | |
################################################## | |
=begin | |
コメント |
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
# | |
#=Ruby Cheat Sheet for Beginner | |
# | |
################################################## | |
# 複数行コメント | |
################################################## | |
=begin | |
コメント |
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
#include <iostream> | |
#include <vector> | |
#include <map> | |
#include <climits> | |
using namespace std; | |
typedef pair<int, int> Edge; | |
typedef map<int, int> Vertex; | |
typedef vector<Vertex> Graph; |
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
(defparameter *problem-num* 10) | |
(if (> (length *args*) 0) (defparameter *problem-num* (parse-integer (car *args*)))) | |
(setf *random-state* (make-random-state t)) | |
(defun rand-elt (lst) (elt lst (random (length lst)))) | |
(defun rand-range (min max) (let ((r (random (- max min)))) (+ r min))) | |
(defun 1+rand (m) (1+ (random m))) | |
(defun divisor-lst (num mindiv maxdiv) | |
(let ((lst '())) | |
(do ((n mindiv (1+ n))) | |
((or (>= n num) |
NewerOlder