new collections
来源:互联网 发布:linux server 版本 编辑:程序博客网 时间:2024/06/08 17:07
交互题
无话可说......
#include <bits/stdc++.h>using namespace std ;set < string> s ;double magic[7]={10.0,100.0,999.96,6325.61,9517.19,9950.67,9995.01};void solve () {string c ;for ( int i = 1 ; i <= 10000 ; ++ i ) {cout << "+" << endl ;fflush ( stdout ) ;cin >> c ;s.insert(c);}int x = ( int ) s.size () ;double ret = 1e9 ;int ans ;for(int i = 0 ; i < 7 ; i ++ ){ double now = fabs(1.0 * x - magic[i]); if(now < ret) ret = now , ans = i ; } int fin = 1 ; for(int i = 0 ; i <= ans ; i ++) fin *= 10; printf("= %d\n",fin); fflush ( stdout ) ;}int main () {solve () ;return 0 ;}
阅读全文
0 0
- new collections
- Collections
- Collections
- Collections
- collections
- Collections
- COLLECTIONS
- Collections
- Collections
- collections
- Collections
- Collections
- collections
- Collections
- Collections
- collections
- Collections
- Collections
- 基础的Linux操作命令
- 华为2
- 大学生职业规划
- 自定义flume-source
- 数据结构——串—串的模式匹配算法
- new collections
- 树状数组 (模板)
- RegExp对象
- 转发和重定向
- 指针修改const
- Linux下(Ubuntu14.04)安装Opencv3.3.0
- 几种简单范数介绍
- 【实战】4-13 Spring及SpringMVC配置
- 软考-软件开发模型