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 os, sys | |
| n = int(input()) | |
| if n < 0: | |
| print("invalid") | |
| sys.exit() | |
| A = {} | |
| A[0] = "∅" | |
| A[1] = "{{{}}}".format(A[0]) | |
| for i in range(2, n+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
| int main(string[] args) { | |
| import std.net.curl, std.parallelism, std.conv, std.stdio, std.range; | |
| auto URL = "http://nyanpass.com/add.php"; | |
| if(args.length <= 1) { | |
| writeln("Usage: nyanpass <count>"); | |
| return 1; | |
| } | |
| ulong count; | |
| try { |
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
| /* | |
| * このC++ソースは下記の環境での実行を確認しています。 | |
| * Linux arch-note 4.14.13-1-ARCH #1 SMP PREEMPT Wed Jan 10 11:14:50 UTC 2018 x86_64 GNU/Linux | |
| * | |
| * コンパイル時コマンド: g++ mine.cpp | |
| * コンパイラ: バージョン 7.2.1 20171224 (GCC) | |
| * | |
| * | |
| * Darwin MacBook-Air.local 17.5.0 Darwin Kernel Version 17.5.0: Fri Apr 13 19:32:32 PDT 2018; root:xnu-4570.51.2~1/RELEASE_X86_64 x86_64 | |
| * コンパイル時コマンド: g++ -std=c++11 mine.cpp |
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
| function mkd | |
| if not set -q argv[1] | |
| echo "mkd: No file selected." | |
| return 1 | |
| end | |
| touch $argv[1] | |
| open $argv[1] | |
| end |
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
| rgcc() { | |
| if [ ! -e $1 ]; then | |
| echo "rgcc: No file selected." | |
| return; | |
| fi | |
| tmpdir=$(mktemp -d -t rgcc) | |
| tmpfilename=$RANDOM | |
| gcc $1 -lc++ -o "$tmpdir/$tmpfilename" | |
| if [ $? -gt 0 ]; then | |
| 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
| _0 ₀ 名詞 | |
| _1 ₁ 名詞 | |
| _2 ₂ 名詞 | |
| _3 ₃ 名詞 | |
| _4 ₄ 名詞 | |
| _5 ₅ 名詞 | |
| _6 ₆ 名詞 | |
| _7 ₇ 名詞 | |
| _8 ₈ 名詞 | |
| _9 ₉ 名詞 |
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
| from xml.etree import ElementTree | |
| from sys import argv, exit | |
| import os.path | |
| if len(argv) <= 2: | |
| print("Too few arguments: <command> <path> <output>") | |
| print("BE CAREFUL NOT TO OVERWRITE YOUR IMPORTANT DATA.") | |
| print("This script writes the output even if there's already a file named <output>.") | |
| 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
| class UnionFind(T) { | |
| T[] arr; | |
| this(ulong n) { | |
| arr.length = n+1; | |
| arr[] = -1; | |
| } | |
| T root(T x) { | |
| return arr[x] < 0 ? x : root(arr[x]); | |
| } | |
| bool same(T x, T y) { |
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
| void main() { | |
| auto N = ri; | |
| auto a = readAs!(int[]); | |
| generate_prime_list(55555); | |
| SortedRange!(int[]) pl = prime_list.sort; | |
| if(a.sort.uniq.array.length != a.length || a.length != N) { | |
| "WA".writeln; | |
| return; | |
| } | |
| foreach(i; a) { |
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
| T[] deepcopy(T)(T[] a) { | |
| import std.traits : isArray; | |
| static if(isArray!T) { | |
| T[] res; | |
| foreach(i; a) { | |
| res ~= deepcopy(i); | |
| } | |
| return res; | |
| } else { | |
| return a.dup; |