Codeforces Round #138 (Div. 2)
来源:互联网 发布:科比2010年总决赛数据 编辑:程序博客网 时间:2024/05/17 18:42
A. Parallelepiped
#include <iostream>#include <cmath>using namespace std;int main(){ long long abc,ab,bc,ac,a,b,c; cin>>ab>>bc>>ac; abc=sqrt(ab*bc*ac); a=abc/bc; b=abc/ac; c=abc/ab; cout<<4*(a+b+c)<<endl; return 0;}
B. Array
#include <iostream>#include <cstring>using namespace std;int main(){ int a[100005],inp[100005]; int n,k,i,m,l,r; cin>>n>>k; memset(inp,0,sizeof(inp)); for(i=1,m=0,l=1,r=1;i<=n;i++) { cin>>a[i]; if(m!=k) { if(inp[a[i]]==0) m++; inp[a[i]]=i; r=i; } } for(i=1;i<=n;i++) { if(inp[a[i]]==i) {l=i;break;} } if(m==k) cout<<l<<" "<<r<<endl; else cout<<-1<<" "<<-1<<endl; return 0;}
0 0
- Codeforces Round #138 (Div. 2)
- Codeforces Round #138 (Div. 2)
- Codeforces Round #138 (Div. 2)
- Codeforces Round #138 (Div. 2)
- Codeforces Round #138 (Div. 2) A题
- Codeforces Round #138 (Div. 2) A. Parallelepiped
- Codeforces Round #138 (Div. 2) B. Array
- Codeforces Round #138 (Div. 1)
- Codeforces Round #102 (Div. 2)
- Codeforces Round #103 (Div. 2)
- Codeforces Round #103 (Div. 2)
- Codeforces Round #104 (Div. 2)
- Codeforces Round #105 (Div. 2)
- Codeforces Round #105 (Div. 2)
- Codeforces Round #107 (Div. 2)
- Codeforces Round #108 (Div. 2)
- Codeforces Round #110 (Div. 2)
- Codeforces Round #122 (Div. 2)
- DedeCMS_如何加入自定义函数?
- Cstring 与 wParam 类型转换
- C++命名规范
- PAT (Advanced Level) Practise 1002 A+B for Polynomials (25)
- 认识——转化的力量
- Codeforces Round #138 (Div. 2)
- 多线程问题锦集
- 【从源码看Android】01从Looper说起
- 自定义UITableView折叠效果
- mysql server has gone away的原因
- Linux开发之守护进程
- Codeforces Round #139 (Div. 2)
- Codeforces Round #147 (Div. 2) B. Young Table
- 解决get传值乱码问题