Submission #1018386

#TimeUsernameProblemLanguageResultExecution timeMemory
1018386MohamedFaresNebiliMagic Show (APIO24_show)C++17
100 / 100
1 ms1044 KiB
#include <bits/stdc++.h>
#include "Alice.h"

		using namespace std;

		vector<pair<int, int>> Alice() {
			long long X = setN(1000);
			vector<pair<int, int>> G;
			for(int l = 1; l < 1000; 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 <= 1e15)
							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 (stderr)

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...