Submission #247472

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2474722020-07-11 12:51:05arnold518Sandwich (JOI16_sandwich)C++14
100 / 100
3137 ms6864 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 400;
const int INF = 1e7;
int N, M;
char A[MAXN+10][MAXN+10];
int ans[MAXN+10][MAXN+10];
int vis[MAXN+10][MAXN+10];
int cnt;
void dfs(int y, int x)
{
cnt++;
if(A[y][x]=='N')
{
if(vis[y][x]==1)
{
if(vis[y-1][x]>0) cnt=-INF;
if(y!=1 && !vis[y-1][x])
{
vis[y-1][x]=1;
dfs(y-1, x);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

sandwich.cpp: In function 'int main()':
sandwich.cpp:105:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   for(p=1; p<=N; p++) for(q=1; q<=M; q++) vis[p][q]=0; cnt=0;
   ^~~
sandwich.cpp:105:56: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   for(p=1; p<=N; p++) for(q=1; q<=M; q++) vis[p][q]=0; cnt=0;
                                                        ^~~
sandwich.cpp:119:3: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   for(p=1; p<=N; p++) for(q=1; q<=M; q++) vis[p][q]=0; cnt=0;
   ^~~
sandwich.cpp:119:56: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   for(p=1; p<=N; p++) for(q=1; q<=M; q++) vis[p][q]=0; cnt=0;
                                                        ^~~
sandwich.cpp:98:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d", &N, &M);
  ~~~~~^~~~~~~~~~~~~~~~
sandwich.cpp:99:27: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(i=1; i<=N; i++) scanf(" %s", A[i]+1);
                      ~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...