CC

自然万物都趋向从有序变得无序

0%

题目链接


Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)

Problem Description

Patrick Star bought a bookshelf, he named it ZYG !! Patrick Star has N book . The ZYG has K layers (count from 1 to K) and there is no limit on the capacity of each layer ! Now Patrick want to put all N books on ZYG : 1. Assume that the i-th layer has cnti(0≤cnti≤N) books finally.

阅读全文 »

题目链接


Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)

Problem Description

Input

第一行包含两个整数N和 M, 表示该无向图中点的数目与边的数目。 接下来M 行描述 M 条边,每行三个整数Si,Ti ,Di,表示 Si 与Ti之间存在 一条权值为 Di的无向边。 图中可能有重边或自环。

阅读全文 »

题目链接


Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)

Problem Description

XOR is a kind of bit operator, we define that as follow: for two binary base number A and B, let C=A XOR B, then for each bit of C, we can get its value by check the digit of corresponding position in A and B. And for each digit, 1 XOR 1 = 0, 1 XOR 0 = 1, 0 XOR 1 = 1, 0 XOR 0 = 0. And we simply write this operator as ^, like 3 ^ 1 = 2,4 ^ 3 = 7. XOR is an amazing operator and this is a question about XOR.

阅读全文 »

题目链接


Time limit 250 ms Memory limit 65536 kB

Problem Description

The sequence of non-negative integers A1, A2, …, AN is given. You are to find some subsequence $Ai_1, Ai_2, …, Ai_k (1 <= i_1 < i_2 < … < i_k <= N) such, that Ai_1 XOR Ai_2 XOR … XOR Ai_k $has a maximum value.

阅读全文 »


题目链接


时间限制:C/C++ 3秒,其他语言6秒

空间限制:C/C++ 262144K,其他语言524288K

64bit IO Format: %lld

Problem Description

There is a matrix A that has N rows and M columns. Each grid (i,j)(0 ≤ i < N, 0 ≤ j < M) is painted in white at first. Then we perform q operations: For each operation, we are given (xc, yc) and r. We will paint all grids (i, j)

that meets ![img](https://uploadfiles.nowcoder.com/files/20180730/305537_1532930696297_equation?tex=\sqrt{(i-x_c)to black. You need to calculate the number of white grids left in matrix A.

阅读全文 »

题目链接


Time limit 10000 ms Memory limit 31072 kB

Problem Description

小 X 自幼就很喜欢数。但奇怪的是,他十分讨厌完全平方数。他觉得这些 数看起来很令人难受。由此,他也讨厌所有是完全平方数的正整数倍的数。然而 这丝毫不影响他对其他数的热爱。 这天是小X的生日,小 W 想送一个数给他作为生日礼物。当然他不能送一 个小X讨厌的数。他列出了所有小X不讨厌的数,

然后选取了第 K个数送给了 小X。小X很开心地收下了。 然而现在小 W 却记不起送给小X的是哪个数了。你能帮他一下吗?

阅读全文 »


题目链接


Time limit 6000 ms Memory limit 265216 kB

Problem Description

墨墨购买了一套N支彩色画笔(其中有些颜色可能相同),摆成一排,你需要回答墨墨的提问。墨墨会像你发布如下指令: 1、 Q L R代表询问你从第L支画笔到第R支画笔中共有几种不同颜色的画笔。 2、 R P Col 把第P支画笔替换为颜色Col。为了满足墨墨的要求,你知道你需要干什么了吗?

阅读全文 »

题目链接


Time Limit: 12000/6000 MS (Java/Others) Memory Limit: 524288/524288 K (Java/Others)

Problem Description

“WTF! While everyone has his girl(gay) friend, I only have my keyboard!” Tired of watching others’ affair, Hillan burst into scream, which made him decide not to hold it back. “All right, I am giving you a question. If you answer correctly, I will be your girl friend.” After listening to Hillan, Girl replied,

阅读全文 »


题目链接


Time limit 20000 ms Memory limit 265216 kB

Problem Description

今天的数学课上,Crash小朋友学习了最小公倍数(Least Common Multiple)。对于两个正整数a和b,LCM(a, b)表示能同时被a和b整除的最小正整数。例如,LCM(6, 8) = 24。回到家后,Crash还在想着课上学的东西,为了研究最小公倍数,他画了一张NM的表格。每个格子里写了一个数字,其中第i行第j列的那个格子里写着数为LCM(i, j)。一个45的表格如下: 1 2 3 4 5 2 2 6 4 10 3 6 3 12 15 4 4 12 4 20 看着这个表格,Crash想到了很多可以思考的问题。不过他最想解决的问题却是一个十分简单的问题:这个表格中所有数的和是多少。

当N和M很大时,Crash就束手无策了,因此他找到了聪明的你用程序帮他解决这个问题。由于最终结果可能会很大,Crash只想知道表格里所有数的和mod 20101009的值。

阅读全文 »