QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#585594 | #9129. Quotient Sum | Wilson_Inversion# | WA | 0ms | 3808kb | C++14 | 616b | 2024-09-23 21:24:29 | 2024-09-23 21:24:31 |
Judging History
answer
#include <bits/stdc++.h>
#define int long long
#define FOR(i,j,k) for(int i=j; i<=k; ++i)
#define ROF(i,j,k) for(int i=j; i>=k; --i)
inline int read (void) {
int x = 0, f = 1, ch = getchar();
while(!isdigit(ch)) { if(ch == '-') f = -f; ch = getchar(); }
while(isdigit(ch)) { x = x * 10 + ch - '0'; ch = getchar(); }
return x * f;
}
const int maxn = 200005;
int a[maxn];
signed main (void) {
int n = read(), ans = 0;
FOR(i,1,n) a[i] = read();
std::sort(a+1, a+n+1);
FOR(i,2,n) ans += a[i] / a[i-1];
ans += a[1] / a[n];
printf("%lld\n", ans);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3808kb
input:
3 2 3 6
output:
3
result:
ok "3"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
2 15 4
output:
3
result:
ok "3"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3748kb
input:
9 284791808 107902 13660981249408 4622332661 13405199 24590921 361 244448137 16077087227955422
output:
4580
result:
ok "4580"
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3744kb
input:
9 12 9 5 17 2 6 7 1 15
output:
10
result:
wrong answer 1st words differ - expected: '6', found: '10'