Submission #1018382

# Submission time Handle Problem Language Result Execution time Memory
1018382 2024-07-09T21:43:51 Z MohamedFaresNebili Magic Show (APIO24_show) C++17
35 / 100
3 ms 936 KB
#include <bits/stdc++.h>
#include "Alice.h"

		using namespace std;

		vector<pair<int, int>> Alice() {
			long long X = setN(5000);
			vector<pair<int, int>> G;
			for(int l = 1; l < 5000; l++) 
				G.push_back({X % l + 1, l + 1});
			return G;
		}
#include <bits/stdc++.h>
#include "Bob.h"

		using namespace std;

		long long Bob(vector<pair<int, int>> V) {
			long long res = 0;
			long long cur = 1;
			for(int l = 0; l < V.size(); l++)
				V[l].first--, V[l].second--;
			int i = 0;
			for(; res <= 1e18; res += cur) {
				while(i < V.size()) {
					if(res % V[i].second == V[i].first) {
                      	if(cur <= 1e18)
							cur = cur * (long long)V[i].second / __gcd(cur, (long long)V[i].second);
						i++;
					} else break;
				}
				if(i == V.size()) break;
			}
			return res;
		}

Compilation message

Bob.cpp: In function 'long long int Bob(std::vector<std::pair<int, int> >)':
Bob.cpp:9:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |    for(int l = 0; l < V.size(); l++)
      |                   ~~^~~~~~~~~~
Bob.cpp:13:13: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |     while(i < V.size()) {
      |           ~~^~~~~~~~~~
Bob.cpp:20:10: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |     if(i == V.size()) break;
      |        ~~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 820 KB Correct.
2 Correct 1 ms 820 KB Correct.
3 Correct 1 ms 824 KB Correct.
4 Correct 1 ms 828 KB Correct.
5 Correct 2 ms 816 KB Correct.
6 Correct 1 ms 820 KB Correct.
7 Correct 1 ms 820 KB Correct.
8 Correct 1 ms 820 KB Correct.
9 Correct 1 ms 820 KB Correct.
10 Correct 2 ms 820 KB Correct.
11 Correct 2 ms 820 KB Correct.
12 Correct 2 ms 816 KB Correct.
# Verdict Execution time Memory Grader output
1 Correct 1 ms 820 KB Correct.
2 Correct 1 ms 820 KB Correct.
3 Correct 1 ms 824 KB Correct.
4 Correct 1 ms 828 KB Correct.
5 Correct 2 ms 816 KB Correct.
6 Correct 1 ms 820 KB Correct.
7 Correct 1 ms 820 KB Correct.
8 Correct 1 ms 820 KB Correct.
9 Correct 1 ms 820 KB Correct.
10 Correct 2 ms 820 KB Correct.
11 Correct 2 ms 820 KB Correct.
12 Correct 2 ms 816 KB Correct.
13 Correct 1 ms 820 KB Correct.
14 Correct 1 ms 824 KB Correct.
15 Correct 2 ms 820 KB Correct.
16 Correct 1 ms 832 KB Correct.
17 Correct 2 ms 832 KB Correct.
18 Correct 2 ms 820 KB Correct.
19 Correct 2 ms 820 KB Correct.
20 Correct 1 ms 820 KB Correct.
21 Correct 1 ms 820 KB Correct.
22 Correct 1 ms 832 KB Correct.
23 Correct 1 ms 820 KB Correct.
24 Correct 1 ms 832 KB Correct.
# Verdict Execution time Memory Grader output
1 Correct 1 ms 820 KB Correct.
2 Correct 1 ms 820 KB Correct.
3 Correct 1 ms 824 KB Correct.
4 Correct 1 ms 828 KB Correct.
5 Correct 2 ms 816 KB Correct.
6 Correct 1 ms 820 KB Correct.
7 Correct 1 ms 820 KB Correct.
8 Correct 1 ms 820 KB Correct.
9 Correct 1 ms 820 KB Correct.
10 Correct 2 ms 820 KB Correct.
11 Correct 2 ms 820 KB Correct.
12 Correct 2 ms 816 KB Correct.
13 Correct 1 ms 820 KB Correct.
14 Correct 1 ms 824 KB Correct.
15 Correct 2 ms 820 KB Correct.
16 Correct 1 ms 832 KB Correct.
17 Correct 2 ms 832 KB Correct.
18 Correct 2 ms 820 KB Correct.
19 Correct 2 ms 820 KB Correct.
20 Correct 1 ms 820 KB Correct.
21 Correct 1 ms 820 KB Correct.
22 Correct 1 ms 832 KB Correct.
23 Correct 1 ms 820 KB Correct.
24 Correct 1 ms 832 KB Correct.
25 Correct 3 ms 820 KB Correct.
26 Correct 2 ms 936 KB Correct.
27 Incorrect 2 ms 824 KB Incorrect answer.
28 Halted 0 ms 0 KB -