topcoder srm434 翻译下

来源:百度知道 编辑:UC知道 时间:2024/06/14 11:53:42
Problem Statement
    
You are given a vector <string> table representing a rectangular grid where each cell contains a digit. The j-th character of the i-th element of table is the digit in the cell at row i, column j of the grid.
Consider a sequence of distinct cells in this table where the row numbers of the cells (in the order they appear in the sequence) form an arithmetic progression, and the column numbers also form an arithmetic progression. Concatenate the digits in the cells of this sequence to obtain a number.
Among all numbers that can be obtained in this manner, find and return the largest perfect square (a square of an integer). If there are no perfect squares, return -1 instead.
Definition
    
Class:
FindingSquareInTable
Method:
findMaximalSquare
Parameters:
vector <string>
Returns:
int
Method signature:
int findMaximalSquare(vector <str

问题陈述

你会得到一个载体<string>表代表了矩形网格,每个单元包含一个数字。第j性质一次元的表是在单元格中位数在排第一,列学报发车。
考虑一系列不同细胞在本表中的行号的单元格(在该命令中出现的顺序)组成一个等差数列和列数也形成一个等差数列。串连的数字中的细胞这一序列获得号码。
在所有的数字,可通过这种方式,找到并返回最大的完美平方米(一平方米的一个整数) 。如果没有完善的广场,而不是返回-1 。
定义

类别:
FindingSquareInTable
方法:
findMaximalSquare
参数:
载体<string>
回报:
国际
方法签名:
国际findMaximalSquare (矢量<string>表)
(确保您的方法是公开的)


-
算术级数是一个数列的不同之处每个号码和以前的号码不变。
限制
-
表将包含1至9片,包容性。
-
各组成部分的表将包含1至9字,包容性。
-
所有内容的表格将在同一时间。
-
每个元素表将只包含数字( '0 ' - '9 ' ) 。
实例
0 )

( “ 123 ” ,
“ 456 ” )
回报率: 64
几个3位数号码可以得到: 123 , 321 , 456和654 ,但没有人是一个完美的正方形。最大可完美平方米为64 。
1 )

( “ 00000 ” ,
“ 00000 ” ,
“ 00200 ” ,
“ 00000 ” ,
“ 00000 ” )
回报率: 0
0是一个完美的正方形。它是最大的一个,可在此表中。
2 )