Submission #686376

#TimeUsernameProblemLanguageResultExecution timeMemory
686376CutebolTrampoline (info1cup20_trampoline)C++17
0 / 100
2076 ms49420 KiB
#include <bits/stdc++.h> using namespace std; void fopn(string name){freopen((name+".in").c_str(),"r",stdin); freopen((name+".out").c_str(),"w",stdout);} #define Xiao ios_base::sync_with_stdio(0) ; cin.tie(0) ; cout.tie(0); #define int long long #define itn int #define endl "\n" #define ff first #define ss second const int N = 2e5 + 5 ; const int mod = 1e9 + 7 ; const int inf = 1e6 ; int n , k , r , c ; int a[2505][2505] ; bool dfs( int i , int j , int x , int y ){ if ( i == x && j == y ) return true ; bool f , s ; if ( a[i][j] && i < r ) f = dfs( i+1 , j , x , y ) ; if ( j < c )s = dfs( i , j+1 , x , y ) ; if ( f || s ) return true ; return false ; } void solve(){ cin >> r >> c >> n ; for ( int i = 0 ; i < n ; i ++ ){ int x , y ; cin >> x >> y ; a[x][y] = 1 ; } int t ; cin >> t ; while ( t -- ){ int x1 , y1 , x2 , y2 ; cin >> x1 >> y1 >> x2 >> y2 ; if ( dfs( x1 , y1 , x2 , y2 ) ) cout << "Yes\n" ; else cout << "No\n" ; } } signed main(){ // fopn("blocks") ; Xiao ; int tt = 1 ; // cin >> t ; while ( tt -- ) solve() ; }

Compilation message (stderr)

trampoline.cpp: In function 'void fopn(std::string)':
trampoline.cpp:5:31: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    5 | void fopn(string name){freopen((name+".in").c_str(),"r",stdin); freopen((name+".out").c_str(),"w",stdout);}
      |                        ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
trampoline.cpp:5:72: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    5 | void fopn(string name){freopen((name+".in").c_str(),"r",stdin); freopen((name+".out").c_str(),"w",stdout);}
      |                                                                 ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
trampoline.cpp: In function 'bool dfs(long long int, long long int, long long int, long long int)':
trampoline.cpp:25:9: warning: 's' may be used uninitialized in this function [-Wmaybe-uninitialized]
   25 |  if ( f || s ) return true ;
      |       ~~^~~~
trampoline.cpp:25:9: warning: 'f' may be used uninitialized in this function [-Wmaybe-uninitialized]
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...