السابق التالي
0 / 21
الوحدة النمطية DEMO-32-109DEMO-C-32

Cinema Seating

DEMO-C-32 • Programming in C

Browser-only practice

بيان المشكلة

Given a binary matrix representing cinema seats (0=Empty, 1=Occupied), find the length of the longest consecutive sequence of empty seats (0s) in any single row.

قيود

1 <= N, M <= 10. Integers within standard range.

تنسيق الإدخال

Input: Dimensions N M followed by the matrix elements.

تنسيق الإخراج

Output: The formatted result as specified.

حالات اختبار نموذجية

Submit runs every public testcase in this browser. Results and code never leave this device.

العينة رقم 1
عينة ظاهرة
6 8
1 1 0 0 0 0 0 1
1 0 1 1 0 1 1 0
0 1 0 1 0 0 0 0
0 1 1 1 1 0 0 1
0 0 0 0 1 0 1 0
0 0 0 0 0 1 0 1
5
Max sequence of zeros is 5.
العينة رقم 2
عينة ظاهرة
7 3
0 1 1
0 1 0
1 1 0
0 0 0
1 0 1
0 1 0
1 1 1
3
Max sequence of zeros is 3.
العينة رقم 3
عينة ظاهرة
5 8
1 1 1 1 1 1 1 0
0 1 0 1 0 1 1 1
0 0 0 0 1 1 1 1
1 1 0 1 0 1 0 0
1 1 0 0 1 1 1 0
4
Max sequence of zeros is 4.
العينة رقم 4
عينة ظاهرة
8 5
0 1 0 1 0
1 1 1 0 1
0 0 0 0 1
0 1 0 0 1
1 0 0 1 1
1 0 0 0 0
1 0 1 0 1
1 1 0 1 1
4
Max sequence of zeros is 4.

Web terminal

C, C++, Java, and Python run locally in a browser VM. No worker or visualizer is used.

Saved in this browser
إعدادات المحرر