Submission #1316882

#TimeUsernameProblemLanguageResultExecution timeMemory
1316882exoworldgdArranging Shoes (IOI19_shoes)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #define int long long #define exoworldgd cin.tie(0)->sync_with_stdio(0),cout.tie(0) using namespace std; ll count_swaps(vector<int>s) { int n=s.size(),ans=0,t[n+1]={}; map<int,queue<int>>mp; for(int i=0,x,pos;i<n;i++){ if(mp[-s[i]].empty())pos=i+1,mp[s[i]].push(pos); else{ pos=mp[-s[i]].front(),mp[-s[i]].pop(),ans+=i; for(int j=pos;j>0;j-=j&-j)ans-=t[j]; ans+=x<0; } for(;pos<=n;pos+=pos&-pos)t[pos]++; } return ans; }

Compilation message (stderr)

shoes.cpp:5:1: error: 'll' does not name a type
    5 | ll count_swaps(vector<int>s) {
      | ^~