静かで孤独な日記

のんびりたまに

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

AOJ 2585 1 Day Passport

#include<bits/stdc++.h> using namespace std; /* http://acm-icpc.aitea.net/index.php?plugin=attach&refer=2014/Practice/模擬国内予選/講評&openfile=D.pdf */ const int inf=1e9; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n,m,h,k; while(cin>>n>>m</bits/stdc++.h>…

AOJ 2334 Roads on Towns

#include<bits/stdc++.h> #define fi first #define se second typedef long long ll; using namespace std; //幾何ライブラリ //ほぼ、https://ei1333.github.io/algorithm/geometry_new.html からパクりました using Real=double;//問題によってはlong double に変更して</bits/stdc++.h>…

AOJ 2511 Sinking islands

#include<bits/stdc++.h> #define fi first #define se second typedef long long ll; using namespace std; //union_find //_n mast be unsigned int //BEGIN CUT HERE class union_find{ public: explicit union_find(int _n):n(_n){ par.resize(static_cast<unsigned long>(_n)); rank.r</unsigned></bits/stdc++.h>…

AOJ 2510 Twin book report

#include<bits/stdc++.h> #define fi first #define se second typedef long long ll; using namespace std; bool dp[1001][1001]; int main(){ int n; while(cin>>n,n){ vector<pair<int,int> > v; int sum=0,maxe=0; int sumw=0; int maxw=0; vector<int> vv; for(int i=0;i<n;i++){ int a,b;cin>>a>>b; v.push_bac</n;i++){></int></pair<int,int></bits/stdc++.h>…

AOJ 2333 My friends are small

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

AOJ 1196 Bridge Removal

#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=(int)1e9; vector<vector<pair<int,int> > > v; bool past[801]; bool leaf[801]; void dfs(int now){ bool flag=1; for(int i=0;i<(int)v[now].size();i++…</x<<"\n"></bits/stdc++.h>

AOJ 2200 Mr.Rito Post Office

#include<bits/stdc++.h> typedef long long ll; using namespace std; const ll inf=(ll)1e14; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.precision(10); cout<<fixed; int n,m; while(cin>>n>>m,n){ ll land[201][201],sea[201][201]; int a[1001]; for(int i=0;i<201;i++){ for(in</fixed;></bits/stdc++.h>…

AOJ 1619 Making Lunch Boxes

#include<bits/stdc++.h> using namespace std; int dp[2][(1<<24)]; string s[501]; int n,m; bool a[501][501]; int main(){ while(cin>>n>>m,n){ for(int i=0;i<n;i++){ cin>>s[i]; for(int j=0;j<m;j++){ a[i][j]=(s[i][j]=='1'); } } if(n<=m){ int ans=0; for(int i=0;i<(1<<n);i++){ if(ans>=__builtin_popcount(i))…</m;j++){></n;i++){></bits/stdc++.h>