2014-12-01から1ヶ月間の記事一覧
LaTeX 始めました。
2014年 最後からN番目の目標 - intさわだんのBlack History 2014年 最後からN番目の目標 - intさわだんのBlack History起きれた。アロエヨーグルトうまい。明日は8:30に起きます
問題文頭では解けていたけど実装していなかった問題。 自作アルゴリズムをゴリ押ししたら通った。 解法 まず、 サンプルデータの画像で考える。次のように各横棒に対して二つの整数値を保存しておく。(下のソースではcという配列)二つの整数値がなにを表し…
2014年 最後からN-1番目の目標 今年中にAOJのvol.5全埋めします。
2014年 最後からN番目の目標 明日9時までに起きる。
雪めっちゃふってる
例の平方分割で解ける問題バケットのサイズを色々試してみた。B = 1100 → TLE (>20000MS) B = 1000 → 11735MS B = 900 → 11782MS B = 850 → 11829MS B = 800 → 11157MS B = 700 → 12235MS結果B = 800が一番早い(?) #include <cstdio> #include <vector> #include <algorithm> using n</algorithm></vector></cstdio>…
やるだけこういう問題嫌いです。 #include <bits/stdc++.h> using namespace std; typedef pair<int,int> P; int n,m; int d[1010][1010][5]; char s[1010][1010]; char joi[3][3]; int ans = 0; int ha[4][4]; int main(){ scanf("%d%d",&m,&n); for(int i = 0;i < m;i++){ cin >> s</int,int></bits/stdc++.h>…
解法は顕著でいもす法やるだけなんだけど、メモリの制限がやたらと厳しいと言う問題。ACしたあと、もしかしたらと思い、"解答例(元 IOI 日本代表選手が作成した C++ サンプルソース)"をAOJに投げてみたらなんと"MLE"だったのでAOJ側の問題なのか?? #incl…
どうでもいいこと言います。JOI予選直後、プロの人たちがボーダー600点と予想する中自分だけクソ真面目なボーダー予想をしていた。真面目にボーダー予想すると 400~460ぐらいじゃないかなぁ— intさわだん (@intsawadan) 2014, 12月 14これです。それで本当の…
http://abc014.contest.atcoder.jp/tasks/abc014_4完全にmemoで保存用O(N^2) #include <bits/stdc++.h> using namespace std; const int M = 100010; vector<int> G[M]; int root; int n,q; int parent[M]; int depth[M]; void dfs(int v,int p,int d){ parent[v] = p; depth[v] </int></bits/stdc++.h>…
このままじゃ本気でやばいからtwitter,Youtubeなど来年の4月、もしくは2月まで封印しよう。 4月まで封印しないといけなくなるほうがいい。
進捗ダメです
見るからにDPっぽいDP.N だから恐らくO(N)なんだけど頭が悪いからO(N log N)でといた。dp[i] := i番目の駅に行くときのかかる値段の最小値で求まる。よく読んでいなくて無駄なWAを生やしすぎたし英語力ない。ACしたあと中国人のブログ見てたらみんなO(N)でと…
とりあえず予選通過しました、 とだけ言っておく。— intさわだん (@intsawadan) 2014, 12月 18本選に向けて冬休み精進します。
あとから見れるようにソースはっとく。本番のソースそのままはるからとても見にくいと思われます。競技前、風邪がやばいな~~と思っていた。高校入試と同じように ももいろクローバーZの「行くぜっ!怪盗少女」を聞く。 この曲を聞くとなぜか緊張がおさまる…
結果だけ言うと5完でした。 例年どおりのボーダーだとおそらく予選は通ってると思われる。
17年も生きてるとまあほとんど緊張しなくなるわけで。 まあいつも通り頑張ります。 さすがに結果はついてくるでしょ(笑)
4完だった ソースだけ適当にはっとく 今日のとおりできれば予選はきっと通ると思う1 #include <bits/stdc++.h> using namespace std; int main(){ int a,b,c,d; cin >> a >> b >> c >> d; int ans = 0; int ta = c*d - a*b; ans = ta / b; if(ta % b != 0)ans++; if(ta < 0)</bits/stdc++.h>…
どうでもいいけど、大事なのは続けることなんだなぁ、とふと思った。 ところでJOI予選の2日前という大事なときに風邪(熱ぎみ)をひいた。 ユンケル飲んだから何とか復活したけど、なんだかんだJOI予選で一番難しいのは体調管理なのかもしれない。(真顔)今…
日本語力がない
計算量と実行時間的なアレで予選には二分探索とかセグメントツリー(データ構造)などは、出る可能性は極めて低いと思うんだけどどうなんだろう。去年から察するに、グラフ理論は出てもおかしくない。三問目あたりに貪欲法出そうな気がする。
問題文 http://poj.org/problem?id=3051 深さ優先探索やるだけ char型嫌いでint型好きなので配列はintにした。JOI予選まであとn日!!!(n #include <cstdio> #include <algorithm> using namespace std; int w,h,t=0,ans=0; int d[1005][90]; int dx[] = {0,-1,0,1}; int dy[]</algorithm></cstdio>…
http://poj.org/problem?id=2394解法:ダイクストラやるだけ。JOI予選近いですね・・・ #include <cstdio> #include <queue> #include <vector> using namespace std; int f,p,c,m; const int INF = 100000000; const int MAX_V = 510; struct edge{ int to,cost;}; typedef pair<int,int> P;</int,int></vector></queue></cstdio>…
問題文 http://poj.org/problem?id=3627謎問 priority_queueつかうだけ。 sortしたら間に合わないとか言うやつなのかな? #include <cstdio> #include <queue> using namespace std; int n,s,b,ans; int main(){ scanf("%d%d",&n,&b); priority_queue<int> que; for(int i = 0;i </int></queue></cstdio>…
問題文 http://poj.org/problem?id=3615ワーシャルフロイド法をちょっとだけいじる。 N iostreamを使うとTLEした。 #include <cstdio> using namespace std; const int INF = 100000000; int n,m,t; int d[305][305]; int main(){ for(int i = 0;i <= 303;i++){ for(</cstdio>…
問題文 http://poj.org/problem?id=3620 解法:深さ優先探索やるだけ。 #include <iostream> #include <cstdio> #include <algorithm> using namespace std; int n,m,k,tmp,ans=0,d[110][110]; int da[] = {0,1,0,-1}; int db[] = {1,0,-1,0}; void dfs(int a,int b){ tmp++; d[a][b] = 0;</algorithm></cstdio></iostream>…
問題文 http://poj.org/problem?id=3626 解法:幅優先探索やるだけ。 感想:JOI予選にでてもおかしくない。 #include <cstdio> #include <iostream> #include <queue> using namespace std; typedef pair<int,int> P; const int t = 510; const int INF = 100000; int x,y,n,ans; int d[1020][1</int,int></queue></iostream></cstdio>…
深さ優先探索+ダイクストラ幅優先探索使ったほうがいいことにACしたあと気がついた。 まあ通れば勝ちでしょ...(震え声 #include <bits/stdc++.h> using namespace std; const int INF = 1000000000; const int MAX_V = 5003; int cost[MAX_V][MAX_V]; int cosn[5003][5003</bits/stdc++.h>…
DPショートコーディング大会みたいになった。 #include <bits/stdc++.h> using namespace std; const int mod = 100000; int w,h,dp[102][102][4]; int main(){ cin >> w >> h; dp[1][1][0] = 1;dp[1][1][3] = 1; for(int i = 1;i <= h;i++){ for(int j = 1;j <= w;j++){ if</bits/stdc++.h>…