/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 540.0 KiB
#2 Accepted 801ms 580.0 KiB
#3 Accepted 794ms 588.0 KiB
#4 Accepted 796ms 576.0 KiB
#5 Accepted 793ms 588.0 KiB
#6 Accepted 792ms 584.0 KiB
#7 Accepted 66ms 552.0 KiB
#8 Accepted 66ms 596.0 KiB
#9 Accepted 66ms 548.0 KiB
#10 Accepted 66ms 616.0 KiB
#11 Accepted 66ms 540.0 KiB
#12 Accepted 41ms 1.285 MiB
#13 Accepted 50ms 1.297 MiB
#14 Accepted 168ms 1.277 MiB
#15 Accepted 174ms 1.52 MiB

Code

/*
 *   Copyright (c) 2025 Emon Thakur
 *   All rights reserved.
 */
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int t; cin >> t; while(t--)
    {
        int n; cin >> n;
        int a[n];
        map<int,bool> mp;
        for(int i=0;i<n;i++) cin >> a[i], mp[a[i]]=true;
        int target;
        bool ok = false;
        for(int bit=1;bit<=30;bit++)
        {
            target = (1<<bit)-1;
            for(int i=0;i<n;i++)
            {
                if(mp[target-a[i]])
                {
                    ok = true;
                    cout<<1<<'\n';
                    break;
                }
            }
            if(ok) break;
        }
        if(!ok) cout<<0<<'\n';
    }
}

Information

Submit By
Type
Submission
Problem
P1175 Maximum binary product of sum pairs
Language
C++17 (G++ 13.2.0)
Submit At
2025-02-24 16:26:15
Judged At
2025-02-24 16:26:15
Judged By
Score
100
Total Time
801ms
Peak Memory
1.52 MiB