Submission #923261

# Submission time Handle Problem Language Result Execution time Memory
923261 2024-02-07T04:01:13 Z Roumak77 Arranging Shoes (IOI19_shoes) C++17
0 / 100
0 ms 344 KB
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize("-Ofast")
#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <vector>
#include <limits>
#include <cmath>
#include <stack>
#include <queue>
#include <map>
#include <math.h>
using namespace std;

using ll = long long;
int64_t count_swaps(vector<int> shoes){

    ll length = shoes.size();
    /*vector<bool> list_n(length, 0);

    ll total = 0;

    for(int i = 0; i < length; i++){
        if(list_n[i] == 1){
            continue;
        }

        ll curr_counter = 0;

        ll curr_val = shoes[i];

        if(curr_val > 0){
            curr_counter++;
        }



        for(int j = i + 1; j < length; j++){
            //cout << curr_counter << ", i = " << i << ", j = " << j << endl;
            if(shoes[j] == -1 * curr_val && list_n[j] == 0){
                list_n[j] = 1;
                break;
            }else{
                if(list_n[j] == 0){
                    curr_counter++;
                }
            }

        }

        list_n[i] = 1;

        //cout << "curr_counter = " << curr_counter << ", i = " << i << endl;


        total += curr_counter;

        for(int k = 0; k < length; k++){
            cout << list_n[k] << " ";
        }
        cout << endl;

    }

    return total;
     */

    return (ll) (length/2)*(length/2 + 1)/2;


}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -