Submission #18872

#TimeUsernameProblemLanguageResultExecution timeMemory
18872guswns0528공장 (KOI13_factory)C++14
0 / 20
2 ms5616 KiB
#include <iostream> #include <vector> int main(void) { std::cin.sync_with_stdio(false); std::vector<int> map(1000001); int n; std::cin >> n; auto result = 0; for (auto index = 0; index < n; index++) { int number; std::cin >> number; map[number] = index; } for (auto index = 0; index < n; index++) { int number; std::cin >> number; result += std::abs(index - map[number]); } result /= 2; std::cout << result << std::endl; return 0; }
#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...