В
Все
М
Математика
А
Английский язык
Х
Химия
Э
Экономика
П
Право
И
Информатика
У
Українська мова
Қ
Қазақ тiлi
О
ОБЖ
Н
Немецкий язык
Б
Беларуская мова
У
Українська література
М
Музыка
П
Психология
А
Алгебра
Л
Литература
Б
Биология
М
МХК
О
Окружающий мир
О
Обществознание
И
История
Г
Геометрия
Ф
Французский язык
Ф
Физика
Д
Другие предметы
Р
Русский язык
Г
География
nikitacRon
nikitacRon
24.10.2021 06:23 •  Информатика

Problem 2 (only c++)
1 second
256 megabytes
everyone is afraid of something. someone is afraid of darkness, someone is afraid of heights, someone is afraid of public toilets (all of us are afraid of public toilets), someone is afraid of debts… there are many fears, but the greatest among all for unknown_user2019 is choosing a land for planting strawberries. unknown_user2019's land can be described as a matrix with n rows and m columns. some of the fields in the matrix are suitable for planting strawberries and some are not – weeds grow there. unknown_user2019 is looking for rectangular parts of the land that are completely filled with fields suitable for strawberry planting. those kinds of rectangles are called suitable rectangles. also, unknown_user2019 is interested in the potential value of all fields in the matrix. the potential value of each field in the matrix is defined as the number of suitable rectangles that contain that field. since unknown_user2019 has troubles facing his fears, he asks you to only calculate the sum of all the fields' potential values. input the first line contains two positive integers n and m (1 ≤ n, m ≤ 2 000), dimensions of the land. the next n lines contains m characters each, representing the landscape. each character can be either a ‘.’ (dot) which represents a field suitable for planting or a ‘#’ which represents weeds. output output the sum of all potential values of the matrix’s fields.
scoring in test cases worth 20% of the total points, it will hold that 1 ≤ n, m ≤ 10. in test cases worth additional 30% of the total points, it will hold that 1 ≤ n, m ≤ 300.
input
2 3 .#. .#
output
8
input
3 3
output
100
input
3 4 ..#. # #
output
40
clarification of the first sample test: the following matrix describes the potential values of the land’s fields. the sum of all potential values is 8.
2 0 1
3 2 0

Показать ответ
Ответ:
twv05355
twv05355
29.02.2020 13:15
1) На старом механическом вычислительном устройстве – арифмометре – можно было умножать восьмизначные числа на четырехзначные. - 1
Да, можно было.
2) Билл Гейтс написал свою первую программу на языке программирования Basic в 13 лет, и она называлась «Сапёр». - 0.
Да, в 13 лет и на Бейсике, но это были крестики-нолики.
3) Символом операционной системы Linux является кролик, потому что в детстве разработчика этой системы в зоопарке укусило именно это
животное. - 0. Символ Linux - пингвин Lilo.
4) В Швейцарии установлен один из дата-центров с множеством серверов, который подогревает воду в небольшом озере. - 1. Есть такой.
5) ФБР считает, что Одноклассники – лучшая площадка для общения террористов. - 0. ФБР считает, что это Твиттер.

Число 1010 в двоичной системе = 10 в десятичной системе.
0,0(0 оценок)
Ответ:
Astento
Astento
09.10.2021 11:26
//Pascal ABC.NET v3.0 сборка 1111

begin
var d:=ReadlnString('Вас приветствует программа, которая может делить '+'два числа с остатком. Напишите свое имя');
Writeln('Здравствуйте, ',d,'!');

repeat
Writeln('Как нужно написать ответ?',#13#10,'1 вариант. 5: 3 = 1(ост.2)',#13#10,'2 вариант. 5 = 3*1 + 2',#13#10,'0 - завершить работу');
  var c:char;
   Repeat
    c:=ReadlnChar('Введите 0, 1 или 2:');
     case c of
      '0': exit;
      '1','2':break;
      end;
    until False;
  var a,b:BigInteger;
 if not BigInteger.TryParse(ReadlnString('Введите целочисленное делимое:'),a) then
 begin
  Writeln('Вы ввели неверное значение. Работа завершена');
  Exit
 end;
 if not BigInteger.TryParse(ReadlnString('Введите целочисленный делитель:'),b) then
 begin
  Writeln('Вы ввели неверное значение. Работа завершена');
  Exit
 end;
 if integer(b)=0 then
{приведение к типу Integer. Менее абстрактно, чем BigInteger}
  begin
   writeln('Вы ввели неверное значение.');
   exit
  end;
if c='1' then WritelnFormat('{0}:{1}={2}(ост.{3})',a,b,a div b,a mod b)
else
WritelnFormat('{0}={1}*{2}+{3}',a,b,a div b,a mod b);
var f:char;
Repeat
f:=ReadlnChar('Если вы хотите завершить работу, введите "0", если продолжить - любую букву.');
case f of
'0': exit;
else break;
end;
until False;
until False
 end.
0,0(0 оценок)
Популярные вопросы: Информатика
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота