Problem Description Given a positive integer n and the odd integer o and the nonnegative integer p such that n = o2^p. Example For n = 24, o = 3 and p = 3. Task Write a program which for each data set: reads a positive integer n, computes the odd int…
题目描述:  A Simple Task time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Given a simple graph, output the number of simple cycles in it. A simple cycle is a cycle with no repeated vertices or…
http://acm.hdu.edu.cn/showproblem.php?pid=1339 正常做法超时,要有点小技巧存在. A Simple Task Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3372    Accepted Submission(s): 1837 Problem Description Given a po…
A Simple Task CodeForces - 11D 题意:输出一个无向图的简单环数量.简单环指无重复边的环.保证图无重边自环. ans[i][j]表示"包含i中的点,以i中第一个点为起点,以j为终点"的路径条数. 对于某个i,枚举当前终点j(显然不能是首个点),产生一个状态.再枚举上一次终点k,如果能转移就转移. 如果i中点数大于2且j到i中第一个点有路,就认为产生了环.最后每个环记录了两遍,要除以2. #include<cstdio> #include<c…
Description       话说, 小X是个数学大佬,他喜欢做数学题.有一天,小X想考一考小Y.他问了小Y一道数学题.题目如下:      对于一个正整数N,存在一个正整数T(0<T<N),使得…
E. A Simple Task Problem's Link: http://codeforces.com/problemset/problem/558/E Mean: 给定一个字符串,有q次操作,每次操作将(l,r)内的字符升序或降序排列,输出q次操作后的字符串. analyse: 基本思想是计数排序. 所谓计数排序,是对一个元素分布较集中的数字集群进行排序的算法,时间复杂度为O(n),但使用条件很苛刻.首先对n个数扫一遍,映射出每个数字出现的次数,然后再O(n)扫一遍处理出:对于数字ai,…
A Simple Task Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4313    Accepted Submission(s): 2372 Problem Description Given a positive integer n and the odd integer o and the nonnegative intege…
题目链接:http://codeforces.com/contest/558/problem/E E. A Simple Task time limit per test5 seconds memory limit per test512 megabytes inputstandard input outputstandard output   This task is very simple. Given a string S of length n and q queries each qu…
E. A Simple Task 题目连接: http://www.codeforces.com/contest/558/problem/E Description This task is very simple. Given a string S of length n and q queries each query is on the format i j k which means sort the substring consisting of the characters from…
题目链接: http://codeforces.com/problemset/problem/558/E E. A Simple Task time limit per test5 secondsmemory limit per test512 megabytes 问题描述 This task is very simple. Given a string S of length n and q queries each query is on the format i j k which mea…