Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

BCBEADS - Đếm hạt

Bessie đã đổ ra bộ sưu tập của cô với N (1<=N<=80) hạt xanh và cam (biểu diễn bởi 0 và 1) xuống sàn.

Bessie dọn dẹp sự lộn xộn bằng cách sắp xếp chúng lại thành 1 đường thẳng dài. Cô muốn đếm số lần hai hạt

liên tiếp khác màu nhau. Hãy giúp cô thực hiện điều này.


INPUT:

* Dòng 1: 1 số nguyên: N

* Dòng 2: Dòng 2 chứa N số nguyên, mỗi số là 0 hoặc 1

OUTPUT:

* Dòng 1: 1 số nguyên biểu diễn số lần hai hạt liên tiếp khác màu.


VÍ DỤ:


INPUT:

6

1 0 0 1 1 1

SAMPLE OUTPUT :

2

Bessie has spilled her collection of N (1 <= N <= 80) blue and orange
cowbeads (represented as 1s and 0s, respectively, in the human world) on
the floor. She cleans up the mess by arranging the beads into a long line.
She then counts the number of times a blue bead is next to an orange bead
and vice versa, but is not sure if she is correct. Write a program to
validate Bessie's count.
PROBLEM NAME: countbead
INPUT FORMAT:
* Line 1: A single integer: N
* Line 2: Line 2 contains N integers, each of which is 0 or 1
SAMPLE INPUT (file countbead.in):
6
1 0 0 1 1 1
INPUT DETAILS:
There are six beads in total: the first bead in the line is a blue bead,
followed by two orange beads, and finally by three blue beads.
OUTPUT FORMAT:
* Line 1: A single integer describing the number of occurrences that a
        blue bead is next to an orange bead and vice versa.
SAMPLE OUTPUT (file countbead.out):
2
OUTPUT DETAILS:
There are two times in the line that two differently colored beads are next
to each other.has spilled her collection of N (1 <= N <= 80) blue and orange
cowbeads (represented as 1s and 0s, respectively, in the human world) on
the floor. She cleans up the mess by arranging the beads into a long line.
She then counts the number of times a blue bead is next to an orange bead
and vice versa, but is not sure if she is correct. Write a program to
validate Bessie's count.
PROBLEM NAME: countbead
INPUT FORMAT:
* Line 1: A single integer: N
* Line 2: Line 2 contains N integers, each of which is 0 or 1
SAMPLE INPUT (file countbead.in):
6
1 0 0 1 1 1
INPUT DETAILS:
There are six beads in total: the first bead in the line is a blue bead,
followed by two orange beads, and finally by three blue beads.
OUTPUT FORMAT:
* Line 1: A single integer describing the number of occurrences that a
        blue bead is next to an orange bead and vice versa.
SAMPLE OUTPUT (file countbead.out):
2
OUTPUT DETAILS:
There are two times in the line that two differently colored beads are next
to each other.


ID RESULT TIME
code...



Được gửi lên bởi:adm
Ngày:2011-11-03
Thời gian chạy:0.200s
Giới hạn mã nguồn:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Ngôn ngữ cho phép:ASM32-GCC ASM32 MAWK BC C CSHARP CPP C++ 4.3.2 CPP14 COFFEE LISP sbcl DART FORTH GO JAVA JS-RHINO JS-MONKEY KTLN OCT PAS-GPC PAS-FPC PERL PERL6 PROLOG PYTHON PYTHON3 PY_NBC R RACKET SQLITE SWIFT UNLAMBDA
Nguồn bài:USACO Oct 2010 Bronze

hide comments
2017-08-20 20:08:01 Con Bò Huyền Thoại
http://kienthuc24h.com/bcbeads-spoj-ptit-dem-hat/
2017-07-02 12:37:51
BCBEADS: http://e16cn-ptit.blogspot.com/2017/12/bcbeads-dem-hat.html

Last edit: 2017-12-06 18:40:43
2015-03-26 12:24:42 Con Bò Huyền Thoại


Last edit: 2017-08-20 20:08:08
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.