#include <iostream> #include <cstdio> #include <cstdio> #include <cstring> #include <vector> #include <cmath> #include <cstdlib> #define INF 1000000 #define ll long long using namespace std; struct node{ int x,y; }; node arr[10005]; int main() { int n,diff; int difference_arr[10005]; for(int i=2;i<61;i++) { for(int j=1;j<i;j++) { diff = i*i*i – j*j*j; if(diff>10001) continue; difference_arr=1; if(arr.x==0 || arr.y==0)
Year: 2015
10101
#include <iostream> #include <cstdio> #include <cstdio> #include <cstring> #include <vector> #include <cmath> #include <cstdlib> #define INF 1000000 #define ll long long using namespace std; string ans; int i=0; void check() { if(ans.size()) ans.append(1u,' '); } void banglaNumb(string s) { int len = s.size(); if(len>=8) { check(); ans.append(1u,s[i++]); ans.append(" kuti"); } if(len>=7) { if(s[i]!='0') { check();
11402
#include <iostream> #include <cstdio> #include <cstring> #include <string> #define sz 1024001 #define INV 1 #define SET 2 #define RESET 3 using namespace std; struct segment{ int pending_op_typ; int sum; int left,right; int len; }; segment tree[sz*4]; string ss; void init(int node,int b,int e) { tree[node].len = e-b+1; tree[node].left=b; tree[node].right=e; tree[node].pending_op_typ=0; if(b==e) { if(ss[b]=='1') tree[node].sum=1; else
12436
#include <iostream> #include <cstdio> #include <cstring> #include <string> #include <vector> #define ll long long #define sz 250005 using namespace std; struct segment{ ll left,right; ll len; ll first_inc,last_inc; ll totalAB; bool isSetvalue; ll cary; ll sum; }; segment arr[sz*4]; void changeAB(ll frist_incr,ll last_incr,int node,ll step) { arr[node].totalAB += step; arr[node].first_inc += frist_incr; arr[node].last_inc += last_incr;
11909
#include <iostream> #include <cmath> #include <cstdio> #define PI acos(-1) using namespace std; //using the formulae a/sin A = b/sin B = c/sin C int main() { double L,W,H,angle; double changed_hight,res,changed_base,empty_area; while(scanf("%lf%lf%lf%lf",&L,&W,&H,&angle)!=EOF) { changed_hight= sin(angle*PI/180)*L/sin((90-angle)*PI/180); if(angle==0) { printf("%.3lf mL\n",L*W*H); } else if(angle==90) { printf("%.3lf mL\n",0); } else if(changed_hight<=H) { empty_area=changed_hight*L*W/2; res = L*W*H-empty_area; printf("%.3lf mL\n",res); }
1208
#include <iostream> #include <vector> #include <cstdio> #include <cstring> #include <string> #include <sstream> #include <algorithm> using namespace std; struct Edge{ int source,destination,weight; }; //to keep track of parent and rank of union find struct subset{ int parent; int rank; }; bool graph[100][100]; vector<Edge> edges; subset* subsets; bool cmp(Edge a,Edge b) { return a.weight<b.weight; } int find(int
10209
To get accepted I had to use PI = acos(-1). Lets assume X = middle portion; Y = dotted region; Z = stripped region; Three independent equations are: X+ 4*Y + 4*Z = a*a……………………………………………….(1) Y + 2*Z = a*a – PI*a*a/4………………………………………..(2) X/2 + Y + Z/2 = (PI*a*a)/4 – ΔPAR………………………..(3) #include <iostream> #include <cstdio> #include <cstdio>
12779
#include <stdio.h> #include <iostream> #include <math.h> using namespace std; #define eps 1e-6 #define MX 1000000000 #define ll long long struct POINT{int x,y;}; long long gcd(ll a,ll b) { if(a%b==0) return b; else return gcd(b,a%b); } POINT pp[4]; bool find_perp_distance(POINT u,POINT v,POINT s,ll &B,ll &C,double &val) { //form equation of st line uv (ax+by+c=0) double a,b,c,r;
11824
#include <iostream> #include <cstdio> #include <cstdio> #include <cstring> #include <vector> #include <cmath> #include <cstdlib> #include <algorithm> #define LMT 5000000 #define ll long long using namespace std; bool cmp(int a,int b) { return a>b; } ll _pow(int a,int p) { ll ans=1; while(p–) { ans=ans*a; if(ans>=LMT) return LMT; } return ans; } int main() { vector<int>
10188
#include <iostream> #include <cstdio> #include <cstdio> #include <cstring> #include <string> #include <vector> #include <cmath> #include <cstdlib> using namespace std; string s,ans; string str,str1; int n,m; bool accept() { if(n!=m) return 0; if(str==str1) return 1; return 0; } bool presentation() { string num1="",num2=""; for(int i=0;i<str.size();i++) { if(isdigit(str[i])) num1.append(1u,str[i]); } for(int i=0;i<str1.size();i++) { if(isdigit(str1[i])) num2.append(1u,str1[i]); } if(num1==num2)