Skip to content

Instantly share code, notes, and snippets.

View paralleltree's full-sized avatar
🐱
Meow

Ryo Namiki paralleltree

🐱
Meow
View GitHub Profile
@paralleltree
paralleltree / procon.cs
Created March 26, 2015 11:11
学内プロコン(15/03/26)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class Program
{
// ref: https://github.com/OCTPC/miniprocon/blob/master/miniprocon002/regulation.md
static void Main(string[] args)
{
@paralleltree
paralleltree / priorityqueue.cs
Created March 23, 2015 08:13
Implementation of priority queue in C#.
class PriorityQueue
{
public List<int> list;
public int Count { get { return list.Count; } }
public PriorityQueue()
{
list = new List<int>();
}
@paralleltree
paralleltree / client.cs
Created March 19, 2015 12:08
学内プロコン(15/03/19)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Net;
class Client
{
readonly string Token = "unique_token";
@paralleltree
paralleltree / procon.cs
Last active August 29, 2015 14:16
学内プロコン(15/03/11)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading.Tasks;
using System.Net;
namespace Procon
{
# !/bin/sh
readonly target="target_name" # "abc.rb"
readonly execute="execution_command" # "ruby abc.rb &" or "ruby ${target} &"
while true
do
proc=$(ps -ef | grep ${target} | grep -v grep | wc -l)
if [ ${proc} = 0 ]; then
echo "Target process was terminated!!"
${execute}
@paralleltree
paralleltree / abc015c.cs
Last active August 29, 2015 14:10
[ABC#015] C問題完答までの道程
// 2014/11/23 11:16:20
// AC: 24, WA: 0
// http://abc015.contest.atcoder.jp/submissions/283939
// 敗因: n = 1のときの場合分け不足
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class C1
@paralleltree
paralleltree / Nyan.cs
Last active August 29, 2015 14:08
CODE RUNNER 予選B
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
class Nyan
{
string attack = "https://game.coderunner.jp/attack?token=xxxxxxxx&skill={0}";
void Work()
@paralleltree
paralleltree / lazytrap.cs
Created September 21, 2014 09:35
遅延実行で嵌った罠。いちいち新しいインスタンスが作成されてしまう。
using System;
using System.Collections.Generic;
using System.Linq;
static class Program
{
static void Main(string[] args)
{
string[] inner = new string[] { "a", "b", "c", "d", "e" };
string[] outer = new string[] { "b", "d" };
@paralleltree
paralleltree / stap.cs
Created June 28, 2014 09:46
STAP細胞を探すC#コード
using System;
using System.Linq;
namespace STAP
{
class Program
{
static void Main(string[] args)
{
var rnd = new Random();
@paralleltree
paralleltree / runcsc.bat
Last active August 29, 2015 14:01
C#ソースファイルのコンパイル補助バッチ
@echo off
echo C Sharp Compile Assistant
PATH="%WINDIR%\Microsoft.NET\Framework\v1.0.3705";%PATH%
PATH="%WINDIR%\Microsoft.NET\Framework\v1.1.4322";%PATH%
PATH="%WINDIR%\Microsoft.NET\Framework\v2.0.50727";%PATH%
PATH="%WINDIR%\Microsoft.NET\Framework\v3.0";%PATH%
PATH="%WINDIR%\Microsoft.NET\Framework\v3.5";%PATH%
PATH="%WINDIR%\Microsoft.NET\Framework\v4.0.30319";%PATH%