Submission #1202373

#TimeUsernameProblemLanguageResultExecution timeMemory
1202373noopMagic Show (APIO24_show)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "Alice.h"
using namespace std;
// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().

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

// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().

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

Compilation message (stderr)

# 2번째 컴파일 단계

Bob.cpp: In function 'long long int Bob(std::vector<std::pair<int, int> >)':
Bob.cpp:16:14: error: 'gcd' was not declared in this scope; did you mean 'std::gcd'?
   16 |     d*=divis/gcd(d,divis);
      |              ^~~
      |              std::gcd
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:84,
                 from Bob.cpp:1:
/usr/include/c++/11/numeric:164:5: note: 'std::gcd' declared here
  164 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~