Codeforces round #185 (Div. 1) & (Div. 2)

Source: Internet
Author: User
Tags bitset

Div 2

A simulation. Simulation. Simulation. I have read a wrong sentence. I have always done this kind of thing recently... According to his experience, he thought that Freda always said "Lala." at the end of her sentences, while rainbow always said "Miao ."
At thebeginning of his sentences.

Cause wawawa ---- find problem --- solve ----- AC

#include<functional>#include<algorithm>#include<iostream>#include<fstream>#include<sstream>#include<iomanip>#include<numeric>#include<cstring>#include<cassert>#include<cstdio>#include<string>#include<vector>#include<bitset>#include<queue>#include<stack>#include<cmath>#include<ctime>#include<list>#include<set>#include<map>using namespace std;int ans[12];int T;string s;int main(){    cin>>T;    cin.get();    for(int i=1;i<=T;i++)    {        getline(cin,s);        if (s.size()<5||s.substr(0,5)=="miao."&&s.substr(s.size()-5,5)=="lala.") ans[i]=0;        else        {            if(s.substr(0,5)=="miao.") ans[i]=2;            if(s.substr(s.size()-5,5)=="lala.") ans[i]=1;        }    }    for(int i=1;i<=T;i++)    {        if(ans[i]==0) cout<<"OMG>.< I don't know!"<<endl;        if(ans[i]==1) cout<<"Freda's"<<endl;        if(ans[i]==2) cout<<"Rainbow's"<<endl;    }    return 0;}

B proportional sequence infinite summation formula A + AP ^ 2 +... 0 <p <1 --> S = A/(1-p )...... Nima ,,,

 

# Include <functional> # include <algorithm> # include <iostream> # include <fstream> # include <sstream> # include <iomanip> # include <numeric> # include <cstring> # include <cassert> # include <cstdio> # include <string> # include <vector> # include <bitset> # include <queue> # include <stack> # include <cmath> # include <ctime> # include <list> # include <set> # include <map> // The infinite summation formula of the proportional Series A + AP ^ 2 +... 0 <p <1 --> S = A/(1-p) using namespace STD; int main () {double A, B, C, D; cin> A> B> C> D; printf ("%. 12lf \ n ", a/B/(1-(1-A/B) * (1-C/D); Return 0 ;}

 

Question C (question Div 1)

This is Nima's 13th question .... I f .... Ym

 

#include<functional>#include<algorithm>#include<iostream>#include<fstream>#include<sstream>#include<iomanip>#include<numeric>#include<cstring>#include<cassert>#include<cstdio>#include<string>#include<vector>#include<bitset>#include<queue>#include<stack>#include<cmath>#include<ctime>#include<list>#include<set>#include<map>using namespace std;int main(){int n,k;while(cin>>n>>k){if(n*(n-1)/2<=k)cout<<"no solution\n";else{for(int i=1;i<=n;i++)printf("0 %d\n",i);}}return 0;}

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.