Submission #61801

# Submission time Handle Problem Language Result Execution time Memory
61801 2018-07-26T18:07:28 Z KLPP Bulldozer (JOI17_bulldozer) C++14
5 / 100
2 ms 512 KB
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long int lld;
typedef pair<pair<lld,lld>,lld> piii;


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

	return 0;
}

Compilation message

bulldozer.cpp: In function 'int main()':
bulldozer.cpp:12:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
  ~~~~~^~~~~~~~~
bulldozer.cpp:15:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%lld %lld %lld",&arr[i].first.first,&arr[i].first.second,&arr[i].second);
   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 356 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 512 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 2 ms 384 KB Output is correct
8 Correct 2 ms 256 KB Output is correct
9 Correct 2 ms 256 KB Output is correct
10 Correct 2 ms 256 KB Output is correct
11 Correct 2 ms 256 KB Output is correct
12 Correct 2 ms 256 KB Output is correct
13 Correct 2 ms 256 KB Output is correct
14 Correct 2 ms 384 KB Output is correct
15 Correct 2 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 356 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 2 ms 512 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 2 ms 384 KB Output is correct
8 Correct 2 ms 256 KB Output is correct
9 Correct 2 ms 256 KB Output is correct
10 Correct 2 ms 256 KB Output is correct
11 Correct 2 ms 256 KB Output is correct
12 Correct 2 ms 256 KB Output is correct
13 Correct 2 ms 256 KB Output is correct
14 Correct 2 ms 384 KB Output is correct
15 Correct 2 ms 256 KB Output is correct
16 Incorrect 2 ms 256 KB Output isn't correct
17 Halted 0 ms 0 KB -