F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_39080071_16274.cpp: In lambda function:
0_0_39080071_16274.cpp:47:87: error: inconsistent types 'void' and 'int' deduced for lambda return type
   47 |         if (xx <= n && yy <= n && !vis[xx][yy] && g[xx][yy]) if (dfs1(xx, yy)) return 1;
      |                                                                                       ^
0_0_39080071_16274.cpp:47:87: error: return-statement with a value, in function returning 'void' [-fpermissive]
0_0_39080071_16274.cpp:49:87: error: inconsistent types 'void' and 'int' deduced for lambda return type
   49 |         if (xx <= n && yy <= n && !vis[xx][yy] && g[xx][yy]) if (dfs1(xx, yy)) return 1;
      |                                                                                       ^
0_0_39080071_16274.cpp:49:87: error: return-statement with a value, in function returning 'void' [-fpermissive]
0_0_39080071_16274.cpp:50:16: error: inconsistent types 'void' and 'int' deduced for lambda return type
   50 |         return 0;
      |                ^
0_0_39080071_16274.cpp:50:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
0_0_39080071_16274.cpp: In function 'void solve()':
0_0_39080071_16274.cpp:42:37: error: conversion from 'solve()::<lambda(int, int)>' to non-scalar type 'std::function<bool(int, int)>' requested
   42 |     function<bool(int, int)> dfs1 = [&](int x, int y) {
      |                                     ^~~~~~~~~~~~~~~~~~~
   43 |         return;
      |         ~~~~~~~                      
   44 |         vis[x][y] = 1;
      |         ~~~~~~~~~~~~~~               
   45 |         int xx, yy;
      |         ~~~~~~~~~~~                  
   46 |         xx = x + 1, yy = y;
      |         ~~~~~~~~~~~~~~~~~~~          
   47 |         if (xx <= n && yy <= n && !vis[xx][yy] && g[xx][yy]) if (dfs1(xx, yy)) return 1;
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   48 |         xx = x, yy = y + 1;
      |         ~~~~~~~~~~~~~~~~~~~          
   49 |         if (xx <= n && yy <= n && !vis[xx][yy] && g[xx][yy]) if (dfs1(xx, yy)) return 1;
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   50 |         return 0;
      |         ~~~~~~~~~                    
   51 |     };
      |     ~                                


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-23 01:07:33, Gzip enabled