QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#746960#8726. Magic ShowKiharaToumaCompile Error//C++23581b2024-11-14 15:59:232024-11-14 15:59:23

Judging History

你现在查看的是最新测评结果

  • [2024-11-14 15:59:23]
  • 评测
  • [2024-11-14 15:59:23]
  • 提交

Alice

#include "Alice.h"

std::vector<std::pair<int, int> > Alice(){
	vector<pair<int, int> > res;
	res.clear();
	ll val = setN(5000);
    for(int i = 2; i <= 5000; ++ i){
        res.emplace_back(val * (i-1) + 1, i);
    }
	return res;
}

Bob

#include "Bob.h"

long long Bob(std::vector<std::pair<int, int>> V){
	ll res = 0, nw = 1;
	for(auto i : V){
        ll x = i.first - 1, y = i.second - 1;
        while(res % y != x){
            res += nw;
        }
        nw = nw / __gcd(nw, y) * y;
        if(nw > 1e18){
            break;
        }
    }
	return res;
}

Details

Alice.code: In function ‘std::vector<std::pair<int, int> > Alice()’:
Alice.code:4:9: error: ‘vector’ was not declared in this scope
    4 |         vector<pair<int, int> > res;
      |         ^~~~~~
Alice.code:4:9: note: suggested alternatives:
In file included from /usr/include/c++/13/vector:66,
                 from Alice.h:1,
                 from Alice.code:1:
/usr/include/c++/13/bits/stl_vector.h:425:11: note:   ‘std::vector’
  425 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/13/vector:86:13: note:   ‘std::pmr::vector’
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
Alice.code:4:16: error: ‘pair’ was not declared in this scope; did you mean ‘std::pair’?
    4 |         vector<pair<int, int> > res;
      |                ^~~~
      |                std::pair
In file included from /usr/include/c++/13/bits/stl_algobase.h:64,
                 from /usr/include/c++/13/vector:62:
/usr/include/c++/13/bits/stl_pair.h:187:12: note: ‘std::pair’ declared here
  187 |     struct pair
      |            ^~~~
Alice.code:4:21: error: expected primary-expression before ‘int’
    4 |         vector<pair<int, int> > res;
      |                     ^~~
Alice.code:5:9: error: ‘res’ was not declared in this scope
    5 |         res.clear();
      |         ^~~
Alice.code:6:9: error: ‘ll’ was not declared in this scope
    6 |         ll val = setN(5000);
      |         ^~
Alice.code:8:26: error: ‘val’ was not declared in this scope
    8 |         res.emplace_back(val * (i-1) + 1, i);
      |                          ^~~