| #include <iostream> using namespace std; int n, m; int map[105][105]; int gg(int a, int b, int count) {     if (b <= m)     {         if (map[a][b] == 1)             count++;         else             return count;     }     gg(a, b + 1, count); } int ss(int a, int b, int count, int g) {     if (a <= n)     {         if (map[a][b] == 1)         {             int zero;             zero = gg(a, b + 1, 1);             if (zero >= g)                 count++;             else                 return count++;         }         else             return count;     }     ss(a + 1, b, count, g); } int main() {     int testcase;     cin >> testcase;     while (testcase--)     {         cin >> n >> m;         for (int i = 0; i < n; i++)         {             for (int j = 0; j < m; j++)             {                 int num;                 cin >> num;                 if (num == 0)                     map[i][j] = 1;                 else                     map[i][j] = 2;             }         }         int garo;         int sero;         int mul = 0;         int max = 0;         for (int i = 0; i < n; i++)         {             for (int j = 0; j < m; j++)             {                 if (map[i][j] == 1)                 {                     garo = gg(i, j + 1, 1);                     sero = ss(i + 1, j, 1, garo);                     mul = garo * sero;                     if (mul >= max)                     {                         max = mul;                     }                 }             }         }         cout << max << endl;     }     return 0; } | cs | 
'NOTE > Algorithm' 카테고리의 다른 글
| 자료구조) Graph (0) | 2015.08.25 | 
|---|---|
| 자료구조) QuickSort (0) | 2015.08.25 | 
| 자료구조) linked_queue (0) | 2015.08.25 | 
| 자료구조) linked_stack (0) | 2015.08.25 | 
| dovelet) maze 최단 거리 미로 (0) | 2015.08.25 |