# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1064722 | 2024-08-18T17:09:51 Z | cpdreamer | Golf (JOI17_golf) | C++14 | 21 ms | 348 KB |
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <utility> #define V vector #define P pair #define S second #define F first #define pb push_back #define all(v) v.begin(),v.end() typedef long long ll; using namespace __gnu_pbds; using namespace std; typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> indexed_set; static int called = 0;const long long MOD = 1e9+7; // 1e9 + 7 void file(){ freopen("input.txt.txt","r",stdin); freopen("output.txt.txt","w",stdout); } struct point{ int x; int y; int w; }; bool sorted(point a,point b){ return a.x<b.x; } void solve() { int n; cin>>n; point A[n]; for(int i=0;i<n;i++) cin>>A[i].x>>A[i].y>>A[i].w; sort(A,A+n,sorted); int ans=0; for(int i=0;i<n;i++){ for(int j=i;j<n;j++){ int c=0; for(int g=i;g<=j;g++){ c+=A[g].w; } ans=max(ans,c); } } cout<<ans<<endl; } int main(){ //file(); solve(); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 21 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 21 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 21 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |