Submission #10293139
Source Code Expand
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #define ll long long #define vi vector<int> #define pi pair<int, int> #define pb push_back #define ppb pop_back #pragma comment(linker, "/stack:200000000") #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") using namespace std; using namespace __gnu_pbds; typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set; const int N = 2e5 + 667; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); ll a, b; cin >> a >> b; ll c = b + a; if(a == b){ if(a < 0) cout << "Negative" else if(a > 0) cout << "Positive"; else cout << "Zero"; return 0; } if(b >= 0 && a <=0){ cout << "Zero"; return 0; } if(a > 0 && b > 0){ cout << "Positive"; return 0; } if(c+1 % 2 == 0){ cout << "Positive"; } else{ cout << "Negative"; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Range Product |
User | vjudge1 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1039 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:30:9: error: expected ‘;’ before ‘else’ else if(a > 0) cout << "Positive"; ^