摘要: 1 int read() { char c=getchar();while(!isdigit(c)) c=getchar(); int num=0;while(isdigit(c)) num=num*10+c-'0',c=getchar(); return num; } inline int rea 阅读全文
posted @ 2020-04-16 14:18 XXXSANS 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Xenia is a girl being born a noble. Due to the inflexibility and harshness of her family, Xenia has to find some ways to amuse herself. snoop dooogg~~ 阅读全文
posted @ 2020-04-16 13:58 XXXSANS 阅读(237) 评论(0) 推荐(0) 编辑
摘要: Writing light novels is the most important thing in Linova's life. Last night, Linova dreamed about a fantastic kingdom. She began to write a light no 阅读全文
posted @ 2020-04-16 09:13 XXXSANS 阅读(281) 评论(0) 推荐(0) 编辑
摘要: Consider the infinite sequence ss of positive integers, created by repeating the following steps: Find the lexicographically smallest triple of positi 阅读全文
posted @ 2020-04-15 11:10 XXXSANS 阅读(210) 评论(0) 推荐(0) 编辑
摘要: You have unweighted tree of nn vertices. You have to assign a positive weight to each edge so that the following condition would hold: For every two d 阅读全文
posted @ 2020-04-15 09:29 XXXSANS 阅读(191) 评论(0) 推荐(0) 编辑
摘要: You have array of nn numbers a1,a2,…,ana1,a2,…,an. Rearrange these numbers to satisfy |a1−a2|≤|a2−a3|≤…≤|an−1−an||a1−a2|≤|a2−a3|≤…≤|an−1−an|, where |x 阅读全文
posted @ 2020-04-15 09:17 XXXSANS 阅读(132) 评论(0) 推荐(0) 编辑
摘要: The only difference between easy and hard versions is constraints. You are given a sequence aa consisting of nn positive integers. Let's define a thre 阅读全文
posted @ 2020-04-14 14:16 XXXSANS 阅读(230) 评论(0) 推荐(0) 编辑
摘要: You are given a correct solution of the sudoku puzzle. If you don't know what is the sudoku, you can read about it here. The picture showing the corre 阅读全文
posted @ 2020-04-14 11:51 XXXSANS 阅读(402) 评论(2) 推荐(0) 编辑
摘要: You have nn students under your control and you have to compose exactly two teams consisting of some subset of your students. Each student had his own 阅读全文
posted @ 2020-04-14 10:54 XXXSANS 阅读(411) 评论(0) 推荐(0) 编辑
摘要: You are given three positive integers nn, aa and bb. You have to construct a string ss of length nn consisting of lowercase Latin letters such that ea 阅读全文
posted @ 2020-04-14 09:24 XXXSANS 阅读(316) 评论(0) 推荐(0) 编辑