Skip to content

Commit 7924613

Browse files
committed
Added 1234A - Equalize Prices Again.cpp
1 parent 6e14504 commit 7924613

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

1234A - Equalize Prices Again.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,8 @@ int main()
3535
cin>>a[i];
3636
T_initial += a[i];
3737
}
38-
sort(a, a+n);
39-
for(int i=0; i<n; i++)
40-
{
41-
if(a[i]*n >= T_initial)
42-
{
43-
cout<<a[i]<<endl;
44-
break;
45-
}
46-
}
38+
int ans = ceil((double)T_initial/n);
39+
cout<<ans<<endl;
4740
}
4841
return 0;
4942
}

0 commit comments

Comments
 (0)