QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#377835#2367. Hot SpringsBeatrix-0WA 1ms3476kbC++20638b2024-04-05 18:34:162024-04-05 18:34:17

Judging History

This is the latest submission verdict.

  • [2024-04-05 18:34:17]
  • Judged
  • Verdict: WA
  • Time: 1ms
  • Memory: 3476kb
  • [2024-04-05 18:34:16]
  • Submitted

answer

#include<bits/stdc++.h>
using namespace std ;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int n ; cin>> n ;
    vector<int>v(n);

    for ( int i = 0 ; i < n ; i++ )
    {
        cin>> v[i];
    }

    sort ( v.begin() , v.end());

    int x = 1 ;
    int l = 0 , r = n-1 ;
    for ( int i = 0 ; i < n ; i++ )
    {
        if ( x % 2 != 0 )
        {
            cout << v[r] << ' ';
            r--;
            x = 2 ;
        }
        else
        {
            cout << v[l] << ' ';
            l++;
            x = 1 ;
        }
    }   


    return 0 ;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3476kb

input:

5
1 -1 2 -1 -1

output:

2 -1 1 -1 -1 

result:

wrong answer Contestants list of integers did not satisfy the requirement.