Submission #464675

# Submission time Handle Problem Language Result Execution time Memory
464675 2021-08-13T16:33:08 Z aihay Strah (COCI18_strah) C++14
Compilation error
0 ms 0 KB
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize("-Ofast")
#include <bits/stdc++.h>
using namespace std;

typedef int in;
#define int long long
#define f first
#define s second
#define pb push_back
#define pp push
#define double long double
#define ceil(x,y) (x/y)+(x%y!=0)*((double)(1.0*x/y)<0?0:1)
#define floor(x,y) (x/y)+(x%y!=0)*((double)(1.0a*x/y)<0?-1:0)
const int MAX=1e7;
const int MOD=1e9+7;
const int MAAX=1e18;

int n,m,csum[20010][20010],arr[20010][20010];
string s[20010];

in main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int tc=1;
    //cin>>tc;
    while(tc--){
        cin>>n>>m;
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                cin>>s[i][j];
                if(s[i][j]=='.')
                    csum[i][j]=csum[max(0ll,i-1)][j]+1;
            }
        }
        int ans=0;
        for(int i=0;i<n;i++){
            stack<int> st;
            for(int j=0;j<m;j++){
                while(st.size()&&csum[i][j]<csum[i][st.top()]){
                    arr[i][st.top()]=j-1;
                    st.pop();
                }
                st.pp(j);
            }
            while(st.size()){
                arr[i][st.top()]=m-1;
                st.pop();
            }
        }
        for(int i=0;i<n;i++){
            for(int j=0;j<m;j++){
                int x=j,y=arr[i][j];
                while(x&&csum[i][x-1]>csum[i][j]){
                    x--;
                }
                ans+=((y-j+1)*(y-j+2)/2*(j-x+1)+(j-x+1)*(j-x)/2*(y-j+1))*((csum[i][j]*(csum[i][j]+1))/2);
            }
        }
        cout<<ans<<endl;
    }
}

Compilation message

/tmp/ccDSJ0vK.o: in function `main':
strah.cpp:(.text.startup+0x1c): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccDSJ0vK.o
strah.cpp:(.text.startup+0x23): relocation truncated to fit: R_X86_64_PC32 against symbol `std::cin' defined in .bss._ZSt3cin section in /usr/lib/gcc/x86_64-linux-gnu/10/libstdc++.a(globals_io.o)
strah.cpp:(.text.startup+0x2a): relocation truncated to fit: R_X86_64_PC32 against symbol `std::cin' defined in .bss._ZSt3cin section in /usr/lib/gcc/x86_64-linux-gnu/10/libstdc++.a(globals_io.o)
strah.cpp:(.text.startup+0x35): relocation truncated to fit: R_X86_64_PC32 against symbol `std::cout' defined in .bss._ZSt4cout section in /usr/lib/gcc/x86_64-linux-gnu/10/libstdc++.a(globals_io.o)
strah.cpp:(.text.startup+0x45): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccDSJ0vK.o
strah.cpp:(.text.startup+0x54): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccDSJ0vK.o
strah.cpp:(.text.startup+0x62): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccDSJ0vK.o
strah.cpp:(.text.startup+0x69): relocation truncated to fit: R_X86_64_PC32 against symbol `csum' defined in .bss section in /tmp/ccDSJ0vK.o
strah.cpp:(.text.startup+0xa6): relocation truncated to fit: R_X86_64_PC32 against symbol `std::cin' defined in .bss._ZSt3cin section in /usr/lib/gcc/x86_64-linux-gnu/10/libstdc++.a(globals_io.o)
strah.cpp:(.text.startup+0xc0): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccDSJ0vK.o
strah.cpp:(.text.startup+0xd0): additional relocation overflows omitted from the output
/usr/bin/ld: failed to convert GOTPCREL relocation; relink with --no-relax
collect2: error: ld returned 1 exit status