Submission #781464

# Submission time Handle Problem Language Result Execution time Memory
781464 2023-07-13T06:42:40 Z makanhulia Strange Device (APIO19_strange_device) C++17
10 / 100
5000 ms 524288 KB
#include <bits/stdc++.h>
#define LL long long
#define fi first
#define se second
using namespace std;
int main()
{
  LL n,a,b;
  scanf("%lld %lld %lld",&n,&a,&b);
  set<pair<int,int>>s;
  for(LL i=1;i<=n;i++)
  {
    LL x,y;
    scanf("%lld %lld",&x,&y);
    for(LL X=x;X<=y;X++)
    {
      LL amb=X/b;
      s.insert(make_pair(((X+amb)%a),X%b));
    }
    
  }
  printf("%lld\n",s.size());
}

Compilation message

strange_device.cpp: In function 'int main()':
strange_device.cpp:22:14: warning: format '%lld' expects argument of type 'long long int', but argument 2 has type 'std::set<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wformat=]
   22 |   printf("%lld\n",s.size());
      |           ~~~^    ~~~~~~~~
      |              |          |
      |              |          std::set<std::pair<int, int> >::size_type {aka long unsigned int}
      |              long long int
      |           %ld
strange_device.cpp:9:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |   scanf("%lld %lld %lld",&n,&a,&b);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
strange_device.cpp:14:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |     scanf("%lld %lld",&x,&y);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 38 ms 9268 KB Output is correct
3 Correct 52 ms 13500 KB Output is correct
4 Correct 2 ms 596 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 6 ms 852 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 33 ms 5316 KB Output is correct
16 Correct 24 ms 5064 KB Output is correct
17 Correct 51 ms 4932 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Runtime error 2275 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 98 ms 24300 KB Output is correct
3 Correct 122 ms 24152 KB Output is correct
4 Correct 95 ms 22976 KB Output is correct
5 Execution timed out 5055 ms 46900 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 481 ms 47312 KB Output is correct
3 Runtime error 1570 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 481 ms 47312 KB Output is correct
3 Runtime error 1570 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 481 ms 47312 KB Output is correct
3 Runtime error 1570 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Runtime error 1431 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 38 ms 9268 KB Output is correct
3 Correct 52 ms 13500 KB Output is correct
4 Correct 2 ms 596 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 6 ms 852 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 0 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 33 ms 5316 KB Output is correct
16 Correct 24 ms 5064 KB Output is correct
17 Correct 51 ms 4932 KB Output is correct
18 Correct 0 ms 212 KB Output is correct
19 Correct 1 ms 212 KB Output is correct
20 Runtime error 2275 ms 524288 KB Execution killed with signal 9
21 Halted 0 ms 0 KB -