Compile Error
foo.cc: In function 'int main()':
foo.cc:13:52: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
13 | cout << (x == 1 || y == 1) ? -1: 1 << endl;
| ~~^~~~~~~
Code
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
for (int i = 0; i < n; i++){
int x, y;
cin >> x; cin >> y;
cout << (x == 1 || y == 1) ? -1: 1 << endl;
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1235 A. Valid Integer
- Contest
- Happy New Year 2026
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2026-01-06 14:53:38
- Judged At
- 2026-01-06 14:53:38
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 0 Bytes