Submission #333954

#TimeUsernameProblemLanguageResultExecution timeMemory
333954beksultan04Bomb (IZhO17_bomb)C++14
5 / 100
513 ms49516 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define pii pair<int,int> #define OK puts("OK"); #define fr first #define sc second #define ret return #define scan1(a) scanf("%lld",&a); #define scan2(a,b) scanf("%lld %lld",&a, &b); #define scan3(a,b,c) scanf("%lld %lld %lld",&a,&b,&c); #define all(s) s.begin(),s.end() #define pb push_back #define endi puts(""); const int N = 1e6+12,INF=1e9+7; int q[2501][2501],v[2501][2501],p[2501][2501],gor[N],ver[N]; main(){ int m,i,j,k,c=0,n,x=INF,y=INF; scan2(n,m) for (i=1;i<=n;++i) for (j=1;j<=m;++j){ char ch; cin>>ch; q[i][j]=ch-'0'; } for (i=1;i<=n;++i){ for (j=1;j<=m;++j){ if (q[i][j]){ c++; } else if (c!=0){ x = min(c,x); c=0; } } } if (c!= 0) x = min(c,x); c=0; for (i=1;i<=m;++i){ for (j=1;j<=n;++j){ if (q[j][i]){ c++; } else if (c!=0){ y = min(c,y); c=0; } } } cout <<y*x<<" "; }

Compilation message (stderr)

bomb.cpp:20:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   20 | main(){
      |      ^
bomb.cpp: In function 'int main()':
bomb.cpp:21:15: warning: unused variable 'k' [-Wunused-variable]
   21 |     int m,i,j,k,c=0,n,x=INF,y=INF;
      |               ^
bomb.cpp:10:25: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   10 | #define scan2(a,b) scanf("%lld %lld",&a, &b);
      |                    ~~~~~^~~~~~~~~~~~~~~~~~~~
bomb.cpp:22:5: note: in expansion of macro 'scan2'
   22 |     scan2(n,m)
      |     ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...