• 문제 : http://acm.kaist.ac.kr/2008/problems/B_6174.pdf

  • 입력값
  • 3
    6174
    1789
    2005

  • 출력값
  • 0
    3
    7 

  • 소스코드(파일)

  • 소스코드
  • 문제 : http://acm.kaist.ac.kr/2008/problems/A_Decryption.pdf

  • 입력값
  • 3
    asvdge ef ofmdofn
    xvssc kxvbv
    hull full suua pmlu

  • 출력값
  • f
    v
    ?

  • 소스코드(파일)

  • 소스코드
문제 : http://www.programming-challenges.com/pg.php?page=downloadproblem&probid=110502&format=html

Status : Solved
#include <iostream> using namespace std; unsigned int reverse(unsigned int input); int main(void) { unsigned int numberOfTestcase, input, i; cin >> numberOfTestcase; for(i = 0; i < numberOfTestcase; i++) { int count = 0; cin >> input; if(input == reverse(input)) { cout << 0 << " " << input << endl; } else { while((input = input + reverse(input)) != reverse(input)) { count++; } cout << ++count << " " << input << endl; } } return 0; } unsigned int reverse(unsigned int input) { unsigned int result = 0; while(input > 0) { result *= 10; result += input % 10; input = input / 10; } return result; }

invalid-file

문제

 
invalid-file

Source Code

문제풀이 시간 : 10분(코딩 포함)
Solved 받아낼때까지 걸린 시간 : 1시간

그동안 Wrong Answer로 일관하던 Programming Challenges 로봇이 드디어 'Solved'를
뱉어냈다;;
문제는 경계값도 아니고 입력문제도 아니고 기본자료형의 최대크기문제???
Visual C++에서는 int형을 4바이트로 처리하기때문에 1,000,000이라는 숫자를 다룰 때 문제가
없지만 Programming Challenges의 로봇이 사용하는 컴파일러는 아마도 int형을 2바이트로
처리하는듯 하다.
그래서 65535를 넘어가면 문제를 일으켜서 'Wrong Answer'를 뱉어낸것 같다.
하지만 Runtime이 3초가 넘는걸 보면 알고리즘을 엄청나게 비효율적으로 설계한듯;;
Best Time이 0.008초로 나와있는데....대체 어떻게 알고리즘을 설계했길래 저런 시간이
나올 수 있는겐지;;
암튼 오랫동안 답을 얻지 못했던 문제를 풀어서 뿌듯하다.(물론 오래전에 문제를 풀긴 했으나
로봇덕분에 삽질을 계속 했었다;)

SoC는 이제 카메라테스트까지 남은 시간동안 손 떼도 될것같고 이번주는 ACM에 올인 예정.
ACM을 너무 소홀히 한건가;;
오랜만에 문제를 풀려니 풀리지가 않네;;
그나저나 SoC 준비하느라 고생한 우리 팀원들 모두 수고하셨습니다.
한게 없어서 민망하긴 하지만;;
그래도 끝냈네요...

아래 사진은 밤샘과 노가다의 산물.

사용자 삽입 이미지


사용자 삽입 이미지
invalid-file

Source Code

invalid-file

Sample Test Case


문제 : http://cv.chonbuk.ac.kr/~alps/problem/icpc2004/2004oa.pdf

A게 답게 쉬웠던 문제.
예외처리는 안했음.
귀찮아서.

invalid-file

Source Code

invalid-file

Sample Input



영어문제는 항상 해석하는게 귀찮다;;
문제 자체는 쉬움.
----

Greedy Gift Givers

A group of NP (2 ≤ NP ≤ 10) uniquely named friends has decided to exchange gifts of money. Each of these friends might or might not give some money to any or all of the other friends. Likewise, each friend might or might not receive money from any or all of the other friends. Your goal in this problem is to deduce how much more money each person gives than they receive.

The rules for gift-giving are potentially different than you might expect. Each person sets aside a certain amount of money to give and divides this money evenly among all those to whom he or she is giving a gift. No fractional money is available, so dividing 3 among 2 friends would be 1 each for the friends with 1 left over -- that 1 left over stays in the giver's "account".

In any group of friends, some people are more giving than others (or at least may have more acquaintances) and some people have more money than others.

Given a group of friends, no one of whom has a name longer than 14 characters, the money each person in the group spends on gifts, and a (sub)list of friends to whom each person gives gifts, determine how much more (or less) each person in the group gives than they receive.


IMPORTANT NOTE

The grader machine is a Linux machine that uses standard Unix conventions: end of line is a single character often known as '\n'. This differs from Windows, which ends lines with two charcters, '\n' and '\r'. Do not let your program get trapped by this!


PROGRAM NAME: gift1


INPUT FORMAT

Line 1: The single integer, NP
Lines 2..NP+1: Each line contains the name of a group member
Lines NP+2..end: NP groups of lines organized like this:
The first line in the group tells the person's name who will be giving gifts.
The second line in the group contains two numbers: The initial amount of money (in the range 0..2000) to be divided up into gifts by the giver and then the number of people to whom the giver will give gifts, NGi (0 ≤ NGi ≤ NP-1).
If NGi is nonzero, each of the next NGi lines lists the the name of a recipient of a gift.

Ad Hoc Problems

`Ad hoc' problems are those whose algorithms do not fall into standard categories with well-studied solutions. Each ad hoc problem is different; no specific or general techniques exist to solve them.

Of course, this makes the problems the `fun' ones, since each one presents a new challenge. The solutions might require a novel data structure or an unusual set of loops or conditionals. Sometimes they require special combinations that are rare or at least rarely encountered.

Ad hoc problems usually require careful reading and usually yield to an attack that revolves around carefully sequencing the instructions given in the problem.

Ad hoc problems can still require reasonable optimizations and at least a degree of analysis that enables one to avoid loops nested five deep, for example.

More ad hoc problems appear on this web site than any other kind of problem. Always be ready for an ad hoc problem if you can not classify a problem as one of the other standard types (to be listed later).

길고도 길었던 3학년 1학기가 끝나고 이제 방학 시작이다.
학사일정상 방학은 시작한지 일주일째가 되어가는데 나는 DB 프로젝트에다 OS과제 때문에
이제서야 시작이다.
비록 OS 과제는 다 끝내지 못했지만, 뭐 내 실력이 거기까지니깐...
좌절하지 말고 실력을 더 쌓자.


OS 빼고는 성적이 다 나왔다.
예상했던 과목도 있고 의외였던 과목도 있고.
어쨌거나 지금까지의 내 성적과는 비교할 수 없을정도의 초라한 성적이지만...
뭐 이번학기 내내 예상했었으니까, 성적과도 바꿀 수 없는 소중한 사람들을 만났으니까.
그걸로 나는 만족한다.
작은것에 집착하지 않으련다.
마음을 크게 갖고, 더 큰 앞을 바라보고 열심히 해야지.
그래도 다음학기 컴소 원조엘리트 부활 프로젝트는 예정대로 꼭 진행할거다.
수석 한번은 해보고 졸업하자는게 내 목표니까. :(


방학때는 내가 하고싶은거 하면서 알차게 보내고싶다.
당장 하고싶은건, ACM ICPCSoC 대회 준비.

정말 열심히 해서 좋은성적 거두고싶다.
그렇게 하고싶던 공부들이니까.
그리고 경섭이와 함께 Wiki 만들기!
학기중에는 못하는 문화생활도 즐겨야지~~~~~


해피해피 방학~~~~ ^^

+ Recent posts