Submission #560261

#TimeUsernameProblemLanguageResultExecution timeMemory
560261AGEStrah (COCI18_strah)C++14
22 / 110
1081 ms14856 KiB
#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 (stderr)

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++)
      |                     ~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...