Submission #994333

# Submission time Handle Problem Language Result Execution time Memory
994333 2024-06-07T11:45:51 Z tosivanmak Magic Show (APIO24_show) C++17
Compilation error
0 ms 0 KB
#include "Alice.h"
#include <bits/stdc++.h>
 
using namespace std;
 
vector<pair<int, int>> Alice() {
  ll x=setN(5000);
  vector<pair<int,int> >edges;
  for(int i=2;i<=5000;i++){
      edges.push_back(x%(i-1)+1);
  }
  return edges;
}
#include <bits/stdc++.h>
#include "Bob.h"
 
using namespace std;
 
long long Bob(vector<pair<int,int>> v) {
  for(int i=0;i<v.size();i++){
      v[i].first--,v[i].second--;
      if(v[i].first<v[i].second){
          swap(v[i].first,v[i].second);
      }
  }
  sort(v.begin(),v.end());
  ll val=-1,add;
  for(int i=0;i<v.size();i++){
      if(val==-1){val=v[i].second;add=v[i].first;}
      else{
          while(val%v[i].first!=v[i].second){
              val+=add;
          }
          add=lcm(add,v[i].first);
      }
  }
  return val;
}

Compilation message

Alice.cpp: In function 'std::vector<std::pair<int, int> > Alice()':
Alice.cpp:7:3: error: 'll' was not declared in this scope
    7 |   ll x=setN(5000);
      |   ^~
Alice.cpp:10:23: error: 'x' was not declared in this scope
   10 |       edges.push_back(x%(i-1)+1);
      |                       ^

Bob.cpp: In function 'long long int Bob(std::vector<std::pair<int, int> >)':
Bob.cpp:7:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 |   for(int i=0;i<v.size();i++){
      |               ~^~~~~~~~~
Bob.cpp:14:3: error: 'll' was not declared in this scope
   14 |   ll val=-1,add;
      |   ^~
Bob.cpp:15:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |   for(int i=0;i<v.size();i++){
      |               ~^~~~~~~~~
Bob.cpp:16:10: error: 'val' was not declared in this scope
   16 |       if(val==-1){val=v[i].second;add=v[i].first;}
      |          ^~~
Bob.cpp:16:35: error: 'add' was not declared in this scope; did you mean 'std::filesystem::perm_options::add'?
   16 |       if(val==-1){val=v[i].second;add=v[i].first;}
      |                                   ^~~
      |                                   std::filesystem::perm_options::add
In file included from /usr/include/c++/10/filesystem:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:129,
                 from Bob.cpp:1:
/usr/include/c++/10/bits/fs_fwd.h:202:7: note: 'std::filesystem::perm_options::add' declared here
  202 |       add = 0x2,
      |       ^~~
Bob.cpp:19:20: error: 'add' was not declared in this scope; did you mean 'std::filesystem::perm_options::add'?
   19 |               val+=add;
      |                    ^~~
      |                    std::filesystem::perm_options::add
In file included from /usr/include/c++/10/filesystem:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:129,
                 from Bob.cpp:1:
/usr/include/c++/10/bits/fs_fwd.h:202:7: note: 'std::filesystem::perm_options::add' declared here
  202 |       add = 0x2,
      |       ^~~
Bob.cpp:21:11: error: 'add' was not declared in this scope; did you mean 'std::filesystem::perm_options::add'?
   21 |           add=lcm(add,v[i].first);
      |           ^~~
      |           std::filesystem::perm_options::add
In file included from /usr/include/c++/10/filesystem:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:129,
                 from Bob.cpp:1:
/usr/include/c++/10/bits/fs_fwd.h:202:7: note: 'std::filesystem::perm_options::add' declared here
  202 |       add = 0x2,
      |       ^~~
Bob.cpp:24:10: error: 'val' was not declared in this scope
   24 |   return val;
      |          ^~~