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;}