QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#769222 | #8936. Team Arrangement | Register# | Compile Error | / | / | C++14 | 694b | 2024-11-21 16:38:16 | 2024-11-21 16:38:22 |
Due to the privacy settings of the submitter, you are not allowed to view this code.
Details
answer.code: In function ‘int main()’: answer.code:2:505: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 2 | using namespace std;int n;vector<pair<int,int>>students;vector<int>w;long long best=LLONG_MIN;void dfs(long long state,int size,long long score){if(not size)return;if(state==(1ll<<n)-1){best=max(best,score);return;}dfs(state,size-1,score);int i=0;for(int j=0;i<size and j<n;j++){if(state&(1ll<<j))continue;if(students[j].first<=size and size<=students[j].second){state|=1ll<<j;i++;}}if(i==size)dfs(state,size,score+w[size-1]);}int main(){cin.tie(0)->sync_with_stdio(0);cin>>n;students.resize(n);for(auto&[l,r]:students)cin>>l>>r;ranges::sort(students,greater());w.resize(n);for(auto&x:w)cin>>x;dfs(0,60,0);if(best==LLONG_MIN)cout<<"impossible\n";else cout<<best<<'\n';} | ^ answer.code:2:530: error: ‘ranges’ has not been declared 2 | using namespace std;int n;vector<pair<int,int>>students;vector<int>w;long long best=LLONG_MIN;void dfs(long long state,int size,long long score){if(not size)return;if(state==(1ll<<n)-1){best=max(best,score);return;}dfs(state,size-1,score);int i=0;for(int j=0;i<size and j<n;j++){if(state&(1ll<<j))continue;if(students[j].first<=size and size<=students[j].second){state|=1ll<<j;i++;}}if(i==size)dfs(state,size,score+w[size-1]);}int main(){cin.tie(0)->sync_with_stdio(0);cin>>n;students.resize(n);for(auto&[l,r]:students)cin>>l>>r;ranges::sort(students,greater());w.resize(n);for(auto&x:w)cin>>x;dfs(0,60,0);if(best==LLONG_MIN)cout<<"impossible\n";else cout<<best<<'\n';} | ^~~~~~ answer.code:2:559: error: missing template arguments before ‘(’ token 2 | using namespace std;int n;vector<pair<int,int>>students;vector<int>w;long long best=LLONG_MIN;void dfs(long long state,int size,long long score){if(not size)return;if(state==(1ll<<n)-1){best=max(best,score);return;}dfs(state,size-1,score);int i=0;for(int j=0;i<size and j<n;j++){if(state&(1ll<<j))continue;if(students[j].first<=size and size<=students[j].second){state|=1ll<<j;i++;}}if(i==size)dfs(state,size,score+w[size-1]);}int main(){cin.tie(0)->sync_with_stdio(0);cin>>n;students.resize(n);for(auto&[l,r]:students)cin>>l>>r;ranges::sort(students,greater());w.resize(n);for(auto&x:w)cin>>x;dfs(0,60,0);if(best==LLONG_MIN)cout<<"impossible\n";else cout<<best<<'\n';} | ^