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
| require 'yaml' | |
| yml_string = '' | |
| yml_datas = YAML.safe_load(File.read(ARGV[0])) | |
| yml_datas[0].each do |key| | |
| yml_string += key[0] == 'date' ? key[0].to_s : "\t#{key[0]}" | |
| end | |
| yml_string += "\n" | |
| yml_datas.each do |datas| | |
| data = '' |
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
| require 'yaml' | |
| TSV_DATA = File.read(ARGV[0]).split("\n") | |
| title = TSV_DATA[0].split(/\t/) | |
| hash_data = [] | |
| TSV_DATA.drop(1).each do |datas| | |
| h = {} | |
| data = datas.split(/\t/) | |
| (0..title.length - 1).each { |i| h[title[i]] = data[i] } |
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
| def fizzbuzz(size) | |
| ary = [] | |
| 1.upto size do |temp| | |
| ary << fizz_or_buzz_or_fizzbuzz(temp) | |
| end | |
| ary.collect! { |a| yield(a) } if block_given? | |
| ary | |
| end | |
| def fizz_or_buzz_or_fizzbuzz(temp) |
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
| git rm -r --cached . | |
| git add . | |
| git commit -m ".gitignore is now working" |
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<algorithm> | |
| #include<cstdio> | |
| #include<queue> | |
| #include<stack> | |
| #include<string> | |
| using namespace std; | |
| const int N = 100; |
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> | |
| using namespace std; | |
| const int N = 30; | |
| struct Node | |
| { | |
| int pr; | |
| int left; | |
| int right; |
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<cstdio> | |
| #include<queue> | |
| using namespace std; | |
| const int N = 100; | |
| struct Node { | |
| int parent; | |
| int left; | |
| int right; | |
| //output |
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<cstdio> | |
| #include<vector> | |
| using namespace std; | |
| const int N = 100005; | |
| struct Node | |
| { | |
| string type; | |
| int parent; |
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> | |
| #define swap(x, y) {Node z = x; x = y; y = z;} | |
| using namespace std; | |
| const int N = 100005; | |
| struct Node { | |
| char suit; | |
| int number; | |
| int index; | |
| }; |
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> | |
| #define swap(x, y) {int z = x; x = y; y = z;} | |
| using namespace std; | |
| const int N = 100005; | |
| int Partition(int *a, int p, int r){ | |
| int x = a[r]; | |
| int i = p-1; | |
| for(int j = p; j < r; j++){ | |
| if(a[j] <= x){ | |
| i++; |
NewerOlder