답안 #590523

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
590523 2022-07-06T05:13:14 Z 반딧불(#8412) Bulldozer (JOI17_bulldozer) C++17
5 / 100
1 ms 308 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int n;
pair<int, ll> arr[102];
ll sum[102];

int main(){
    scanf("%d", &n);
    for(int i=1; i<=n; i++){
        scanf("%d %lld %lld", &arr[i].first, &arr[i].second, &arr[i].second);
    }
    sort(arr+1, arr+n+1);
    for(int i=1; i<=n; i++) sum[i] = sum[i-1] + arr[i].second;
    ll ans = 0;
    for(int i=1; i<=n; i++) for(int j=0; j<i; j++) ans = max(ans, sum[i] - sum[j]);
    printf("%lld", ans);
}

Compilation message

bulldozer.cpp: In function 'int main()':
bulldozer.cpp:12:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     scanf("%d", &n);
      |     ~~~~~^~~~~~~~~~
bulldozer.cpp:14:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |         scanf("%d %lld %lld", &arr[i].first, &arr[i].second, &arr[i].second);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 264 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 308 KB Output is correct
5 Correct 1 ms 304 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 304 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 304 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 264 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 308 KB Output is correct
5 Correct 1 ms 304 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 304 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 304 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 0 ms 212 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Incorrect 1 ms 212 KB Output isn't correct
17 Halted 0 ms 0 KB -