제출 #532876

#제출 시각아이디문제언어결과실행 시간메모리
532876christinelynnArranging Shoes (IOI19_shoes)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int64 count_swaps(int[] s){ int n = s.size(), ans = 0; for(int i=0;i<2*n;i+=2) { for(int j=i+1;j<2*n;j++) { if(abs(s[j]) == abs(s[i])) { ans += j - i - 1; for(int k=j-1;k>=i+1;k--) swap(s[k], s[k+1]); break; } } if(s[i] > s[i + 1]) { ans += 1; swap(s[i], s[i + 1]); } } return ans; } // int main(){ // int t1[] = {2, 1, -1, -2}; // int t2[] = {-2, 2, 2, -2, -2, 2}; // cout << count_swaps(t2) << '\n'; // }

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

shoes.cpp:4:1: error: 'int64' does not name a type; did you mean 'int64_t'?
    4 | int64 count_swaps(int[] s){
      | ^~~~~
      | int64_t