Submission #1366730

#TimeUsernameProblemLanguageResultExecution timeMemory
1366730ahmdnawazMagic Show (APIO24_show)C++20
Compilation error
0 ms0 KiB
#include <vector>
#include "Alice.h"

using namespace std;


using ll = int64_t;

std::vector<std::pair<int,int>> Alice(){
	ll X = setN(5000);
	vector<int> nums = {88, 135, 254, 293, 349, 362, 619, 833, 862, 943, 966, 1079, 1090, 1134, 1193, 1552, 1588, 1631, 1661, 1681, 1725, 1756, 1875, 1915, 1975, 2009, 2045, 2065, 2161, 2191, 2217, 2249, 2260, 2325, 2426, 2565, 2627, 2641, 2838, 2902, 2954, 2974, 2988, 3044, 3102, 3156, 3188, 3221, 3314, 3342, 3396, 3419, 3482, 3537, 3920, 3941, 4010, 4171, 4181, 4197};
    sort(all(nums));
    int back = 5000;
    set<pair<int, int>> edges;
    for (int i = 1; i < 5000; i++) edges.insert({i, i + 1});
    for (int i = 1; i < 5000; i++) {
    	auto it = lower_bound(all(nums));
    	if (it != nums.end() && *it == i) {
    		ll ind = it - nums.begin();
    		if (!((X >> ind) & 1)) continue;
    		for (int j = 0; j < 10; j++) {
    			edges.erase({back - 1, back});
    			edges.insert({i, back});
    			back --;
    		}
    	}
    }
    vector<pair<int, int>> vec;
    for (auto [u, v] : edges) vec.push_back({u, v});
    return vec;
}
#include <vector>
#include "Bob.h"

using namespace std;


using ll = int64_t

long long Bob(std::vector<std::pair<int,int>> V){
	vector<int> deg(5001, 0);
	for (auto [u, v] : V) {
		deg[u]++;
		deg[v]++;
	}
	vector<int> nums = {88, 135, 254, 293, 349, 362, 619, 833, 862, 943, 966, 1079, 1090, 1134, 1193, 1552, 1588, 1631, 1661, 1681, 1725, 1756, 1875, 1915, 1975, 2009, 2045, 2065, 2161, 2191, 2217, 2249, 2260, 2325, 2426, 2565, 2627, 2641, 2838, 2902, 2954, 2974, 2988, 3044, 3102, 3156, 3188, 3221, 3314, 3342, 3396, 3419, 3482, 3537, 3920, 3941, 4010, 4171, 4181, 4197};
	ll ans = 0;
	for (ll i = 0; i < 60; i++) {
		ll x = nums[i];
		if (deg[x] > 1) ans |= (1LL << i); 
	}
	return ans; 
}

Compilation message (stderr)

# 1번째 컴파일 단계

Alice.cpp:7:12: error: 'int64_t' does not name a type
    7 | using ll = int64_t;
      |            ^~~~~~~
Alice.cpp:3:1: note: 'int64_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
    2 | #include "Alice.h"
  +++ |+#include <cstdint>
    3 | 
Alice.cpp: In function 'std::vector<std::pair<int, int> > Alice()':
Alice.cpp:10:9: error: 'll' was not declared in this scope
   10 |         ll X = setN(5000);
      |         ^~
Alice.cpp:12:10: error: 'all' was not declared in this scope
   12 |     sort(all(nums));
      |          ^~~
Alice.cpp:12:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   12 |     sort(all(nums));
      |     ^~~~
      |     short
Alice.cpp:14:5: error: 'set' was not declared in this scope
   14 |     set<pair<int, int>> edges;
      |     ^~~
Alice.cpp:3:1: note: 'std::set' is defined in header '<set>'; did you forget to '#include <set>'?
    2 | #include "Alice.h"
  +++ |+#include <set>
    3 | 
Alice.cpp:14:22: error: expected primary-expression before '>' token
   14 |     set<pair<int, int>> edges;
      |                      ^~
Alice.cpp:14:25: error: 'edges' was not declared in this scope
   14 |     set<pair<int, int>> edges;
      |                         ^~~~~
Alice.cpp:19:19: error: expected ';' before 'ind'
   19 |                 ll ind = it - nums.begin();
      |                   ^~~~
      |                   ;
Alice.cpp:20:24: error: 'X' was not declared in this scope
   20 |                 if (!((X >> ind) & 1)) continue;
      |                        ^
Alice.cpp:20:29: error: 'ind' was not declared in this scope; did you mean 'int'?
   20 |                 if (!((X >> ind) & 1)) continue;
      |                             ^~~
      |                             int
Alice.cpp:29:44: error: no matching function for call to 'std::vector<std::pair<int, int> >::push_back(<brace-enclosed initializer list>)'
   29 |     for (auto [u, v] : edges) vec.push_back({u, v});
      |                               ~~~~~~~~~~~~~^~~~~~~~
In file included from /usr/include/c++/13/vector:66,
                 from Alice.cpp:1:
/usr/include/c++/13/bits/stl_vector.h:1281:7: note: candidate: 'constexpr void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]'
 1281 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/13/bits/stl_vector.h:1281:35: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::vector<std::pair<int, int> >::value_type&' {aka 'const std::pair<int, int>&'}
 1281 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/stl_vector.h:1298:7: note: candidate: 'constexpr void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]'
 1298 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/13/bits/stl_vector.h:1298:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::pair<int, int> >::value_type&&' {aka 'std::pair<int, int>&&'}
 1298 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~