Time Exceeded
Code
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<set>
#define jidan ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int main (){
jidan;
int a;
cin>>a;
while (a--){
int t;
cin>>t;
int arr[t];
for (int i=0; i<t;i++){
cin>>arr[i];
}
bool b=false ;
for (int i=0; i<t;i++){
if(arr[i]%2==0){
for(int j=0;j<t;j++){
if (arr[j]%2 !=0 && (arr[i]+arr[j]==3 || arr[i]+arr[j]==7 || arr[i]+arr[j]==15)){
b=true;
break;
}
}
}
}
if(b) cout<<1<<endl;
else cout<<0<<endl;
}
}
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:18:25
- Judged At
- 2025-02-26 07:18:25
- Judged By
- Score
- 65
- Total Time
- ≥2099ms
- Peak Memory
- ≥1.27 MiB