Submission #827917

#TimeUsernameProblemLanguageResultExecution timeMemory
827917smatcsuArranging Shoes (IOI19_shoes)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #define ll long long using namespace std; vector<ll> v; void count_swaps(vector<int> v){ if(v[0]=(-v[1]) and v[0]<=0 and v[1]>=0) return 0; else{ if(v[1]=(-v[0]) and v[1]<=0 and v[0]>=0) return 1; else return -1; } }

Compilation message (stderr)

shoes.cpp: In function 'void count_swaps(std::vector<int>)':
shoes.cpp:8:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
    8 |     if(v[0]=(-v[1]) and v[0]<=0 and v[1]>=0) return 0;
shoes.cpp:8:53: error: return-statement with a value, in function returning 'void' [-fpermissive]
    8 |     if(v[0]=(-v[1]) and v[0]<=0 and v[1]>=0) return 0;
      |                                                     ^
shoes.cpp:10:16: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   10 |         if(v[1]=(-v[0]) and v[1]<=0 and v[0]>=0) return 1;
shoes.cpp:10:57: error: return-statement with a value, in function returning 'void' [-fpermissive]
   10 |         if(v[1]=(-v[0]) and v[1]<=0 and v[0]>=0) return 1;
      |                                                         ^
shoes.cpp:11:21: error: return-statement with a value, in function returning 'void' [-fpermissive]
   11 |         else return -1;
      |                     ^~