제출 #542991

#제출 시각아이디문제언어결과실행 시간메모리
542991Mohammed_AtalahArranging Shoes (IOI19_shoes)C++17
0 / 100
1089 ms1232 KiB
#include "shoes.h" #include <bits/stdc++.h> using namespace std; long long count_swaps(std::vector<int> s) { int n = s.size(); // map<int, set<int>> mp; // for (int i = 0; i < n; i++) { // mp[s[i]].insert(i); // } // vector<int> vis(n); // int e = 0; // int total = 0; // for (int i = 0; i < n; i++) { // cout << total << endl; // if (vis[i - 1] && i > 0) { // e--; // } // if (vis[i]) { // continue; // } // mp[s[i]].erase(mp[s[i]].begin()); // int idx = *mp[s[i] * -1].begin(); // mp[s[i] * -1].erase(mp[s[i] * -1].begin()); // total += idx - (i + e) - 1; // if (s[i] > 0) { // total++; // } // e++; // vis[idx] = 1; // } // return total; n--; cout << (n * (n + 1)) / 2 << endl; }

컴파일 시 표준 에러 (stderr) 메시지

shoes.cpp: In function 'long long int count_swaps(std::vector<int>)':
shoes.cpp:48:1: warning: no return statement in function returning non-void [-Wreturn-type]
   48 | }
      | ^
#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...