time limit per test: 0.5 sec. memory limit per test: 4096 KB In 1949 the Indian mathematician D.R. Kaprekar discovered a class of numbers called self-numbers. For any positive…
time limit per test: 0.25 sec. memory limit per test: 4096 KB Every city in Berland is situated on Ox axis. The government of the country decided to build new telecasting stat…
有时候程序员有很奇怪的方法来隐藏他们的口令。Binny会选择一个字符串S(由N个小写字母组成,5<=N<=5,000,000),然后他把S顺时针绕成一个圈,每次取一个做开头字母并顺时针依次取字母而组成一个字符串。这样将得到一些字符串,他把它们排序后取出第一个字符串。把这个字符串的第一个字母在原字符串中的位置-1做为口令。 如字符串ala…
time limit per test: 0.25 sec. memory limit per test: 4096 KB For given number N you must output amount of N-digit numbers, such, that last digits of their square is equal to …
Time limit per test: 0.25 second(s) Memory limit: 4096 kilobytes In the city of Dingilville the traffic is arranged in an unusual way. There are junctions and roads connecting…
由于SGU上神题遍地,特列此表,便于训练时分类训练。 101 Domino 欧拉路 102 Coprime 枚举/数学方法 103 Traffic Lights 最短路 104 Little Shop of Flowers 动态规划 105 Div 3 找规律 106 The Equation 扩展欧几里德 107 987654321 Proble…
time limit per test: 0.25 sec. memory limit per test: 4096 KB For given integer N (1<=N<=104) find amount of positive numbers not greater than N that coprime with N. Let…
time limit per test: 0.25 sec. memory limit per test: 4096 KB Dominoes – game played with small, rectangular blocks of wood or other material, each identified by a number of d…
题目描述 某一村庄在一条路线上安装了n盏路灯,每盏灯的功率有大有小(即同一段时间内消耗的电量有多有少)。老张就住在这条路中间某一路灯旁,他有一项工作就是每天早上天亮时一盏一盏地关掉这些路灯。 为了给村里节省电费,老张记录下了每盏路灯的位置和功率,他每次关灯时也都是尽快地去关,但是老张不知道怎样去关灯才能够最节省电。他每天都是在天亮时首先关掉自己所处…
Description 小刚在玩JSOI提供的一个称之为“建筑抢修”的电脑游戏:经过了一场激烈的战斗,T部落消灭了所有z部落的入侵者。但是T部落的基地里已经有N个建筑设施受到了严重的损伤,如果不尽快修复的话,这些建筑设施将会完全毁坏。现在的情况是:T部落基地里只有一个修理工人,虽然他能瞬间到达任何一个建筑,但是修复每个建筑都需要一定的时间。同时…