Skip to content

Instantly share code, notes, and snippets.

@kuuso
kuuso / PSwriter5.cs
Created September 6, 2015 15:31
postscriptWriterForMe
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Linq;
class TEST{
static void Main(){
new TEST().CreateCode();
【解答】
・第1問:2.01966
・第2問:3.10849098132
【方針】
(回答時コメント)
 良い方法が思いつかなかったので、苦し紛れのDPでの数え上げです。
 0から9の10文字の個数をそれぞれA[0],A[1],A[2],…,A[9]とすると、
 今回、n<=12なので、各A[i]は精々4bitで表されることから、64bit整数Sを用いて S=ΣA[i]<<4*i for i=0 to 9 で
 出目の状態をエンコードできます。
using System;
using System.Collections;
using System.Collections.Generic;
class TEST{
static void Main(){
Sol mySol =new Sol();
mySol.Solve();
}
}
@kuuso
kuuso / FastIn.cs
Created February 7, 2015 18:23
デカい入力用
using System;
using System.Text;
using System.IO;
class TEST{
static void Main(){
Sol mySol =new Sol();
mySol.Solve();
}
}
BEGIN {
// your code goes here
for(;i<122;)A[sprintf("%c",i)]=++i;for(;j<17;){s=">";for(k=A[substr("deathma colosseum",++j,1)];k--;s=s"+");printf s"."}
}
{
// your code goes here
}
using System;
using System.Collections;
using System.Collections.Generic;
class TEST{
static void Main(){
Sol mySol =new Sol();
mySol.Solve();
}
}
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
class TEST{
static void Main(){
String InputFile="./data.utf8.txt";
StreamReader SR=new StreamReader(InputFile);
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
class TEST{
static void Main(){
String InputFile="./data.utf8.txt";
StreamReader SR=new StreamReader(InputFile);
BEGIN {
// your code goes here
}
{
// your code goes here
}
END {
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
class TEST{
static void Main(){
String inputFile="./data.txt";
StreamReader sr=new StreamReader(inputFile);