Submission #17468

# Submission time Handle Problem Language Result Execution time Memory
17468 2015-12-18T10:24:18 Z AZE_XeRoX UFO (IZhO14_ufo) C++
Compilation error
0 ms 0 KB
#include <iostream>
#include <cmath>
#include <iomanip>
#include <algorithm>
 
#define intt long long int
  
using namespace std;
  
  intt n , m , r , k , p ; 
  
int main ()
 {
       
    intt h , abs , x  ;
 

    char s ;    

    cin >> n >> m >> r >> k >> p ;
     
    intt a[n][m] ;
     
    for ( intt i = 1 ; i <= n ; i ++ )
    
        for ( intt j = 1 ; j <= m ; j ++ ) cin >> a[i][j] ;
     
    for ( intt t = 0 ; t < k ; t ++ ) {
         
        cin >> s >> x >> h ;
         
        intt rr ;
        
        rr = r ; 
         
        if ( s == 'N' ) 
        
        for ( intt i = 1; i <= n; i ++ )
            
            if ( rr && a[i][x] >= h) a[i][x] --, rr -- ;
            
            else if ( rr != 0  ) break;
             
        if ( s == 'W' ) 
        
        for ( intt i = 1; i <= m; i ++ )
           
            if ( rr && a[x][i] >= h ) a[x][i] --, r -- ;
           
            else if ( rr != 0  ) break;
             
        if ( s == 'E' ) 
        
        for ( intt i = n; i >= 1; i -- )
           
            if ( rr && a[x][i] >= h ) a[x][i] --, r -- ;
            
            else if ( rr != 0  ) break;
             
        if ( s == 'S' )
        
         for ( intt i = m; i >= 1; i -- )
            
            if ( rr && a[i][x] >= h ) a[i][x] --, r -- ;
            
            else if (rr != 0 ) break;
             
    }
     
    for ( intt i = 1 ; i <= n - p + 1 ; i ++ ) {
         
        for ( intt j = 1 ; j <= m - p + 1 ; j++) {
             
            intt c ;
             
             c = 0 ;
             
            for ( intt t = i ; k < i + p ; k ++ )
              
                    for (intt q= j ; l < j + p ; l ++ )
                   
                    c += a[t][q];
       
            abs = max ( abs , c ) ;
       
        }
         
    }
     
    cout << abs << endl;
  
    return 0;
}

Compilation message

ufo.cpp: In function 'int main()':
ufo.cpp:80:38: error: 'l' was not declared in this scope
                     for (intt q= j ; l < j + p ; l ++ )
                                      ^