Submission #1064727

#TimeUsernameProblemLanguageResultExecution timeMemory
1064727cpdreamerGolf (JOI17_golf)C++14
0 / 100
18 ms348 KiB
#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); ll ans=0; for(int i=0;i<n;i++){ for(int j=i;j<n;j++){ ll 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 (stderr)

golf.cpp: In function 'void file()':
golf.cpp:18:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |     freopen("input.txt.txt","r",stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
golf.cpp:19:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   19 |     freopen("output.txt.txt","w",stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
golf.cpp: At global scope:
golf.cpp:15:12: warning: 'called' defined but not used [-Wunused-variable]
   15 | static int called = 0;const long long MOD = 1e9+7; // 1e9 + 7
      |            ^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...