Submission #828998

#TimeUsernameProblemLanguageResultExecution timeMemory
828998TrunktyArranging Shoes (IOI19_shoes)C++14
45 / 100
64 ms69848 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; //#define int ll #include "shoes.h" ll ans,nextpos=1; deque<int> shoes[100005]; ll count_swaps(vector<int> s){ for(ll i=0;i<s.size();i++){ if(s[i]<0){ shoes[-s[i]].push_back(nextpos); ans += abs(nextpos-(i+1LL)); nextpos += 2; } } return ans; }

Compilation message (stderr)

shoes.cpp: In function 'll count_swaps(std::vector<int>)':
shoes.cpp:12:14: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |  for(ll i=0;i<s.size();i++){
      |             ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...