C++競プロ学習日記(仮)

( 学習記録であり解説Blogではないです )

2016-06-01から1ヶ月間の記事一覧

No.154 市バス|yukicoder

No.154 市バス - yukicoderを解きました。この問題、文字列の問題を探していて星★★だったし解けるかな〜?みたいな 軽い気持ちで適当に選んだのが全ての始まりでした...(序章)初めはstd::findで文字列を見つけて場合分けすればいけるのでは(?) みたいな感じ…

Round #130 A. Dubstep|Codeforces

Problem - 208A - Codeforcesを解きました。 #include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); string S; cin >> S; S = "WUB" + S + "WUB"; regex re( "(WUB)+" ); S = regex_replace( S, re, " " ); cout << S.subs</bits/stdc++.h>…

Round #89 A. String Task|Codeforces

Problem - A - Codeforcesを解きました。 #include <bits/stdc++.h> using namespace std; string f( string S ) { string res; for( auto&& x : S ) { //★ if( string( "oayeui" ).find( x ) != string::npos ) { continue; } res += x; } return res; } int main() { cin.</bits/stdc++.h>…

再帰と分割統治法|アルゴリズムとデータ構造

アルゴリズムとデータ構造 第6章−1「再帰と分割統治法」で階乗コードを書きました。 #include <bits/stdc++.h> #define LL long long #define ULL unsigned long long #define REP(i,n) for(int i=0; i<(n); i++) #define REP2(i,x,n) for(int i=x; i<(n); i++) using names</bits/stdc++.h>…

Search - Binary Search |アルゴリズムとデータ構造|AOJ

アルゴリズムとデータ構造の本に沿った問題の 探索 2 | アルゴリズムとデータ構造 | Aizu Online Judgeを解きました。 #include <bits/stdc++.h> using namespace std; //二分探索 int main(){ int N; cin >> N; vector<int> vc(N); for( auto&& x : vc ){ cin >> x; } sort(vc.b</int></bits/stdc++.h>…

#65 A. Way Too Long Words|Codeforces

Codeforces Round #65 Problem - A - Codeforcesを解きました。 #include <bits/stdc++.h> #define REP(i,n) for(int i=0; i<(n); i++) #define REP2(i,x,n) for(int i=x; i<(n); i++) using namespace std; int main () { cin.tie(0); ios::sync_with_stdio(false); int N;</bits/stdc++.h>…

Search - Linear Search |アルゴリズムとデータ構造|AOJ

アルゴリズムとデータ構造の本に沿った問題の 探索 1 | アルゴリズムとデータ構造 | Aizu Online Judge を解きました。 #include <bits/stdc++.h> using namespace std; int main (){ cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector<int> vc1(N); for( auto&</int></bits/stdc++.h>…