题目描述 Given two postive integers A and B, please calculate the maximum integer C that C*B≤A, and the real number D equal to A/B. 输入格式 Two integers A and B in one line separated by a space.(A,B>0) 输出格式 Output C in one line,followed by D in one line. D
两个整数相除会自动省略小数点后的小数位即使下面这种: int a,int b; int a = 4; int b = 3; double d = a/b; d= 1.0000000; --------------------------- 整数除法用 “/”的话得到的是一个整数(得到小数的话自动去掉小数位只保留整数位), 所以这里要得到实际除出来的数的话,先将两个数转化为double类型,再进行“/”除法. 至于要规定输出保留多少位小数,则用cout<<setprecision(2)<&
Bad Hair Day Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 24112 Accepted: 8208 Description Some of Farmer John's N cows (1 ≤ N ≤ 80,000) are having a bad hair day! Since each cow is self-conscious about her messy hairstyle, FJ wants
Highways Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 23070 Accepted: 6760 Special Judge Description The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has a very poor system of public highways. The Flatopian
Super-palindrome 时间限制: 1 Sec 内存限制: 128 MB 提交: 486 解决: 166 [提交] [状态] [命题人:admin] 题目描述 You are given a string that is consisted of lowercase English alphabet. You are supposed to change it into a super-palindrome string in minimum steps. You can chan
Hakase and Nano 时间限制: 1 Sec 内存限制: 128 MB 提交: 400 解决: 104 [提交] [状态] [命题人:admin] 题目描述 Hakase and Nano are playing an ancient pebble game (pebble is a kind of rock). There are n packs of pebbles, and the i-th pack contains ai pebbles. They take turns
Master of GCD 时间限制: 1 Sec 内存限制: 128 MB 提交: 670 解决: 112 [提交] [状态] [命题人:admin] 题目描述 Hakase has n numbers in a line. At fi rst, they are all equal to 1. Besides, Hakase is interested in primes. She will choose a continuous subsequence [l, r] and a pri
Description Given a connected undirected graph, tell if its minimum spanning tree is unique. Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning tree of G is a subgraph of G, say T = (V', E'), with the followi
Problem Description 相信大家都听说一个"百岛湖"的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现.现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件,就是2个小岛之间的距离不能小于10米,也不能大于1000米.当然,为了节省资金,只要求实现任意2个小岛之间有路通即可.其中桥的价格为 100元/米.