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; | |
#define times(n, i) uptil(0, n, i) | |
#define upto(f, t, i) for(auto _##i = (t), i = decltype(_##i)(f); i <= _##i; i++) | |
#define uptil(f, t, i) for(auto _##i = (t), i = decltype(_##i)(f); i < _##i; i++) | |
#define downto(f, t, i) for(auto _##i = (t), i = decltype(_##i)(f); i >= _##i; i--) | |
#define downtil(f, t, i) for(auto _##i = (t), i = decltype(_##i)(f); i > _##i; i--) | |
#define unless(c) if(!(c)) | |
#define until(c) while(!(c)) |
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; | |
#define times(n, i) uptil(0, n, i) | |
#define upto(f, t, i) for(auto _##i = (t), i = decltype(_##i)(f); i <= _##i; i++) | |
#define uptil(f, t, i) for(auto _##i = (t), i = decltype(_##i)(f); i < _##i; i++) | |
#define downto(f, t, i) for(auto _##i = (t), i = decltype(_##i)(f); i >= _##i; i--) | |
#define downtil(f, t, i) for(auto _##i = (t), i = decltype(_##i)(f); i > _##i; i--) | |
#define unless(c) if(!(c)) | |
#define until(c) while(!(c)) |
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 times(n, i) uptil(0, n, i) | |
#define upto(f, t, i) for(auto _##i = (t), i = decltype(_##i)(f); i <= _##i; i++) | |
#define uptil(f, t, i) for(auto _##i = (t), i = decltype(_##i)(f); i < _##i; i++) | |
using namespace std; | |
int main(){ | |
int A, B, C; |
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; | |
template<class T> class BIT{ | |
private: | |
/** | |
* [---------------------8] | |
* [---------4] | |
* [---2] [---6] | |
* [1] [3] [5] [7] [9] |
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
s=[];gets.split.each{|x|s<<(x=~/\d/?x.to_i: (a,b=s.pop 2;b.send x,a))};p s[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
+-+-+ | |
|a|b| | |
| +-+-+ | |
| |c|d| | |
| | +-+ | |
| | |e| | |
+-+-+-+ | |
f(a) → <tr><td rowspan>a</td>f(b)f(c) | |
f(b) → <td>b</td></tr> | |
f(c) → <tr><td rowspan>c</td>f(d)f(e) |
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
*{ | |
font-family: serif; | |
} | |
#top{ | |
display: table; | |
} | |
ul{ | |
display: inline; |
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
* aa * b | |
* c | |
* d | |
* e * f * g | |
* h | |
* ii * j | |
* k | |
* l | |
[bad] |
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
#define times(n, i) for(auto i = remove_reference<decltype( (n) )>::type(0); i < (n); i++) | |
#define upto(f, t, i) for(auto i = remove_reference<decltype((t)-(f))>::type(f); i <= (t); i++) | |
#define downto(f, t, i) for(auto i = remove_reference<decltype((t)-(f))>::type(f); i >= (t); i--) | |
#define uptil(f, t, i) for(auto i = remove_reference<decltype((t)-(f))>::type(f); i < (t); i++) | |
#define downtil(f, t, i) for(auto i = remove_reference<decltype((t)-(f))>::type(f); i > (t); i--) |
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
$id = ARGV[0] | |
`g++ -Wall -std=c++11 -O2 #$id/program#$id.cpp` | |
1.upto 5 do |x| | |
puts "begin #{x}:\t" + File.read("#$id/2016-yo-t#$id-in#{x}.txt").lines.first.chomp + "..." | |
result = `a < #$id/2016-yo-t#$id-in#{x}.txt` | |
puts "end #{x}:\t\t" + result.lines.first.chomp + "..." | |
File.write "#$id/out#$id-#{x}.txt", result | |
end |