Runtime Error
Code
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin >> t;
while(t--){
int n;
int arr[n+1];
cin >> n;
bool one = false;
bool powTwo = false;
for(int i = 0; i < n; i++){
cin >> arr[i];
}
for(int i = 0; i < n; i++){
for(int k = 0; k < n; k++){
if(i!=k){
for(int j = 1; j <= 30; j++){
int power = pow(2, j);
int res = arr[i]+arr[k]+1;
if(res == power){
powTwo = true;
}
}
}
}
}
if(powTwo){
cout << 1 << endl;
} else {
cout << 0 << endl;
}
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1175 Maximum binary product of sum pairs
- Contest
- Intra LU IEEE Beginner Programming Contest
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-02-26 07:24:08
- Judged At
- 2025-02-26 07:24:08
- Judged By
- Score
- 0
- Total Time
- 216ms
- Peak Memory
- 257.062 MiB