# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
502874 |
2022-01-06T16:46:44 Z |
inksamurai |
Strah (COCI18_strah) |
C++17 |
|
1000 ms |
31656 KB |
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define sz(a) (int)a.size()
#define all(a) a.begin(),a.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define crep(i,x,n) for(int i=x;i<n;i++)
#define drep(i,n) for(int i=n-1;i>=0;i--)
#define vec(...) vector<__VA_ARGS__>
#define _3qplfh5 ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
using namespace std;
typedef long long ll;
typedef long double ld;
void print(){
cout<<"\n";
}
template<class te,class ...ti>
void print(const te&v, const ti&...nv) {
cout<<v;
if(sizeof...(nv)){
cout<<" ";
print(nv...);
}
}
using pii=pair<int,int>;
using vi=vector<int>;
using vll=vector<long long>;
void slv(){
int h,w;
cin>>h>>w;
vec(vi) a(h+1,vi(w));
rep(i,h){
rep(j,w){
char ch;
cin>>ch;
a[i][j]=(ch=='.');
}
}
h++;
vec(vi) dwn(h,vi(w));
drep(i,h){
rep(j,w){
if(!a[i][j]) dwn[i][j]=i;
else dwn[i][j]=dwn[i+1][j];
}
}
ll ans=0;
drep(i,h-1){
drep(j,w){
int mn=1e9;
crep(j1,j,w){
mn=min(mn,dwn[i][j1]);
// print(mn-i,"");
ans+=((mn-i)*(mn-i+1))/2*(j1-j+1);
}
// print();
}
}
print(ans,'\n');
}
int main(){
_3qplfh5;
int t=1;
// cin>>t;
rep(cs,t)
slv();
//
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
31 ms |
1028 KB |
Output is correct |
2 |
Correct |
31 ms |
1084 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
28 ms |
1024 KB |
Output is correct |
2 |
Correct |
37 ms |
1100 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
32 ms |
972 KB |
Output is correct |
2 |
Correct |
29 ms |
972 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1096 ms |
8444 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1085 ms |
19604 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1082 ms |
12456 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
45 ms |
2380 KB |
Output is correct |
2 |
Execution timed out |
1014 ms |
26168 KB |
Time limit exceeded |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1076 ms |
31656 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |