静かで孤独な日記

のんびりたまに

2018-03-01から1ヶ月間の記事一覧

AOJ 2608 Minus One

#include<bits/stdc++.h> #define fi first #define se second #define show(x) cerr<<#x<<"="<</bits/stdc++.h>

AOJ 2426 Treasure Hunt

#include<bits/stdc++.h> #define fi first #define se second #define show(x) cerr<<#x<<"="<<x<<"\n" typedef long long ll; using namespace std; //const ll MOD=(ll)1e9+7; //const ll inf=(ll)1e14; const int dy[]={1,0,-1}; const int dx[]={1,0,-1}; int n,m,h,w; vector<int> x,y,xx,yy; int imos[5011][5011]; …</x<<"\n"></bits/stdc++.h>

AOJ 2607 Invest Master

#include<bits/stdc++.h> #define fi first #define se second #define show(x) cerr<<#x<<"="<</bits/stdc++.h>

AOJ 2629 Manhattan

#include<bits/stdc++.h> #define fi first #define se second #define show(x) cerr<<#x<<"="<</bits/stdc++.h>

AOJ 2610 Fast Division

#include<bits/stdc++.h> #define fi first #define se second #define show(x) cerr<<#x<<"="<</bits/stdc++.h>

AOJ 2232 Ennichi

#include<bits/stdc++.h> #define fi first #define se second #define show(x) cerr<<#x<<"="<</bits/stdc++.h>

AOJ 2583 JAG-channel

#include<bits/stdc++.h> #define fi first #define se second #define show(x) cerr<<#x<<"="<</bits/stdc++.h>

AOJ 2600 Koto Distance

#include<bits/stdc++.h> #define fi first #define se second #define show(x) cerr<<#x<<"="<</bits/stdc++.h>

AOJ 1167 ポロック予想

#include<bits/stdc++.h> #define fi first #define se second #define show(x) cerr<<#x<<"="<<x<<"\n" typedef long long ll; using namespace std; const int inf=100000000; int n,m,h,w; vector<int> a,b; int dp[1000001],dp2[1000001]; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.precision(10); c…</x<<"\n"></bits/stdc++.h>

ABC038-D プレゼント

#include<bits/stdc++.h> #define fi first #define se second #define show(x) cerr<<#x<<"="<<x<<"\n" typedef long long ll; using namespace std; class Bit{ public: //tbl[1]...tbl[n] explicit Bit(int n):size(static_cast<unsigned int>(n)){//1-indexed tbl.resize(size+10,0); } //一点のみの更新 void add(int a,ll w)…</x<<"\n"></bits/stdc++.h>

ABC041-D 徒競走

#include<bits/stdc++.h> typedef long long ll; using namespace std; int n,m,h,w; ll dp[(1<<20)]; vector<int> v[20]; int main(){ cin>>n>>m; for(int i=0;i<m;i++){ int x,y;cin>>x>>y;x--;y--; v[y].push_back(x); } dp[0]=1; for(int i=0;i<(1<<(n+1));i++){ if(dp[i]==0)continue; for(int bi</m;i++){></int></bits/stdc++.h>…

ABC045 D すぬけ君の塗り絵

//const ll MOD=(ll)1e9+7; //const ll inf=(ll)1e14; const int dy[]={1,0,-1}; const int dx[]={1,0,-1}; ll n,m,h,w; string s; map<pair<int,int>,ll> mp; int x[100001],y[100001]; ll ans[10]; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.precision</pair<int,int>…

ABC036-D 塗り絵

const ll MOD=(ll)1e9+7; const ll inf=(ll)1e14; int n,m,h,w; vector<int> v[100001]; ll f[100001],g[100001]; bool fpast[100001],gpast[100001]; ll Rank[100001]; int r=0; void dfs(int now){ Rank[now]=r; r++; for(int i=0;i<(int)v[now].size();i++){ i</int>…

ABC061 D Score Attack

using namespace std; //const ll MOD=(ll)1e9+7; const ll inf=(ll)1e15; const int dy[]={1,0,-1}; const int dx[]={1,0,-1}; int n,m,h,w; string s; ll d[1001]; vector<pair<int,ll> > v[1001]; bool used[1001]; void dfs(int now){ used[now]=1; for(int i=0;i<(in</pair<int,ll>…

ABC033 D 三角形の分類

using namespace std; //const ll MOD=(ll)1e9+7; //const ll inf=(ll)1e14; const double PI=acos(-1.0); const double EPS=1e-10; const int dy[]={1,0,-1}; const int dx[]={1,0,-1}; int n,m,h,w; string s; ll x[2001],y[2001]; int main(){ ios::sync_…

ABC049 D 連結

using namespace std; //const ll MOD=(ll)1e9+7; //const ll inf=(ll)1e14; const int dy[]={1,0,-1}; const int dx[]={1,0,-1}; int n,m,h,w; string s; int k,l; class union_find{ public: explicit union_find(int _n):n(_n){ par.resize(static_cast<unsigned long>(_</unsigned>…

ABC030-D へんてこ辞書

using namespace std; //const ll MOD=(ll)1e9+7; //const ll inf=(ll)1e14; int n,a; string k; int b[100001]; int num[100001]; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.precision(10); cout<

ABC031-D 語呂合わせ

using namespace std; //const ll MOD=(ll)1e9+7; //const ll inf=(ll)1e14; int n,k; string v[51],w[51]; int mojisuu[10]; bool check(){ map<char,string> mp; for(int i=0;i</char,string>

ABC027-D ロボット

using namespace std; //const ll MOD=(ll)1e9+7; //const ll inf=(ll)1e14; const int dy[]={1,0,-1}; const int dx[]={1,0,-1}; int n,m,h,w; string s; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.precision(10); cout<

ABC026-D 高橋君ボール1号

using namespace std; //const ll MOD=(ll)1e9+7; //const ll inf=(ll)1e14; const int dy[]={1,0,-1}; const int dx[]={1,0,-1}; const double eps=1e-10; int n,m,h,w; string s; double a,b,c; const double PI=acos(-1.0); bool check(double mid){ doub…

ARC092-D Two Sequences

using namespace std; //const ll MOD=(ll)1e9+7; //const ll inf=(ll)1e14; const int dy[]={1,0,-1}; const int dx[]={1,0,-1}; int n,m,h,w; string s; ll a[200001],b[200001]; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.precision(10…

ARC092-C 2D Plane 2N Points

using namespace std; //const ll MOD=(ll)1e9+7; //const ll inf=(ll)1e14; const int dy[]={1,0,-1}; const int dx[]={1,0,-1}; int n,m,h,w; string s; vector<pair<int,int> > aka,ao; bool past[101]; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.pre</pair<int,int>…

ABC058 井井井/###

以前解いた時と解法が全く違ったので記念に。 前回は解説見て実装したからそれはそう。 そう思うと解説のような綺麗な解き方するのは中々難しい。。 #include<bits/stdc++.h> #define fi first #define se second #define show(x) cout<<#x<<"="<<x<<"\n" typedef long long ll; template<typename T> void print_to(std::ostrea</x<<"\n"></bits/stdc++.h>…