QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#797803 | #9810. Obliviate, Then Reincarnate | ucup-team4975 | Compile Error | / | / | C++14 | 1.6kb | 2024-12-03 18:46:31 | 2024-12-03 18:46:31 |
Judging History
This is the latest submission verdict.
- [2024-12-03 18:46:31]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2024-12-03 18:46:31]
- Submitted
answer
#define LOCAL
#include <bits/stdc++.h>
#define fir first
#define sec second
#define el '\n'
#ifdef LOCAL
#define FINISH cerr << "FINISH" << endl;
#else
#define FINISH ;
#endif
#ifdef LOCAL
#define debug(x) cerr << setw(4) << #x << " == " << x << endl
#else
#define debug(x)
#endif
#ifdef LOCAL
#define debugv(x) \
cerr << setw(4) << #x << ":: "; \
for (auto i : x) \
cerr << i << " "; \
cerr << endl
#else
#define debugv(x)
#endif
using namespace std;
typedef long long ll;
typedef pair<int, int> PII;
ostream& operator<<(ostream& out, PII& x)
{
out << x.fir << " " << x.sec << endl;
return out;
}
const int mod = 998244353;
const ll inf = 0x3f3f3f3f3f3f3f3f;
const int N = 200020;
void solve()
{
int n,m,q;
cin>>n>>m>>q;
vector<vector<ll>> G(n+1,vector<ll>());
for(int i=0;i<m;i++){
ll a,b;
cin>>a>>b;
a=((a%n)+n)%n;
G[a].push_back(b);
}
vector<bool> ans(n,0);
vector<int> vis(n,0);
function<bool(ll,ll)> dfs=[&](ll x,ll d){
if(vis[x]==1){
return ans[x];
}
else if(vis[x]==2){
if(d!=x)return true;
else return false;
}
vis[x]=2;
bool res=false;
for(ll y:G[x]){
res|=dfs((((x+d)%n)+n)%n,x+d);
}
vis[x]=1;
ans[x]=true;
return res;
};
for(int i=0;i<n;i++)dfs(i,i);
while(q--){
ll x;
cin>>x;
x=((x%n)+n)%n;
if(ans[x])cout<<"Yes\n";
else cout<<"No\n";
}
return;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
int T = 1;
//cin >> T;
while (T--) {
solve();
}
return 0;
}
详细
answer.code: In lambda function: answer.code:60:40: error: inconsistent types ‘std::_Bit_reference’ and ‘bool’ deduced for lambda return type 60 | if(d!=x)return true; | ^~~~ answer.code:60:40: error: no matching function for call to ‘std::_Bit_reference::_Bit_reference(bool)’ In file included from /usr/include/c++/13/vector:67, from /usr/include/c++/13/queue:63, from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:157, from answer.code:2: /usr/include/c++/13/bits/stl_bvector.h:91:5: note: candidate: ‘constexpr std::_Bit_reference::_Bit_reference(const std::_Bit_reference&)’ 91 | _Bit_reference(const _Bit_reference&) = default; | ^~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_bvector.h:91:20: note: no known conversion for argument 1 from ‘bool’ to ‘const std::_Bit_reference&’ 91 | _Bit_reference(const _Bit_reference&) = default; | ^~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_bvector.h:88:5: note: candidate: ‘std::_Bit_reference::_Bit_reference()’ 88 | _Bit_reference() _GLIBCXX_NOEXCEPT : _M_p(0), _M_mask(0) { } | ^~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_bvector.h:88:5: note: candidate expects 0 arguments, 1 provided /usr/include/c++/13/bits/stl_bvector.h:84:5: note: candidate: ‘std::_Bit_reference::_Bit_reference(std::_Bit_type*, std::_Bit_type)’ 84 | _Bit_reference(_Bit_type * __x, _Bit_type __y) | ^~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_bvector.h:84:5: note: candidate expects 2 arguments, 1 provided answer.code:61:37: error: inconsistent types ‘std::_Bit_reference’ and ‘bool’ deduced for lambda return type 61 | else return false; | ^~~~~ answer.code:61:37: error: no matching function for call to ‘std::_Bit_reference::_Bit_reference(bool)’ /usr/include/c++/13/bits/stl_bvector.h:91:5: note: candidate: ‘constexpr std::_Bit_reference::_Bit_reference(const std::_Bit_reference&)’ 91 | _Bit_reference(const _Bit_reference&) = default; | ^~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_bvector.h:91:20: note: no known conversion for argument 1 from ‘bool’ to ‘const std::_Bit_reference&’ 91 | _Bit_reference(const _Bit_reference&) = default; | ^~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_bvector.h:88:5: note: candidate: ‘std::_Bit_reference::_Bit_reference()’ 88 | _Bit_reference() _GLIBCXX_NOEXCEPT : _M_p(0), _M_mask(0) { } | ^~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_bvector.h:88:5: note: candidate expects 0 arguments, 1 provided /usr/include/c++/13/bits/stl_bvector.h:84:5: note: candidate: ‘std::_Bit_reference::_Bit_reference(std::_Bit_type*, std::_Bit_type)’ 84 | _Bit_reference(_Bit_type * __x, _Bit_type __y) | ^~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_bvector.h:84:5: note: candidate expects 2 arguments, 1 provided answer.code:70:24: error: inconsistent types ‘std::_Bit_reference’ and ‘bool’ deduced for lambda return type 70 | return res; | ^~~ answer.code:70:24: error: no matching function for call to ‘std::_Bit_reference::_Bit_reference(bool&)’ /usr/include/c++/13/bits/stl_bvector.h:91:5: note: candidate: ‘constexpr std::_Bit_reference::_Bit_reference(const std::_Bit_reference&)’ 91 | _Bit_reference(const _Bit_reference&) = default; | ^~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_bvector.h:91:20: note: no known conversion for argument 1 from ‘bool’ to ‘const std::_Bit_reference&’ 91 | _Bit_reference(const _Bit_reference&) = default; | ^~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_bvector.h:88:5: note: candidate: ‘std::_Bit_reference::_Bit_reference()’ 88 | _Bit_reference() _GLIBCXX_NOEXCEPT : _M_p(0), _M_mask(0) { } | ^~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_bvector.h:88:5: note: candidate expects 0 arguments, 1 provided /usr/include/c++/13/bits/stl_bvector.h:84:5: note: candidate: ‘std::_Bit_reference::_Bit_reference(std::_Bit_type*, std::_Bit_type)’ 84 | _Bit_reference(_Bit_type * __x, _Bit_type __y) | ^~~~~~~~~~~~~~ /usr/include/c++/13/bits/stl_bvector.h:84:5: note: candidate expects 2 arguments, 1 provided