|
|
back to boardWhy WA5? #include <iostream> using namespace std; int main() { int a[101]; int k; cin>>k; for (int i=0; i<k; i++) { cin>>a[i]; } for (int i=0; i<k; i++) { int q=i; int min=a[i]; for (int j=i+1; j<k; j++ ) if (a[j]<a[i]) { q=j; min=a[j]; } if (q!=i) { int tmp=a[i]; a[i]=a[q]; a[q]=tmp; } } long long s=0; for (int i=0; i<=(k/2); i++) s=s+((a[i]/2)+1); cout<<s<<endl; return 0; } Re: Why WA5? Excuse me please, but I've already got AC. So I don't need your answers. Re: Why WA5? Posted by gekannt 19 Aug 2012 23:19 good for you |
|
|