태터데스크 관리자

도움말
닫기
적용하기   첫페이지 만들기

태터데스크 메시지

저장하였습니다.

안드로이드용 영어 어학기 Smart LC

스마트LC 소개 링크:
http://blog.ehxm.net/123

티스토어 링크:
http://bit.ly/awW3XW

"icpc"에 해당되는 글 1건

  1. 2009/10/27 알고리즘 (기본) - ACM Seoul Regional A - Score (2)

알고리즘 (기본) - ACM Seoul Regional A - Score

Posted by EHXM. Posted in " 경험/알고리즘 "2009/10/27 12:09

The 30th Annual ACM International Collegiate
Programming Contest ASIA Regional - Seoul

Problem A
Score

There is an objective test result such as “OOXXOXXOOO”. An ‘O’ means a correct answer of a problem and
an ‘X’ means a wrong answer. The score of each problem of this test is calculated by itself and its just
previous consecutive ‘O’s only when the answer is correct. For example, the score of the 10th problem is 3
that is obtained by itself and its two previous consecutive ‘O’s.
Therefore, the score of “OOXXOXXOOO” is 10 which is calculated by “1+2+0+0+1+0+0+1+2+3”.
You are to write a program calculating the scores of test results.

Input
Your program is to read from standard input. The input consists of T test cases. The number of test cases T is
given in the first line of the input. Each test case starts with a line containing a string composed by ‘O’ and
‘X’ and the length of the string is more than 0 and less than 80. There is no spaces between ‘O’ and ‘X’.

Output
Your program is to write to standard output. Print exactly one line for each test case. The line is to contain the
score of the test case.
The following shows sample input and output for five test cases.

Sample Input
5
OOXXOXXOOO
OOXXOOXXOO
OXOXOXOXOXOXOX
OOOOOOOOOO
OOOOXOOOOXOOOOX

Output for the Sample Input
10
9
7
55
30

관련 TAG로 검색해보세요. : , , ,

¬ COMMENT [2]

  1. Posted by 우욱2010/02/15 18:08

    넘 쉬운데요.. 진짜 ACM 문제 맞나요? -_-;;
    <html>
    <head>
    <title>sol 30'th ACM prob. A</title>
    <script type="text/javascript">
    function calc_score()
    {
    var given_str = document.getElementById( 'inStr' ).value;
    var sum = 0;
    var sub_sum = 0;
    for( var ii = 0; ii < given_str.length; ii++ )
    {
    var cur_char = given_str.substr( ii, 1 );
    if( 'O' == cur_char )
    {
    sub_sum++;
    sum += sub_sum;
    }
    else
    {
    sub_sum = 0;
    }
    }
    document.getElementById( 'rst' ).value = sum;
    }
    </script>
    <head>
    <body>
    <input type="text" id="inStr" />
    <input type="button" onclick="javascript:calc_score();" value="calc" /><br />
    <input type="text" id="rst" readonly="true" />
    </body>
    </html>

     수정/삭제  댓글쓰기

여러분의 커뮤니케이션을 기다리고 있습니다.

  1. : 이름
  2. : 홈페이지

  1. : 비밀번호

[안드로이드] 영어 어학기 어플

영어 듣기 공부 많이들 하시나요? 따로 어학기를 장만하시기는 비용이 들죠? 스마트폰에서 MP3 파일을 터치를 이용해서 자유롭게 듣을 수 있는 영어 어학기 어플입니다. 동아리.....

2010년 대한민국 매쉬업 경진대회 후기, 아이디어 전쟁을 다녀와서..

아이디어의 전쟁의 현장이었던 2010년 대한민국 매쉬업 경진대회에 다녀왔습니다. 이번 대회는 지난 2월 6일(토요일), 삼성동 코엑스 컨퍼런스룸 401에서 열렸습니다. 이번.....

2010년 100가지가 넘는 안드로이드폰이 몰려온다!

2010년에 100가지가 넘는 안드로이드 폰 출시가 될 예정입니다. Mobile World Congress keynote에서 Google CEO Eric Schmidt의 연설.....

[안드로이드] 모토로이 체험할 수 있는 곳 (전국)

서울, 안양, 부산, 대구, 광주, 대전에 안드로이드 폰 체험 할 수 있는 곳이 있네요. 저는 코엑스 메가박스 입구에 있는 모토로라 체험 부스에서 우연히 모토로이를 만져보게 되.....

위 3D 갤러리는 http://www.fotoviewr.com/ 사이트의 Fotoviewr 입니다. Flex와 Papervision3D를 이용하여 위와같은 3D 갤러리를 구현해.....

무료 MP3 포멧 변경 툴 - Free MP3 WMA Converter
무료 MP3 포멧 변경 툴 - Free MP3 WMA Converter
무료 MP3 포멧 변경 툴 - Free MP3 WMA Converter
무료 MP3 포멧 변경 툴 - Free MP3 WMA Converter
언톡 2010년 신입생 모집 포스터
Android, LEGO NXT를 이용한 Sudoku Solving Robot 제작
Android, LEGO NXT를 이용한 Sudoku Solving Robot 제작
Android, LEGO NXT를 이용한 Sudoku Solving Robot 제작
Android, LEGO NXT를 이용한 Sudoku Solving Robot 제작

Category

전체보기 (108)
Anycall Dreamers (1)
안드로이드 (39)
Adobe Flash Platform (20)
Algorithm (0)
개발노트 (6)
경험 (33)

글 보관함

2011/02 (3)

2011/01 (1)

2010/09 (1)

2010/08 (1)

2010/07 (2)

Calendar

«   2012/02   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29      

믹시


Total : 115,866 Today : 222 Yesterday : 155