Loading

随笔分类 -  Timus

摘要:分析 详见 "这篇非常好的分析" AC代码: C++ include using namespace std; define LL long long LL gcd(LL a, LL b){ return b ? gcd(b, a%b):a; } int main(){ bool ans = tru 阅读全文
posted @ 2018-06-03 21:11 Sherlock-Tang 阅读(122) 评论(0) 推荐(0)
摘要:/** *Timus 1014.Product of Digits *Accepted *0.001 252 KB */ #include using namespace std; /// int n; long long solve(int num){ if(num==0) return 10; if(num==1) return 1; long long ans=... 阅读全文
posted @ 2017-11-25 15:50 Sherlock-Tang 阅读(176) 评论(0) 推荐(0)
摘要:/* * AC 0.015 404 KB * 枚举每堆石子选或不选 * O(2^20) */ #include #include #include using namespace std; const int maxn = 128e4; int sto[26]; int n, sum=0; int mindif = 1e9; void dfs(int pos, int tol){ ... 阅读全文
posted @ 2017-11-25 10:28 Sherlock-Tang 阅读(247) 评论(0) 推荐(0)
摘要:在Timus的题目中,测试数据大小经常表示为“A size of the input stream does not exceed 256 KB.” 那么我们就要清楚txt文件大小的计算方法: 数字、英文字母、英文标点占1B, 中文、中文字符占2B。 那么如题目1001中,测试数据最多有256K / 阅读全文
posted @ 2017-11-24 21:30 Sherlock-Tang 阅读(196) 评论(0) 推荐(0)