Submission #73143

#TimeUsernameProblemLanguageResultExecution timeMemory
73143KmcodeRoller Coaster Railroad (IOI16_railroad)C++14
0 / 100
1378 ms33500 KiB
#include<bits/stdc++.h> using namespace std; //#include "railroad.h" map<int,long long int> mp; long long plan_roller_coaster(std::vector<int> s, std::vector<int> t) { t.push_back(-1); s.push_back(INT_MAX-3); for(int i=0;i<s.size();i++){ mp[s[i]]++; mp[t[i]]--; } long long int sum=0; for(auto it:mp){ long long int add=sum; sum-=it.second; it.second-=add; it.second+=sum; cout<<add<<" "<<sum<<endl; if(sum<0){ return 111; } } for(auto it:mp){ if(it.second!=0){ return 222; } } return 0; }

Compilation message (stderr)

railroad.cpp: In function 'long long int plan_roller_coaster(std::vector<int>, std::vector<int>)':
railroad.cpp:12:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<s.size();i++){
                 ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...