Submission #431008

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4310082021-06-17 08:52:12Runtime_error_Cloud Computing (CEOI18_clo)C++14
100 / 100
818 ms2060 KiB
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll N = 2009,C = 55,MX = 1e18+9;
ll n,m,SumCores,ans;
ll dp[2][N*C];
struct item{
ll type;//1 costumer 2 computer
ll clock;//sort decreasingly and forget about it
ll cores;//the knapsack size, + for computers, - for costumers, keep this >=0
ll price;// - for computers, + for costumers: maximize this
bool operator<(const item &other)const {
if(clock == other.clock)
return type > other.type;
return clock > other.clock;
}
}a[N<<1];
signed main(){
scanf("%lld",&n);
for(ll i=1;i<=n;i++)
scanf("%lld%lld%lld",&a[i].cores,&a[i].clock,&a[i].price),
a[i].type = 2,
a[i].price*=-1,
SumCores += a[i].cores;
scanf("%d",&m);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

clo.cpp: In function 'int main()':
clo.cpp:30:13: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
   30 |     scanf("%d",&m);
      |            ~^  ~~
      |             |  |
      |             |  long long int*
      |             int*
      |            %lld
clo.cpp:32:17: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
   32 |         scanf("%d%d%d",&a[i].cores,&a[i].clock,&a[i].price),
      |                ~^      ~~~~~~~~~~~
      |                 |      |
      |                 int*   long long int*
      |                %lld
clo.cpp:32:19: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long long int*' [-Wformat=]
   32 |         scanf("%d%d%d",&a[i].cores,&a[i].clock,&a[i].price),
      |                  ~^                ~~~~~~~~~~~
      |                   |                |
      |                   int*             long long int*
      |                  %lld
clo.cpp:32:21: warning: format '%d' expects argument of type 'int*', but argument 4 has type 'long long int*' [-Wformat=]
   32 |         scanf("%d%d%d",&a[i].cores,&a[i].clock,&a[i].price),
      |                    ~^                          ~~~~~~~~~~~
      |                     |                          |
      |                     int*                       long long int*
      |                    %lld
clo.cpp:24:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |     scanf("%lld",&n);
      |     ~~~~~^~~~~~~~~~~
clo.cpp:26:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   26 |         scanf("%lld%lld%lld",&a[i].cores,&a[i].clock,&a[i].price),
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
clo.cpp:30:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   30 |     scanf("%d",&m);
      |     ~~~~~^~~~~~~~~
clo.cpp:32:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   32 |         scanf("%d%d%d",&a[i].cores,&a[i].clock,&a[i].price),
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...