摘要: ###题面 Pavel and Triangles 题面翻译 给定n种木棍,第i+1种有ai​个,长度为2^i,求用这些木棍可以同时拼出多少个三角形(不可重复使用同一根) 输入第一行n,第二行n个整数a0,a1,a2...an−1 n≤3∗10^5,0≤ai≤10^9 输出一个整数表示个数 题目描述 阅读全文
posted @ 2022-11-27 17:53 ancer 阅读(39) 评论(0) 推荐(0)
摘要: ###题面 Time limit 2000 ms Mem limit 262144 kB The main characters have been omitted to be short. You are given a directed unweighted graph without loop 阅读全文
posted @ 2022-11-24 15:05 ancer 阅读(33) 评论(0) 推荐(0)
摘要: ##给int数组赋值 memset( *a, x, sizeof(a)) int类型元素是4字节 而memset赋值时是给每个字节赋值x 那么对于某一个元素 如果x = 1 则赋值时给到每一个元素是 00000001000000010000000100000001; 如果x = 0,那么赋值给每一个 阅读全文
posted @ 2022-11-22 21:04 ancer 阅读(112) 评论(0) 推荐(0)
摘要: ##题面 You are given an array a consisting of n integers numbered from 1 to n. Let’s define the k-amazing number of the array as the minimum number that 阅读全文
posted @ 2022-10-27 18:45 ancer 阅读(32) 评论(0) 推荐(0)
摘要: ##题面 Eugene likes working with arrays. And today he needs your help in solving one challenging task. An array cc is a subarray of an array bb if cc ca 阅读全文
posted @ 2022-10-27 18:21 ancer 阅读(29) 评论(0) 推荐(0)
摘要: ##题面 Dark is going to attend Motarack’s birthday. Dark decided that the gift he is going to give to Motarack is an array a of n non-negative integers. 阅读全文
posted @ 2022-10-27 18:05 ancer 阅读(35) 评论(0) 推荐(0)
摘要: ##题面 A sequence a=[a1,a2,…,al] of length l has an ascent if there exists a pair of indices (i,j) such that 1≤i<j≤l and ai<aj. For example, the sequenc 阅读全文
posted @ 2022-10-09 21:37 ancer 阅读(45) 评论(0) 推荐(0)
摘要: ###题面 Now that Kuroni has reached 10 years old, he is a big boy and doesn't like arrays of integers as presents anymore. This year he wants a Bracket 阅读全文
posted @ 2022-10-08 14:45 ancer 阅读(34) 评论(0) 推荐(0)
摘要: ##Codeforces Round #620(Div.2) Longest Palindrome ###题面 Returning back to problem solving, Gildong is now studying about palindromes. He learned that 阅读全文
posted @ 2022-10-08 14:11 ancer 阅读(31) 评论(0) 推荐(0)
摘要: ##题面 [传送门](http://poj.org/problem?id=1958) 简言之就是解出n个盘子4座塔的Hanoi问题最少需要多少步 ##分析 对于三塔经典Hanoi问题,有 $$\boxed{d[n] = 2 * d[n -1] + 1}$$ 原理是第一步把n-1个盘子放在另一个塔子上 阅读全文
posted @ 2022-10-05 09:11 ancer 阅读(158) 评论(0) 推荐(0)