Submission #129418

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1294182019-07-12 08:16:05nekiCloud Computing (CEOI18_clo)C++14
100 / 100
1519 ms5484 KiB
#include <bits/stdc++.h>
#define maxn 2010
#define loop(i, a, b) for(int i=a;i<b;i++)
#define cc(a) cout<< a << endl;
using namespace std;
long long inf=LONG_LONG_MIN/2;
struct event{
int co, f, val;
};
long long max(long long a, long long b){return (a>b) ? a:b;}
bool cmp(event a, event b){
if(a.f>b.f) return true;
if(a.f==b.f) return (a.co>b.co);
return false;
}
event es[2* maxn];
int main() {
int n;cin >> n;
loop(i, 0, n){
scanf("%d%d%d", &es[i].co, &es[i].f, &es[i].val);
es[i].val*=-1;
}
int m;cin >> m;
loop(i, n, n+m){
scanf("%d%d%d", &es[i].co, &es[i].f, &es[i].val);
es[i].co*=-1;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

clo.cpp: In function 'int main()':
clo.cpp:37:52: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if( 0<(int)dp.size()+es[i].co and dp.size()<(int)dp.size()+es[i].co) dp2.resize(dp.size()+es[i].co, inf);
                                           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
clo.cpp:4:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define loop(i, a, b) for(int i=a;i<b;i++)
clo.cpp:38:14:
         loop(j, 0, dp.size()){
              ~~~~~~~~~~~~~~~        
clo.cpp:38:9: note: in expansion of macro 'loop'
         loop(j, 0, dp.size()){
         ^~~~
clo.cpp:4:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define loop(i, a, b) for(int i=a;i<b;i++)
clo.cpp:43:10:
     loop(i, 0, dp.size()) ans=max(ans, dp[i]);
          ~~~~~~~~~~~~~~~            
clo.cpp:43:5: note: in expansion of macro 'loop'
     loop(i, 0, dp.size()) ans=max(ans, dp[i]);
     ^~~~
clo.cpp:24:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d%d", &es[i].co, &es[i].f, &es[i].val);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clo.cpp:29:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d%d", &es[i].co, &es[i].f, &es[i].val);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...