Submission #124461

#TimeUsernameProblemLanguageResultExecution timeMemory
124461HassenAissaStrange Device (APIO19_strange_device)C++14
0 / 100
2 ms376 KiB
#include <bits/stdc++.h>
using namespace std;


int main()
{
    long long unsigned n,a,b,t,l;
    scanf("%llu%llu%llu",&n,&a,&b);
    int res=0;
    for(long long unsigned i=0;i<n;i++)
    {
        scanf("%llu%llu",&t,&l);
        if(l-t>=a)
            res+=a*t;
        else
        {
            res+=(l-t)*t;
        }
    }
    printf("%d",res);
}

Compilation message (stderr)

strange_device.cpp: In function 'int main()':
strange_device.cpp:8:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%llu%llu%llu",&n,&a,&b);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
strange_device.cpp:12:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%llu%llu",&t,&l);
         ~~~~~^~~~~~~~~~~~~~~~~~
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...