Submission #432622

# Submission time Handle Problem Language Result Execution time Memory
432622 2021-06-18T11:40:43 Z inwbear Strange Device (APIO19_strange_device) C++14
0 / 100
5000 ms 524292 KB
#include <bits/stdc++.h>
using namespace std;
long long a,b,n,l,r,c1,c2,ans;
map<pair<long long,long long>,bool >mp;
int main()
{
    scanf("%lld %lld %lld",&n,&a,&b);
    for(int i=1;i<=n;i++)
    {
        scanf("%d %d",&l,&r);
        for(int ii=l;ii<=r;ii++)
        {
            c1=(ii+(ii/b))%a;
            c2=ii%b;
            if(!mp[{c1,c2}])mp[{c1,c2}]=true,ans++;
        }
    }
    printf("%lld",ans);
}

Compilation message

strange_device.cpp: In function 'int main()':
strange_device.cpp:10:17: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
   10 |         scanf("%d %d",&l,&r);
      |                ~^     ~~
      |                 |     |
      |                 int*  long long int*
      |                %lld
strange_device.cpp:10:20: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long long int*' [-Wformat=]
   10 |         scanf("%d %d",&l,&r);
      |                   ~^     ~~
      |                    |     |
      |                    int*  long long int*
      |                   %lld
strange_device.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |     scanf("%lld %lld %lld",&n,&a,&b);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
strange_device.cpp:10:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |         scanf("%d %d",&l,&r);
      |         ~~~~~^~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 288 KB Output is correct
2 Execution timed out 5079 ms 405080 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Runtime error 4583 ms 524292 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Execution timed out 5094 ms 60484 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Execution timed out 5097 ms 77608 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Execution timed out 5097 ms 77608 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Execution timed out 5097 ms 77608 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Runtime error 2796 ms 524292 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 288 KB Output is correct
2 Execution timed out 5079 ms 405080 KB Time limit exceeded
3 Halted 0 ms 0 KB -