답안 #560261

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
560261 2022-05-11T08:16:58 Z AGE Strah (COCI18_strah) C++14
22 / 110
1000 ms 14856 KB
#include<bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define int long long
using namespace std;
const int N=1e5+5,M=2e3+10,mod=100000000000031;
vector<int>v;

long long  summ(long long  x,long long  y){
    return ((x%mod)+(y%mod))%mod;
}

long long  mult(long long  x,long long  y){
    return ((x%mod)*(y%mod))%mod;
}
int ans[15][15];
string s[N];
main()
{
    int n,m;
    cin>>n>>m;


    for(int i=0;i<n;i++)
        cin>>s[i];

    for(int i=0;i<n;i++)
        for(int j=0;j<s[i].size();j++)
            for(int k=i;k<n;k++)
                for(int kk=j;kk<s[k].size();kk++){

                    int ok=0;

                    for(int x=i;x<=k;x++)
                        for(int y=j;y<=kk;y++)
                            if(s[x][y]=='#')
                                ok=1;

                    if(ok==0)
                        for(int x=i;x<=k;x++)
                            for(int y=j;y<=kk;y++)
                                 ans[x][y]++;
                }


    int answer=0;

    for(int i=0;i<n;i++)
        for(int j=0;j<s[i].size();j++)
            answer+=ans[i][j];

    cout<<answer<<endl;

    return 0;
}

Compilation message

strah.cpp:19:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   19 | main()
      | ^~~~
strah.cpp: In function 'int main()':
strah.cpp:29:22: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |         for(int j=0;j<s[i].size();j++)
      |                     ~^~~~~~~~~~~~
strah.cpp:31:32: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |                 for(int kk=j;kk<s[k].size();kk++){
      |                              ~~^~~~~~~~~~~~
strah.cpp:50:22: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   50 |         for(int j=0;j<s[i].size();j++)
      |                     ~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 3412 KB Output is correct
2 Correct 2 ms 3412 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 3412 KB Output is correct
2 Correct 2 ms 3412 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1077 ms 3668 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1075 ms 3668 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 721 ms 7116 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1074 ms 5964 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1048 ms 8244 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1081 ms 6492 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1063 ms 4052 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1070 ms 14856 KB Time limit exceeded
2 Halted 0 ms 0 KB -