답안 #1018386

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1018386 2024-07-09T21:49:16 Z MohamedFaresNebili 마술쇼 (APIO24_show) C++17
100 / 100
1 ms 1044 KB
#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

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;
      |        ~~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 780 KB Correct.
2 Correct 0 ms 788 KB Correct.
3 Correct 1 ms 788 KB Correct.
4 Correct 1 ms 780 KB Correct.
5 Correct 1 ms 792 KB Correct.
6 Correct 0 ms 788 KB Correct.
7 Correct 0 ms 1032 KB Correct.
8 Correct 0 ms 792 KB Correct.
9 Correct 0 ms 780 KB Correct.
10 Correct 0 ms 1032 KB Correct.
11 Correct 0 ms 780 KB Correct.
12 Correct 0 ms 792 KB Correct.
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 780 KB Correct.
2 Correct 0 ms 788 KB Correct.
3 Correct 1 ms 788 KB Correct.
4 Correct 1 ms 780 KB Correct.
5 Correct 1 ms 792 KB Correct.
6 Correct 0 ms 788 KB Correct.
7 Correct 0 ms 1032 KB Correct.
8 Correct 0 ms 792 KB Correct.
9 Correct 0 ms 780 KB Correct.
10 Correct 0 ms 1032 KB Correct.
11 Correct 0 ms 780 KB Correct.
12 Correct 0 ms 792 KB Correct.
13 Correct 0 ms 796 KB Correct.
14 Correct 1 ms 780 KB Correct.
15 Correct 0 ms 784 KB Correct.
16 Correct 0 ms 780 KB Correct.
17 Correct 0 ms 1044 KB Correct.
18 Correct 0 ms 788 KB Correct.
19 Correct 0 ms 788 KB Correct.
20 Correct 0 ms 780 KB Correct.
21 Correct 1 ms 788 KB Correct.
22 Correct 0 ms 780 KB Correct.
23 Correct 0 ms 780 KB Correct.
24 Correct 0 ms 788 KB Correct.
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 780 KB Correct.
2 Correct 0 ms 788 KB Correct.
3 Correct 1 ms 788 KB Correct.
4 Correct 1 ms 780 KB Correct.
5 Correct 1 ms 792 KB Correct.
6 Correct 0 ms 788 KB Correct.
7 Correct 0 ms 1032 KB Correct.
8 Correct 0 ms 792 KB Correct.
9 Correct 0 ms 780 KB Correct.
10 Correct 0 ms 1032 KB Correct.
11 Correct 0 ms 780 KB Correct.
12 Correct 0 ms 792 KB Correct.
13 Correct 0 ms 796 KB Correct.
14 Correct 1 ms 780 KB Correct.
15 Correct 0 ms 784 KB Correct.
16 Correct 0 ms 780 KB Correct.
17 Correct 0 ms 1044 KB Correct.
18 Correct 0 ms 788 KB Correct.
19 Correct 0 ms 788 KB Correct.
20 Correct 0 ms 780 KB Correct.
21 Correct 1 ms 788 KB Correct.
22 Correct 0 ms 780 KB Correct.
23 Correct 0 ms 780 KB Correct.
24 Correct 0 ms 788 KB Correct.
25 Correct 1 ms 780 KB Correct.
26 Correct 1 ms 780 KB Correct.
27 Correct 0 ms 788 KB Correct.
28 Correct 0 ms 780 KB Correct.
29 Correct 0 ms 780 KB Correct.
30 Correct 0 ms 780 KB Correct.
31 Correct 0 ms 780 KB Correct.
32 Correct 0 ms 780 KB Correct.
33 Correct 1 ms 780 KB Correct.
34 Correct 0 ms 780 KB Correct.
35 Correct 1 ms 788 KB Correct.
36 Correct 1 ms 804 KB Correct.
37 Correct 1 ms 780 KB Correct.
38 Correct 1 ms 792 KB Correct.
39 Correct 0 ms 780 KB Correct.
40 Correct 0 ms 780 KB Correct.
41 Correct 1 ms 780 KB Correct.
42 Correct 1 ms 792 KB Correct.
43 Correct 0 ms 788 KB Correct.
44 Correct 0 ms 780 KB Correct.