# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
995623 | doducanh | Sateliti (COCI20_satellti) | C++14 | 504 ms | 66388 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int mod=1e9+7;
const int maxn=1e3;
string s[maxn+7];
int h[maxn*2+7][maxn*2+7];
int pq_pow[2*maxn+7][2*maxn+7];
int n,m;
int add(int a,int b){return (a+b)%mod;}
int sub(int a,int b){return add(a,mod-b);}
int mul(int a,int b){return 1ll*a*b%mod;}
void precalc()
{
for(int i=1;i<=2*maxn;i++){
for(int j=1;j<=2*maxn;j++){
if(i==1&&j==1)pq_pow[i][j]=1;
else if(i==1)pq_pow[i][j]=mul(pq_pow[i][j-1],2);
else pq_pow[i][j]=mul(pq_pow[i-1][j],3);
}
}
for(int i=1;i<=2*n;i++){
for(int j=1;j<=2*m;j++){
int x=i,y=j;
if(x>n)x=x-n;
if(y>m)y=y-m;
int val=mul(s[x][y]=='.',pq_pow[i][j]);
h[i][j]=sub(add(add(h[i][j-1],h[i-1][j]),val),h[i-1][j-1]);
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |