日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Codeforces Beta Round #1

發布時間:2023/12/13 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Codeforces Beta Round #1 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

A

/*************************************************************************> File Name: A.cpp> Author: opas_chenxin> Mail: 1017370773@qq.com > Created Time: 2016年05月06日 星期五 02時22分23秒 *************************************************************************/ #include<iostream> #include<algorithm> #include<cstdio> #include<cstring> #include<cmath> using namespace std; int main(int argc, char *argv[]) {int n,m,a;while(scanf("%d%d%d",&n,&m,&a) == 3){int d1 = (n+a-1)/a;int d2 = (m+a-1)/a;cout<<1LL*d1*d2<<endl;}return 0; } View Code

B

/*************************************************************************> File Name: B.cpp> Author: opas_chenxin> Mail: 1017370773@qq.com > Created Time: 2016年05月06日 星期五 20時28分30秒 *************************************************************************/ #include<iostream> #include<algorithm> #include<cstdio> #include<cstring> #include<cmath> using namespace std; const int maxn = 5000000; char A[maxn]; char B[maxn]; void solve1(int len) {int a1 = 0;int loc = 0;while(loc<len){if(A[loc] >= 'A' && A[loc] <= 'Z'){a1 = a1 * 26 + A[loc] - 'A' + 1; }else{break;}loc++;}int b1 = 0;while(loc<len){b1 = b1*10 + A[loc] -'0';loc++;}printf("R%dC%d\n",b1,a1); } void solve2(int len) {int b1 = 0;int loc=1;while(loc < len){if(A[loc] == 'C') break;b1=b1*10+A[loc]-'0';loc++;}loc++;int a1 = 0;while(loc < len){a1 = a1 * 10 + A[loc] - '0';loc++;}loc = 0;while(a1>0){int v = a1%26;char c='Z';if(v != 0)c = 'A'+ v - 1;a1 -= c - 'A' + 1;a1 /= 26;B[loc ++] = c;}B[loc]='\0';for(int i = 0; i < loc/2; ++ i){char tem = B[i];B[i] = B[loc-i-1];B[loc - i - 1] = tem;}printf("%s%d\n",B,b1); } int main(int argc, char *argv[]) { // freopen("in","r",stdin);int cas;scanf("%d",&cas);for(int cc = 1; cc <= cas; ++ cc){scanf("%s",A);int len = strlen(A);int num = 0, per = 0;for(int i = 0; i < len; ++ i){if(A[i] >= 'A' && A[i] <= 'Z'){if(per == 0) {per = 1;num++;}}else{per = 0;}}if(num == 1)solve1(len);else solve2(len);}return 0; } View Code

C

/*************************************************************************> File Name: C.cpp> Author: opas_chenxin> Mail: 1017370773@qq.com > Created Time: 2016年06月15日 星期三 19時24分06秒 *************************************************************************/ #include<iostream> #include<algorithm> #include<cstdio> #include<cstring> #include<cmath> using namespace std; #define eps 1e-2 #define pi acos(-1.0) int n,m; double s,r,S,p; double x[4],y[4],ang[4],L[4]; double dis(double x1,double y1,double x2,double y2) {return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); } double gcd(double a,double b) {if(a<eps) return b;if(b<eps) return a;return gcd(b,fmod(a,b)); } int main(int argc, char *argv[]) {//freopen("in","r",stdin);for(int i=0; i<3; ++i){scanf("%lf%lf",&x[i],&y[i]);}for(int i=0; i<3; ++i){L[i]=dis(x[i],y[i],x[(i+1)%3],y[(i+1)%3]);}sort(L,L+3);p=(L[0]+L[1]+L[2])/2;s=sqrt(p*(p-L[0])*(p-L[1])*(p-L[2]));r=L[0]*L[1]*L[2]/(4*s);for(int i=0; i<2;++i)ang[i]=acos(1-L[i]*L[i]/(2*r*r));ang[2]=2*pi-ang[1]-ang[0];double unit=0;for(int i=0; i<3; ++i)unit=gcd(unit,ang[i]);printf("%.6f\n",pi*r*r*sin(unit)/unit);return 0; } View Code

?

轉載于:https://www.cnblogs.com/Opaser/p/5590283.html

總結

以上是生活随笔為你收集整理的Codeforces Beta Round #1的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。