http://poj.org/problem?id=2140 Description The cows in farmer John's herd are numbered and branded with consecutive integers from 1 to N (1 <= N <= 10,000,000). When the cows come to the barn for milking, they always come in sequential order from 1…
Herd Sums Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 772 Accepted Submission(s): 375 Problem Description The cows in farmer John's herd are numbered and branded with consecutive integers…
#include<iostream> #include<stdio.h> using namespace std; int main() { int num; int i; int j; int sum; int ans; cin>>num; sum = ; ans = ; ; j <= num/; ++ j) { sum = ; + ; ++ i) { sum += i; if(sum > num) break; else if(sum == num) {…
一.Description The creators of a new programming language D++ have found out that whatever limit for SuperLongInt type they make, sometimes programmers need to operate even larger numbers. A limit of 1000 digits is so small... You have to find the sum…
一.Description One of the first users of BIT's new supercomputer was Chip Diller. He extended his exploration of powers of 3 to go from 0 to 333 and he explored taking various sums of those numbers. ``This supercomputer is great,'' remarked Chip. ``I…