/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 540.0 KiB
#2 Accepted 1ms 332.0 KiB
#3 Accepted 1ms 768.0 KiB
#4 Accepted 1ms 540.0 KiB
#5 Accepted 1ms 540.0 KiB

Code

#include <bits/stdc++.h>
using namespace std;
#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define all(v) (v).begin(),(v).end();
#define rall(v) (v).rbegin(),(v).rend();
#define ll long long
#define endl '\n'
#define gap " "
#define bug(a) cerr<<#a<<":"<<endl;
int main()
{
    ll n;
    cin>>n;
    vector<ll>v(n);
    ll i;
    for(i=0;i<n;i++)
    {
        cin>>v[i];
    }
    ll c=0;
    ll j;
    for(i=0;i<n;i++)
    {
        for(j=i+1;j<n;j++)
        {
            ll sum=v[i]+v[j];
            ll multi=v[i]*v[j];
            if(multi%sum==0)c++;
        }
    }
    cout<<c<<endl;
    
}

Information

Submit By
Type
Submission
Problem
P1131 Count Special Pairs
Contest
LU IUJPC : Sylhet Division 2024, Mock Round
Language
C++17 (G++ 13.2.0)
Submit At
2024-12-07 10:07:43
Judged At
2024-12-07 10:07:43
Judged By
Score
100
Total Time
2ms
Peak Memory
768.0 KiB