답안 #749493

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
749493 2023-05-28T05:58:49 Z 반딧불(#9967) Fruits (NOI22_fruits) C++17
5 / 100
115 ms 14668 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int n;
int arr[400002];
ll cost[400002];

int main(){
    scanf("%d", &n);
    for(int i=1; i<=n; i++) scanf("%d", &arr[i]);
    for(int i=1; i<=n; i++) scanf("%lld", &cost[i]);
    sort(cost+1, cost+n+1);
    reverse(cost+1, cost+n+1);
    ll sum = 0;
    for(int i=1; i<=n; i++) printf("%lld ", sum += cost[i]);
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:12:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     scanf("%d", &n);
      |     ~~~~~^~~~~~~~~~
Main.cpp:13:34: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |     for(int i=1; i<=n; i++) scanf("%d", &arr[i]);
      |                             ~~~~~^~~~~~~~~~~~~~~
Main.cpp:14:34: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |     for(int i=1; i<=n; i++) scanf("%lld", &cost[i]);
      |                             ~~~~~^~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 452 KB Output is correct
3 Correct 6 ms 980 KB Output is correct
4 Correct 56 ms 7584 KB Output is correct
5 Correct 115 ms 14668 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 96 ms 9804 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -