Submission #569819

# Submission time Handle Problem Language Result Execution time Memory
569819 2022-05-27T20:41:22 Z DarkMatter Strange Device (APIO19_strange_device) C++14
10 / 100
5000 ms 524288 KB
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
using std::chrono::high_resolution_clock;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int>pi;
typedef pair<ll, ll>pl;
typedef vector<pi>vpi;
typedef vector<pl>vpl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<string> vs;
const double PI = acos(-1);
const int oo = 1e9 + 7;
const int MOD = 1e9 + 7;
const int N = 1e6 + 1;
#define endl '\n'
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define read(v) for (auto& it : v) scanf("%d", &it);
#define readL(v) for (auto& it : v) scanf("%lld", &it);
#define print(v) for (auto it : v) printf("%d ", it); puts("");
#define printL(v) for (auto it : v) printf("%lld ", it); puts("");
auto Time() {
	return high_resolution_clock::now();
}
void solve() {
	ll n, a, b;
	scanf("%lld %lld %lld", &n, &a, &b);
	set<pl>st;
	while (n--) {
		ll l, r;
		scanf("%lld %lld", &l, &r);
		while (l <= r) {
			ll x = ((l + l / b) % a), y = (l % b);
			st.insert({ x,y });
			l++;
		}
	}
	printf("%d\n", st.size());
}
int t = 1;
int main() {
//#ifndef ONLINE_JUDGE
//	freopen("input.txt", "r", stdin);
//#endif
	//scanf("%d", &t);
	while (t--) solve();
}

Compilation message

strange_device.cpp: In function 'void solve()':
strange_device.cpp:43:11: warning: format '%d' expects argument of type 'int', but argument 2 has type 'std::set<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wformat=]
   43 |  printf("%d\n", st.size());
      |          ~^     ~~~~~~~~~
      |           |            |
      |           int          std::set<std::pair<long long int, long long int> >::size_type {aka long unsigned int}
      |          %ld
strange_device.cpp:32:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   32 |  scanf("%lld %lld %lld", &n, &a, &b);
      |  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
strange_device.cpp:36:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   36 |   scanf("%lld %lld", &l, &r);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 41 ms 12580 KB Output is correct
3 Correct 66 ms 18252 KB Output is correct
4 Correct 3 ms 852 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 468 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 7 ms 1200 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 40 ms 6908 KB Output is correct
16 Correct 34 ms 6976 KB Output is correct
17 Correct 68 ms 10180 KB Output is correct
18 Correct 0 ms 296 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 300 KB Output is correct
2 Runtime error 2613 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 130 ms 32216 KB Output is correct
3 Correct 169 ms 32080 KB Output is correct
4 Correct 111 ms 30548 KB Output is correct
5 Execution timed out 5081 ms 62592 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 576 ms 78900 KB Output is correct
3 Runtime error 1703 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 576 ms 78900 KB Output is correct
3 Runtime error 1703 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 576 ms 78900 KB Output is correct
3 Runtime error 1703 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Runtime error 1367 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 41 ms 12580 KB Output is correct
3 Correct 66 ms 18252 KB Output is correct
4 Correct 3 ms 852 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
7 Correct 1 ms 468 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 7 ms 1200 KB Output is correct
10 Correct 0 ms 212 KB Output is correct
11 Correct 1 ms 212 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 40 ms 6908 KB Output is correct
16 Correct 34 ms 6976 KB Output is correct
17 Correct 68 ms 10180 KB Output is correct
18 Correct 0 ms 296 KB Output is correct
19 Correct 0 ms 300 KB Output is correct
20 Runtime error 2613 ms 524288 KB Execution killed with signal 9
21 Halted 0 ms 0 KB -