1001

#include <bits/stdc++.h>

using namespace std;
vector<long long> v;
long long pow2(long long a, int b)
{
long long ans = ;
for(int i = ; i <= b; ++i)
ans *= a;
return ans;
}
void init()
{
for(int a = ; a <= ; ++a)
{
for(int b = ; b <= ; ++b)
{
for(int c = ; c <= ; c++)
{
for(int d = ; d <= ; d++)
{
long double sb= (long double)pow2(, a)*(long double)pow2(, b)*(long double)pow2(, c)*(long double)pow2(, d);
long long t = pow2(, a)*pow2(, b)*pow2(, c)*pow2(, d);
if(sb< || sb> ||t< || t>) break;
//printf("!");
v.push_back(t);
}
}
}
}
sort(v.begin(), v.end());
//for(int i = 0; i < v.size(); ++i)cout << v[i] << endl;
}
int lb(int x, int y, int k)
{
int m;
while(x < y)
{
m = x+(y-x+)/;
if(v[m] <= k) x = m;
else y = m-;
}
return x;
}
int main()
{
int o, p;
//cout << pow2(2,10);
init();
int n,t;
scanf("%d",&t);
while(t--)
{
int i;
scanf("%d",&n);
int lo = ,hi = v.size(),mid;
//int ans = lb(lo, hi, n);
/*while(lo<hi)
{
mid = (lo+hi)>>1;
if(v[mid]<=n) lo = mid;
else hi = mid-1;
}*/
int ans = lower_bound( v.begin(), v.end(), (long long)n)-v.begin();
printf("%d\n",v[ans]);
}
return ;
}

1002

#include <bits/stdc++.h>
using namespace std;
double a[+];
char str[];
void init()
{
for(int i = ; i <= ; ++i)
{
double t = (double)i*(double)i;
a[i] = a[i-]+1.0/t;
}
}
int trans(char* str)
{
int ans = ;
int len = strlen(str);
for(int i = ; i < len; ++i)
{
ans += (str[i]-'');
ans *= ;
}
return ans/;
}
int main()
{
init();
long long n;
//cout << trans("123100023") << endl;
//for(int i = 1; i < 10; ++i)cout << a[i] << endl; while(~scanf("%s", str))
{
int len = strlen(str);
n =trans(str);
if(len>)
{
printf("1.64493\n");
}
else if(n >= )
printf("1.64493\n");
else
{
printf("%.5lf\n", a[n]);
}
}
return ;
}

1005

#include <bits/stdc++.h>

using namespace std;

int main()
{
int t,n;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
if(n%) printf("Balanced\n");
else printf("Bad\n");
}
return ;
}

qingdao的更多相关文章

  1. 2016 ACM/ICPC Asia Regional Qingdao Online 1001/HDU5878 打表二分

    I Count Two Three Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others ...

  2. HDU 5889 Barricade 【BFS+最小割 网络流】(2016 ACM/ICPC Asia Regional Qingdao Online)

    Barricade Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total S ...

  3. 2016 ACM/ICPC Asia Regional Qingdao Online(2016ACM青岛网络赛部分题解)

    2016 ACM/ICPC Asia Regional Qingdao Online(部分题解) 5878---I Count Two Three http://acm.hdu.edu.cn/show ...

  4. The 2018 ACM-ICPC Asia Qingdao Regional Contest(部分题解)

    摘要: 本文是The 2018 ACM-ICPC Asia Qingdao Regional Contest(青岛现场赛)的部分解题报告,给出了出题率较高的几道题的题解,希望熟悉区域赛的题型,进而对其 ...

  5. The 2018 ACM-ICPC Asia Qingdao Regional Contest

    The 2018 ACM-ICPC Asia Qingdao Regional Contest 青岛总体来说只会3题 C #include<bits/stdc++.h> using nam ...

  6. suffix ACM-ICPC 2017 Asia Qingdao

    Consider n given non-empty strings denoted by s1 , s2 , · · · , sn . Now for each of them, you need ...

  7. 2017 ACM/ICPC Asia Regional Qingdao Online

    Apple Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submi ...

  8. 2017 ACM/ICPC Asia Regional Qingdao Online 记录

    题目链接  Qingdao Problem C AC自动机还不会,暂时暴力水过. #include <bits/stdc++.h> using namespace std; #define ...

  9. 【2016 ACM/ICPC Asia Regional Qingdao Online】

    [ HDU 5878 ] I Count Two Three 考虑极端,1e9就是2的30次方,3的17次方,5的12次方,7的10次方. 而且,不超过1e9的乘积不过5000多个,于是预处理出来,然 ...

  10. hdu 5878 I Count Two Three (2016 ACM/ICPC Asia Regional Qingdao Online 1001)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5878 题目大意: 给出一个数n ,求一个数X, X>=n. X 满足一个条件 X= 2^a*3^ ...

随机推荐

  1. Java NIO看这一篇就够了

    原文链接:https://mp.weixin.qq.com/s/c9tkrokcDQR375kiwCeV9w? 现在使用NIO的场景越来越多,很多网上的技术框架或多或少的使用NIO技术,譬如Tomca ...

  2. javascript拖拽事件

    <!DOCTYPE html> <html> <head> <title></title> <style type="tex ...

  3. Gym - 101845F 最大流

    The UN finals are here!, the coaches/ex-coaches team is creating a new exciting contest to select wh ...

  4. CF431C k-Tree dp

    Quite recently a creative student Lesha had a lecture on trees. After the lecture Lesha was inspired ...

  5. 黑马学习CSS选择器 简单选择器 结合符 选择器组合 选择器优先级

  6. pycharm加开头注释

    选择 File and Code Templates -> Files -> Python Script #!/usr/bin/env python # encoding: utf-8 ' ...

  7. java 实现导出Excel文件

    java 实现导出Excel(java生成 excel 并导出文件) 经常有有一些数据需要导出成   excel  格式 ,所以就需要实现啦 开始: 1.加入jar poi-3.6-20091214. ...

  8. html 一些坑。。。

    margin-left 和 margin-right 才能够使用 auto top 和 bottom 不可以 在网页设计中...通常给img 父容器 一个 宽度...同时 ,指定 img width= ...

  9. C语言中Extern用法

    extern用在变量或函数的声明前,用来说明“此变量/函数是在别处定义的,要在此处引用”. extern修饰变量的声明. 举例:若a.c中需引用b.c中的变量int v,可以在a.c中声明extern ...

  10. P3172 [CQOI2015]选数(莫比乌斯反演)

    [题目链接] https://www.luogu.org/problemnew/show/P3172 [题解] https://www.luogu.org/blog/user29936/solutio ...