제출 #145374

#제출 시각아이디문제언어결과실행 시간메모리
145374gmfabatArranging Shoes (IOI19_shoes)C++14
50 / 100
1078 ms3960 KiB
#include "shoes.h" #include <bits/stdc++.h> using namespace std; long long ans=0; vector<int> a; int swapp(int l,int r){ int t=a[r]; for (int i=r;i>l;i--) a[i]=a[i-1]; a[l]=t; } long long count_swaps(vector<int> s){ a=s; int n=s.size(); for (int i=0;i<n;i++) if (i%2==0){ int j ; for (j=i+1;;j++) if (a[i]+a[j]==0) break; if (a[i]<0){ swapp(i+1,j); ans+=j-i-1; }else{ swapp(i,j); ans+=j-i; } } return ans; }

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

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