# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
506134 | lucri | Art Exhibition (JOI18_art) | C++17 | 0 ms | 204 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <algorithm>
using namespace std;
long long s,n,r,ss[500010],sd[500010],r2;
struct tablouri{long long a,b;}t[500010];
bool comp(tablouri a1,tablouri b1)
{
return a1.a<b1.a;
}
int main()
{
cin>>n;
for(int i=1;i<=n;++i)
{
cin>>t[i].a>>t[i].b;
s+=t[i].b;
}
sort(t+1,t+n+1,comp);
int j=1,i;
for(int i=1;i<=n;++i)
{
if(t[i].a==t[j].a)
t[j].b+=t[i].b;
else
{
++j;
t[j]=t[i];
}
}
n=j;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |