ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1910. Titan Ruins: Hidden Entrance

HELP, WA#6
Posted by 5iqman 16 Nov 2023 23:06
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
    int n, sum1, sum2= 0;
    cin >> n;
    vector<int>dsds(n);
    for (int i = 0; i < dsds.size(); i++)
    {
        cin >> dsds[i];
    }

    vector<int> dsds2 = dsds;
    sort(dsds2.begin(), dsds2.end());
    sum1 = dsds2[n - 1] + dsds2[n - 2] + dsds2[n - 3];
    for (int i = 0; i < dsds.size(); i++)
    {
        if (dsds[i] == dsds2[n - 1] || dsds[i] == dsds2[n - 2] || dsds[i] == dsds2[n - 3])
        {
            sum2 = i + 2;
            break;
        }
    }
    cout << sum1 << " " << sum2;
    return 0;
}

in my tests this code works 100%, but i dont know why i have WA#6

Edited by author 16.11.2023 23:08