답안 #150890

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
150890 2019-09-01T10:01:32 Z PedroBigMan Strah (COCI18_strah) C++14
22 / 110
1000 ms 35572 KB
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
#define REP(i,a,b) for(ll i=a; i<b; i++)
#define pb push_back
#define mp make_pair
#define pl pair<ll,ll>
#define ff first
#define ss second
#define INF ((ll) pow(2,63) -1)
ll insig;
#define In(vecBRO, LENBRO) REP(IBRO,0,LENBRO) {cin>>insig; vecBRO.pb(insig);}
void Out(vector<ll> x) {REP(i,0,x.size()) {cout<<x[i]<<" ";} cout<<endl;}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    ll N,M; cin>>N>>M; ll a[N][M]; char cur;
    REP(i,0,N) {REP(j,0,M) {cin>>cur; if(cur=='.') {a[i][j]=1;} else {a[i][j]=0;};}}
    ll ans=0;
    REP(x1,0,N)
    {
        REP(y1,0,M)
        {
            REP(x2,x1,N)
            {
                REP(y2,y1,M)
                {
                    bool ok=true;
                    REP(i,x1,x2+1)
                    {
                        REP(j,y1,y2+1)
                        {
                            if(a[i][j]==0) {ok=false;}
                        }
                    }
                    if(ok) {ans+=(x2-x1+1)*(y2-y1+1);}
                }
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}

Compilation message

strah.cpp: In function 'void Out(std::vector<long long int>)':
strah.cpp:10:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define REP(i,a,b) for(ll i=a; i<b; i++)
strah.cpp:19:29:
 void Out(vector<ll> x) {REP(i,0,x.size()) {cout<<x[i]<<" ";} cout<<endl;}
                             ~~~~~~~~~~~~
strah.cpp:19:25: note: in expansion of macro 'REP'
 void Out(vector<ll> x) {REP(i,0,x.size()) {cout<<x[i]<<" ";} cout<<endl;}
                         ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1057 ms 1144 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1012 ms 1144 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1033 ms 1148 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1050 ms 9464 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1070 ms 22008 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1063 ms 14072 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1063 ms 2680 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1062 ms 35572 KB Time limit exceeded
2 Halted 0 ms 0 KB -