Submission #60508236


Source Code Expand

Copy
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define re register
#define il inline
#define pii pair<int,int>
#define x first
#define y second
#define gc getchar()
#define rd read()
#define debug() puts("------------")
namespace yzqwq{
il int read(){
int x=0,f=1;char ch=gc;
while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=gc;}
while(ch>='0'&&ch<='9') x=(x<<1)+(x<<3)+(ch^48),ch=gc;
return x*f;
}
il int qmi(int a,int b,int p){
int ans=1;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define re register
#define il inline
#define pii pair<int,int>
#define x first
#define y second
#define gc getchar()
#define rd read()
#define debug() puts("------------")

namespace yzqwq{
    il int read(){
        int x=0,f=1;char ch=gc;
        while(ch<'0'||ch>'9'){if(ch=='-') f=-1;ch=gc;}
        while(ch>='0'&&ch<='9') x=(x<<1)+(x<<3)+(ch^48),ch=gc;
        return x*f;
    }
    il int qmi(int a,int b,int p){
        int ans=1;
        while(b){
            if(b&1) ans=ans*a%p;
            a=a*a%p,b>>=1;
        }
        return ans;
    }
    il auto max(auto a,auto b){return (a>b?a:b);}
    il auto min(auto a,auto b){return (a<b?a:b);}
    il int gcd(int a,int b){
        if(!b) return a;
        return gcd(b,a%b);
    }
    il int lcm(int a,int b){
        return a/gcd(a,b)*b;
    }
    il void exgcd(int a,int b,int &x,int &y){
        if(!b) return x=1,y=0,void(0);
        exgcd(b,a%b,x,y);
        int t=x;
        x=y,y=t-a/b*x;
        return ;
    }
    il int F(int n,int a,int b,int c){
        //sum{|_ (ai+b)/c _| i:0~n}
        if(!n) return b/c;
        if(!a) return (n+1)*(b/c);
        if(a>=c||b>=c){
            int x=a/b,y=b/c;
            return n*(n+1)/2*x+(n+1)*y+F(n,a%c,b%c,c);
        }
        int m=(a*n+b)/c;
        return n*m+F(m-1,c,c-b+1,a);
    }
    struct lb{
        int d[64];
        il void print(){
            for(re int i=0;i<63;++i)
            if(d[i]) printf("%lld:%lld\n",i,d[i]);
            return ;
        }
        lb(){memset(d,0,sizeof(d));}
        il void operator +=(int x){
            for(re int i=62;i>=0;--i){
                if(!(x&(1ll<<i))) continue;
                if(d[i]) x^=d[i];
                else return d[i]=x,void(0);
            }
            return ;
        }
        int& operator [](int x){
            return d[x];
        }
        il void operator +=(lb &x){
            for(re int i=62;i>=0;--i)
            if(x[i]) *this+=x[i];
            return ;
        }
        il friend lb operator +(lb &x,lb &y){
            lb z=x;
            for(re int i=62;i>=0;--i)
            if(y[i]) z+=y[i];
            return z;
        }
        il int Max_calc(){
            int ans=0;
            for(re int i=62;i>=0;--i)
            if((ans^d[i])>ans) ans^=d[i];
            return ans;
        }
    };
    mt19937 rnd(time(0));
}
using namespace yzqwq;

const int N=1005;
int n,m;
char s[N][N];
int d;
int cnt;
bool vis[20][20];
il void work(int x,int y){
	for(re int i=1;i<=n;++i)
	for(re int j=1;j<=m;++j)
	if(abs(x-i)+abs(y-j)<=d) vis[i][j]=1;
}
il void solve(){
	n=rd,m=rd,d=rd;
	for(re int i=1;i<=n;++i)
	for(re int j=1;j<=m;++j) cin>>s[i][j];
	int Max=0;
	for(re int i=1;i<=n;++i)
	for(re int j=1;j<=m;++j){
		if(s[i][j]=='.'){
			for(re int i_=1;i_<=n;++i_)
			for(re int j_=1;j_<=m;++j_){
				if(s[i_][j_]=='.'){
					memset(vis,0,sizeof(vis));
					work(i,j),work(i_,j_);
					cnt=0;
					for(re int x=1;x<=n;++x)
					for(re int y=1;y<=m;++y) cnt+=(vis[x][y]&&s[x][y]=='.');
					Max=max(Max,cnt);
				}
			}
		}
	}cout<<Max;
    return ;
}

signed main(){
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
    int t=1;while(t--)
    solve();
    return 0;
}

Submission Info

Submission Time
Task B - Humidifier 2
User fzitb7912
Language C++ 20 (gcc 12.2)
Score 250
Code Size 3384 Byte
Status AC
Exec Time 5 ms
Memory 3656 KB

Compile Error

Main.cpp: In member function ‘void yzqwq::lb::print()’:
Main.cpp:58:24: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   58 |             for(re int i=0;i<63;++i)
      |                        ^
Main.cpp: In member function ‘void yzqwq::lb::operator+=(long long int)’:
Main.cpp:64:24: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   64 |             for(re int i=62;i>=0;--i){
      |                        ^
Main.cpp: In member function ‘void yzqwq::lb::operator+=(yzqwq::lb&)’:
Main.cpp:75:24: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   75 |             for(re int i=62;i>=0;--i)
      |                        ^
Main.cpp: In function ‘yzqwq::lb yzqwq::operator+(lb&, lb&)’:
Main.cpp:81:24: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   81 |             for(re int i=62;i>=0;--i)
      |                        ^
Main.cpp: In member function ‘long long int yzqwq::lb::Max_calc()’:
Main.cpp:87:24: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   87 |             for(re int i=62;i>=0;--i)
      |                        ^
Main.cpp: In function ‘void work(long long int, long long int)’:
Main.cpp:103:20: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
  103 |         for(re int i=1;i<=n;++i)
      |                    ^
Main.cpp:104:20: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
  104 |         for(re int j=1;j<=m;++j)
      |                    ^
Main.cpp: In function ‘void solve()’:
Main.cpp:109:20: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
  109 |         for(re int i=1;i<=n;++i)
      |                    ^
Main.cpp:110:20: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
  110 |         for(re int j=1;j<=m;++j) cin>>s[i][j];
      |                    ^
Main.cpp:112:20: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
  112 |         for(re int i=1;i<=n;++i)
      |                    ^
Main.cpp:113:20: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
  113 |         for(re int j=1;j<=m;++j){
      |                    ^
Main.cpp:115:36: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
  115 |                         for(re int i_=1;i_<=n;++i_)
      |                                    ^~
Main.cpp:116:36: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
  116 |                         for(re int j_=1;j_<=m;++j_){
      |                                    ^~
Main.cpp:7:11: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
    7 | #define x first
      |           ^~~~~
Main.cpp:121:52: note: in expansion of macro ‘x’
  121 |                                         for(re int x=1;x<=n;++x)
      |                                                    ^
Main.cpp:8:11: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
    8 | #define y second
      |           ^~~~~~
Main.cpp:122:52: note: in expansion of macro ‘y’
  122 |                                         for(re int y=1;y<=m;++y) cnt+=(vis[x][y]&&s[x][y]=='.');
      |                                                    ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 250 / 250
Status
AC × 3
AC × 26
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_test_00.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt, 01_test_17.txt, 01_test_18.txt, 01_test_19.txt, 01_test_20.txt, 01_test_21.txt, 01_test_22.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3532 KB
00_sample_01.txt AC 1 ms 3532 KB
00_sample_02.txt AC 1 ms 3636 KB
01_test_00.txt AC 1 ms 3640 KB
01_test_01.txt AC 1 ms 3656 KB
01_test_02.txt AC 1 ms 3576 KB
01_test_03.txt AC 1 ms 3516 KB
01_test_04.txt AC 1 ms 3512 KB
01_test_05.txt AC 1 ms 3640 KB
01_test_06.txt AC 1 ms 3584 KB
01_test_07.txt AC 1 ms 3572 KB
01_test_08.txt AC 2 ms 3644 KB
01_test_09.txt AC 2 ms 3544 KB
01_test_10.txt AC 1 ms 3576 KB
01_test_11.txt AC 2 ms 3572 KB
01_test_12.txt AC 1 ms 3540 KB
01_test_13.txt AC 1 ms 3640 KB
01_test_14.txt AC 1 ms 3544 KB
01_test_15.txt AC 1 ms 3504 KB
01_test_16.txt AC 1 ms 3520 KB
01_test_17.txt AC 1 ms 3528 KB
01_test_18.txt AC 1 ms 3572 KB
01_test_19.txt AC 4 ms 3640 KB
01_test_20.txt AC 5 ms 3500 KB
01_test_21.txt AC 5 ms 3592 KB
01_test_22.txt AC 1 ms 3640 KB


2025-03-05 (Wed)
18:13:46 +00:00