Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #ifndef ACMTUYO
- #define cin lala
- ifstream cin;
- #define cout coco
- ofstream coco;
- #endif
- typedef long long int ll;
- int main() {
- #ifndef ACMTUYO
- cin = ifstream("injurious.in");
- cout = ofstream("injurious.out");
- #endif
- int n;
- cin>>n;
- vector <set<int> > v(1000000);
- vector <int> v1;
- for(int i=0;i<n;i++){
- int a;
- cin>>a;
- v[a].insert(i);
- v1.push_back(a);
- }
- for(int i=0;i<n;i++){
- for(int j=i+1;j<n;j++){
- int r=2*v1[j]-v1[i];
- if(r<0){
- continue;
- }
- set <int>::iterator it;
- it=v[r].upper_bound(j);
- if(it!=v[r].end()){
- cout<<"Yes"<<endl;
- cout<<i<<" "<<j<<" "<<*it<<endl;
- return 0;
- }
- }
- }
- cout<<"No"<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement