QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#99118#6308. MagicDrGilbertCompile Error//C++20670b2023-04-21 11:12:102023-04-21 11:12:14

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-21 11:12:14]
  • 评测
  • [2023-04-21 11:12:10]
  • 提交

answer

#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const int N=5010;
int l[N],r[N],mat[N];
bitset<N> G[N],vis;
bool dfs(int x){
	bitset<N> tmp=vis&G[x];
	for (int v=tmp._Find_first();v<N;v=tmp._Find_next(v)){
		vis[v]=0;if (!mat[v]||dfs(mat[v])) return mat[v]=u;
	}return 0;
}
int main(){
	ios::sync_with_stdio(0);
	cin.tie(nullptr);cout.tie(nullptr);
	int n;cin>>n;
	for (int i=1;i<=n;i++) cin>>L[i]>>R[i];
	for (int i=1;i<=n;i++){
		for (int j=1;j<=n;j++){
			if (l[i]<l[j]&&l[j]<r[i]&&r[i]<r[j]){
				G[j][i]=1;
			}
		}
	}int ans=2*n;
	for (int i=1;i<=n;i++){
		vis.set();ans-=dfs(i);
	}cout<<ans<<endl;return 0;
}

详细

answer.code: In function ‘bool dfs(int)’:
answer.code:10:66: error: ‘u’ was not declared in this scope
   10 |                 vis[v]=0;if (!mat[v]||dfs(mat[v])) return mat[v]=u;
      |                                                                  ^
answer.code: In function ‘int main()’:
answer.code:17:37: error: ‘L’ was not declared in this scope
   17 |         for (int i=1;i<=n;i++) cin>>L[i]>>R[i];
      |                                     ^
answer.code:17:43: error: ‘R’ was not declared in this scope
   17 |         for (int i=1;i<=n;i++) cin>>L[i]>>R[i];
      |                                           ^