Codeforces 598A Tricky Sum (水)
来源:互联网 发布:淘宝信誉查询源码 编辑:程序博客网 时间:2024/06/05 05:54
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>#include <cmath>#include <queue>#include <vector>#include <set>#include <stack>#include <map>#include <climits>using namespace std;typedef long long ll;const int maxn = 10000 + 7, INF = 0x3f3f3f3f, mod = 1e9 + 7;int n;ll a;int main() { scanf("%d", &n); for(int i = 0; i < n; ++i) { scanf("%lld", &a); ll j = 1LL, sum = 0LL; while(j <= a) { sum += j; j *= 2LL; } cout << a*(a+1)/2 - 2*sum << endl; } return 0;}
阅读全文
1 0
- Codeforces 598A Tricky Sum (水)
- Codeforces--598A--Tricky Sum(数学)
- CodeForces 598A Tricky Sum(思维)
- 【CodeForces 598A】Tricky Sum(计数)
- 【CodeForces】598A - Tricky Sum(计数)
- 题解: Codeforces 598A Tricky Sum (水)
- CodeForces 598A--Tricky Sum
- CodeForces 598A- Tricky Sum
- 【CodeForces】[598A]Tricky Sum
- CodeForces 598A Tricky Sum
- codeforces 598A Tricky Sum
- 【Codeforces 598A】 Tricky Sum
- CodeForces 598A Tricky Sum
- CodeForces 598A Tricky Sum
- 【CodeForces 598A Tricky Sum】
- CodeForces 598A Tricky Sum
- CodeForces 598A Tricky Sum
- codeforces 598A Tricky Sum
- 算法练习(20):Maximum Subarray
- Java对象和Excel转换工具XXL-EXCE
- light7中标签下实现两个无限滚动
- ionic 创建项目时总在最后npm install 时失败
- python测试框架
- Codeforces 598A Tricky Sum (水)
- Maven学习之路四(Maven的常用命令)
- php Dockerfile mysqli mbstring redis
- Fragment getView() getActivity() isAdded() 在fragment操作时的表现
- 基于GUI测试工具Squish的使用
- JavaBean实现简单登录功能
- 添加BN层到deeplabV2
- 记一次opencv安装踩坑旅程
- 思维导图教你如何人际沟通