PKU 2853. Sequence Sum Possibilities. AC get.
#include #include int main() { int n, num, input, limit, i, cnt; scanf("%d", &n); while(n--) { scanf("%d%d", &num, &input); cnt = 0; for (i = 1; input > 0; i++) { input -= i; if (!(input % i)) { cnt++; } } printf("%d %d\n", num, cnt - 1); } } ..... 숏코딩입니다. -_-;
더보기
PKU 1008, UVa 300. Maya Calendar. AC get.
#include #include char *HaabMonth[18]={"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab", "cumhu"}; char *TzolkinDay[20]={"imix", "ik", "akbal", "kan", "chicchan", "cimi", "manik", "lamat", "muluk", "ok", "chuen", "eb", "ben", "ix", "mem", "cib", "caban", "eznab", "canac", "ahau"}; int main() { int n, i; int year, mon..
더보기
12. 500개 이상의 약수를 가진 트라이앵글 숫자는 무엇인가
The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ... Let us list the factors of the first seven triangle numbers: 1: 1 3: 1,3 6: 1,2,3,6 10: 1,2,5,10 15: 1,3,5,15 21: 1,3,7,21 28: 1,2,4,7,14,28We can see that 28 is the first triangle n..
더보기