tozangezan's diary

勝手にソースコードをコピペして利用しないでください。

2013-01-01から1年間の記事一覧

tozangezan's good bye 2013 contest

ここはコンテストのページです。 コンテスト会場は NPCA Judge のproblemsから行われます。問題のIDは117~121です。競技時間は14:30~16:00です。 ペナルティとかのルールはICPC形式とします。また、順位付けは終了後に目で確認して作り、ここに公開する予…

今年の目標の達成状況

毎年恒例のこれです。今年の目標は以下のようになっていました。 今年も目標立てます・TC,CFのレート2400受験終わったらガチ勢します・ICPC校内予選突破そもそも校内予選があるあの学校に入らないといけないわけで。・発狂段位やりすぎると競技プログラミン…

Bad Bye 2013

C: #include<stdio.h> int main(){ printf("300000\n"); for(int i=0;i<200000;i++){ if(i)printf(" "); printf("1"); } for(int i=0;i<100000;i++){ printf(" %d",i+1); } printf("\n"); }</stdio.h>

SRM 602

やっぱりMediumが解けません…250: かつっぱ~とTopCoder dpやるだけ。まあ許されるスピード。target陣速すぎ。 public class TypoCoderDiv1{ public int getmax(int[]a,int b){ int n=a.length; int dp[][]=new int[n+2][2200]; for(int i=0;i

PKU 3168

PKU

ついにBarn Expansionが解けました。 解法: よく考えたらこれ可変長じゃなくて入力によってサイズが変わるので二次元配列にしづらい配列の間違いでした (もちろんvectorはTLEするし、いつもの隣接リストではソートできません)配列のサイズが最初で全部決め…

クッキーの6時間

クリスマス企画として、Cookie Clickerを24日21時からはじめます。焼き始めです。 http://gyazo.com/dd7c2116bc90bb793ac9c18dd6827778.png22時になりました。1時間経過の様子です。 http://gyazo.com/6f842a027c29187162bfa124d8eaed3b.png23時になりました…

SRM 601

相変わらず頭が世界一悪いです。もう灰色も近いです。Rating: -INF -> -INF (もはや変化量が収束しているかどうかわからないレベルの減少)

SRM 600

世界一TopCoderができないので、そろそろDiv2に落ちます。 Rating: 2387 -> -INF (-INF)

PKU 3422, 2762

PKU

久しぶりにPOJ Monthlyでもやってみようと思ってやることにしました。3422: Kaka's Matrix Travels いつしかこのブログに書いたはずのDiv1Hardとほとんど同じ問題です。まったく同じ最小費用流をすれば解けます。 #include <vector> #include <algorithm> #include <iostream> #include <queue> #</queue></iostream></algorithm></vector>…

SRM 595 Div1Medium

典型DP。まじめにやるときは400点はとりたいところ。 public class LittleElephantAndRGB{ public long getNumber(String[]a,int b){ String c=""; for(int i=0;i

SRM 594 Div1Medium

このくらい簡単な問題が出てくれたらレートあがるんだけどなあ…… #include<stdio.h> #include<algorithm> #include<vector> #include<string> #include<queue> using namespace std; const int D_MAX_V=10000; const int D_v_size=10000; struct D_wolf{ int t,c,r; D_wolf(){t=c=r=0;} D_wolf(int t1,in</queue></string></vector></algorithm></stdio.h>…

Codeforces Round #219 (Div. 1)

誰か!5分前になる前にもうすぐregister終わるとか言ってくださいよ!!!!!!!

Advent Calendar

はじめに: 言い訳 自分の中では12/8の担当だと思っていました。自分の中では12/8の担当だと思っていました。自分の中では12/8の担当だと思っていました。自分の中では12/8の担当だと思っていました。自分の中では12/8の担当だと思っていました。自分の中で…

SRM 599

今回は変則セットで、250-950でした。250:BigFatNumbersだっけ? やるだけ public class BigFatInteger{ public int minOperations(int a,int b){ int M=0; int S=0; for(int i=2;i<=a;i++){ int K=0; while(a%i==0){ a/=i; K++; } M=Math.max(M,K*b); if(K>…

今日解いた問題たち⑩

ICPCからの現実逃避のためにCodeforcesのcombinatoricsをまたやってみました。前回からしばらく空いていたので、そのあいだに埋めていないsolvedの多い問題も増えていました。353B: Two Heaps Greedyつらい。 #include<stdio.h> #include<algorithm> using namespace std; int b[</algorithm></stdio.h>…

AOJ 1322

AOJ

この手の構文解析のなかではかなり楽な類だと思います。問題文の通りにかくだけ。 #include<stdio.h> #include<string.h> #include<algorithm> using namespace std; int inv[2011]; char str[30][128]; int mod=2011; int a; int b; int find(int top,int bottom,int left){ for(int i=top</algorithm></string.h></stdio.h>…

AOJ 1177

AOJ

1100点の幾何。ひたすら場合分けをがんばろう!! #include<stdio.h> #include<algorithm> #include<math.h> using namespace std; const double EPS=1e-10; const double INF=1e+10; const double PI=acos(-1); int sig(double r){return (r<-EPS)?-1:(r>+EPS)?+1:0;} double Abs(double</math.h></algorithm></stdio.h>…

SRM 593

SRM 593 解説Div2 Easy, Medium, Hard, Div1 Mediumを書きました。Div2H=Div1Mです。 Div2 Easy 好きなように全部ためしましょう。 https://www.youtube.com/watch?v=DRW9PnBDaJY Div2 Medium もれないようにしっかり調べましょう。 Div2 Hard & Div1 Medium…

Codeforces Round #202 (Div. 1)

最近CFがやたらと好調。A: 二分探索した。どうとでもなるらしい。 #include<stdio.h> #include<algorithm> using namespace std; int b[100100]; int main(){ int a; scanf("%d",&a); for(int i=0;i</algorithm></stdio.h>

AOJ 1283

AOJ

やらかしました。手元とPKUでは正解なのにAOJではWAだったのはどうやら配列外参照のせいらしい。 C++は配列外処理のレスポンスが環境によってかわりすぎる。JavaみたいにすべてREにしてほしい。 (CFでC++の配列外処理はhackすることができない)やってること…

JAG夏合宿に行ってきました

とりあえず自分が書いたソースコードを張ります。Day2 Practice (KMFContest)F: segtree的な #include<bits/stdc++.h> using namespace std; int b[100000]; int segtree[2200000]; int INF=999999999; void add(int a,int b){ a+=(1<<20); while(a){ segtree[a]=min(segtre</bits/stdc++.h>…

数え上げ問題集 ver.0

数え上げ問題集数え上げの問題をある程度まとめます。といっても多すぎて面倒なので、まとまって存在するものはリンクを張ります。 また、検索の都合上「答えを1000000007で割った余りを求める」以外の形式の数え上げは見落とされがちなので、そこらへんは割…

Codeforces Round #201 (Div. 1)

不思議。A:GCD求めてほげるだけ。落ちた。 #include<stdio.h> #include<algorithm> using namespace std; int b[100]; int gcd(int a,int b){ while(b){ a%=b; int c=a; a=b; b=c; }return a; } int main(){ int a; scanf("%d",&a); for(int i=0;i</algorithm></stdio.h>

天下一プログラマーコンテスト2013 本戦

5位でした!A: ビットDPするだけなので飛ばす。あとから戻ってきて面倒だが書く。 #include<stdio.h> #include<algorithm> using namespace std; int dp[15][15][1<<16]; int mod=1000000007; int main(){ int a,b; scanf("%d%d",&a,&b); for(int i=0;i<(1<</algorithm></stdio.h>

今日解いた問題たち⑨

今日は実装が楽系多め。9D - How many trees? dp[i][j]:=i個のノードを持つ高さj以上の二分木の個数 #include<stdio.h> #include<algorithm> using namespace std; long long dp[100][100]; long long calc(int a,int b){ if(~dp[a][b])return dp[a][b]; if(a</algorithm></stdio.h>

今日解いた問題たち⑧

解法を考えて整理してからPCを起動するとはかどる。213B - Numbers 桁ごとに挿入するタイプの数え上げDP。leading 0を取り除くために最上位をループで決めています。 #include<stdio.h> #include<algorithm> using namespace std; int d[10]; long long dp[10][101]; int C[1000]</algorithm></stdio.h>…

今日解いた問題たち⑦

だんだん難しい問題に当たるようになってきて大変。156C - Cipher よく考えたら文字関係無いじゃん… #include<stdio.h> #include<algorithm> #include<string.h> using namespace std; int dp[101][2600]; char str[128]; int main(){ int a; int mod=1000000007; dp[0][0]=1; for(int i=0;i</string.h></algorithm></stdio.h>…

今日解いた問題たち⑥

これ、⑳までいったらどうしようと思ったんですが、Unicodeには㊿まであるっぽいので、ひとまず安泰です。128C - Games with Rectangle (a-1)C(c*2)+(b-1)C(c*2)。成立しないケースが邪魔。配列外で死。 #include<stdio.h> #include<algorithm> using namespace std; long long C[</algorithm></stdio.h>…

今日解いた問題たち⑤

今日はCodeforcesの問題を解くのをお休みにして、Readforcesの問題を解くことにしました。229C - Triangles 問題文を読み間違えていた。正しく読めば簡単。 Knの三角形はnC3個。 ここからm辺取り除くとまずm*(n-2)個の三角形が消え、包除原理で頂点を共有す…

今日解いた問題たち④

今日は軽めです。107B - Basketball Team 確率の計算を普通にやる。 #include<stdio.h> #include<algorithm> using namespace std; int d[1000]; int main(){ int a,b,c; scanf("%d%d%d",&a,&b,&c); for(int i=0;i</algorithm></stdio.h>