Submission #992532

# Submission time Handle Problem Language Result Execution time Memory
992532 2024-06-04T14:57:44 Z MrM7md Arranging Shoes (IOI19_shoes) C++17
0 / 100
566 ms 1048576 KB
#include <bits/stdc++.h>
using namespace std;
// #define int long long
#define endl '\n'
#define F first
#define S second
#define pb push_back
#define all(a) a.begin(),a.end()
const int NN=1e6+50000;
const int MOD=1e9+7;
const int off=(1<<11);

long long  ans=1e8;
void rec(vector<int> s,int id,int cnt){
    if(id==(int)s.size()-1){
        for(int i=0;i<(int)s.size();i+=2){
            if(s[i]!=s[i+1]*-1)return;
        }
        ans=min(ans,(long long)cnt);
    }
    rec(s,id+1,cnt);
    swap(s[id],s[id+1]);
    rec(s,id+1,cnt+1);
}
 
long long count_swaps(vector<int> S){
    ans=1e8;
    rec(S,0,0);
    return ans;
}

// signed main(){
//     ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
 
// }
# Verdict Execution time Memory Grader output
1 Runtime error 566 ms 1048576 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 566 ms 1048576 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 566 ms 1048576 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 548 ms 1048576 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 566 ms 1048576 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 566 ms 1048576 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -