#include<iostream> #include<cmath> using namespace std; int main(){ float a,b,a1,b1; cin>>a>>b; a1=a/sqrt(a*a+b*b); b1=b/sqrt(a*a+b*b); a1=int(a1*10+0.5)/10.0; b1=int(b1…
#include<iostream> #include<string> #include<cstring> using namespace std; int main(){ int n,m,array[100100],len; memset(array,0,sizeof(array)); cin>>n>>m; len=n; for…
#include<iostream> using namespace std; int main(){ int s[110],max=0,n; cin>>n; for(int i=0;i<n;i++){ cin>>s[i]; if(max<s[i]){ max=s[i]; } } cout<<max<<" …
#include<iostream> using namespace std; int main(){ int n,Q,s[2000]; cin>>n>>Q; for(int i=0;i<n;i++){ cin>>s[i]; } while(Q--){ int min=1000,lo,hi; cin>>lo>>hi; for(int i…
#include<iostream> using namespace std; int judge(int y){ int flag; if(y%400==0){ flag=1; } else if(y%100==0){ flag=0; } else if(y%4==0){ flag=1; } else{ flag=0; } return f…
#include<iostream> #include<vector> using namespace std; int main(){ long ai,aj,bi,bj; cin>>ai>>aj; vector<vector <long long> > a(ai,vector<long long>(aj)); for…
#include<iostream> using namespace std; class function { public: long long f1(long long n){ if(n==1){ return 2; } else if(n==2){ return 1; }else if(n==3){ return 6; } else …
#include<iostream> using namespace std; int main(){ long long n,k,T,m=1,sum=1; cin>>n>>k>>T; for(long long i=1;i<T;i++){ m=(m+((i-1)*n+1+i*n)*n/2)%k; sum+=m; } cout<&…
#include<iostream> #include<queue> #include <typeinfo> using namespace std; int main(){ queue<char> x,y; char ch1[20],ch2[20],z[40]; cin>>ch1>>ch2; int i=0,flag=0;…
#include<iostream> #include<cstring> using namespace std; int main(){ int s1[3][3]={{4,9,2},{3,5,7},{8,1,6}}; int s2[3][3]={{2,9,4},{7,5,3},{6,1,8}}; int s3[3][3]={{8,1,…