Submission #1270330

#TimeUsernameProblemLanguageResultExecution timeMemory
1270330noopMagic Show (APIO24_show)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "Alice.h"
using namespace std;

vector<pair<int,int>> Alice(){
    vector<pair<int,int>> v;
    setN(75);
    for (int i=1; i<75; ++i)
      v.push_back({x%i+1,i+1});
    return v;
}
#include <bits/stdc++.h>
#include "Bob.h"
using namespace std;

long long Bob(vector<pair<int,int>> V){
	size_t rem,divis,ans=1,d=1;
  for (int i=0; i<V.size(); i++){
    rem=V[i].first-1;
    divis=V[i].second-1;
    while ((ans%divis)!=rem){
      ans+=d;
    }
    d*=(divis/gcd(d,divis));
  }
  return ans;
}

Compilation message (stderr)

# 1번째 컴파일 단계

Alice.cpp: In function 'std::vector<std::pair<int, int> > Alice()':
Alice.cpp:9:20: error: 'x' was not declared in this scope
    9 |       v.push_back({x%i+1,i+1});
      |                    ^
Alice.cpp:9:18: error: no matching function for call to 'std::vector<std::pair<int, int> >::push_back(<brace-enclosed initializer list>)'
    9 |       v.push_back({x%i+1,i+1});
      |       ~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/13/vector:66,
                 from /usr/include/c++/13/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:53,
                 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)
      |                 ~~~~~~~~~~~~~^~~