都注释成这样了怎么还会RE。。。
查看原帖
都注释成这样了怎么还会RE。。。
1420936
Sparkle_ovo楼主2024/10/16 11:14
//#include <stdio.h>
//#include <stdlib.h>
#include<bits/stdc++.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
const int N = 1e5 + 10;
int a[N];
int qread() {
	int f = 1, num = 0;
	char a = getchar();
	while (a < '0' || a > '9') {
		if (a == '-')f = -1;
		a = getchar();
	}
	while ('0' <= a && a <= '9') {
		num *= 10;
		num += a - '0';
		a = getchar();
	}
	return num * f ;
//int a;
//cin>>a;
//return a;
}
int check(int l, int r, int opt) {
	while (l < r) {
		int mid = (l + r) >> 1;
		if (a[mid] < opt) l = mid + 1;
		else if (a[mid] >= opt) r = mid ;
//		else if (a[mid] == opt ){
////			while(a[mid]==a[mid-1]&&mid>1)mid--;
//			return mid;
//		}
	}
	if(a[l]!=opt)
	return -1;
	else return l;
}
int main() {
	int n, m;
	cin >> n >> m;
	for (int i = 1; i <= n; i++) {
//		a[i] = qread();
		cin>>a[i];
	}
	for (int i = 1; i <= m; i++) {
//		int opt = qread();
//int opt;cin>>opt;
//		cout << check(1, n, opt) << " ";
	}
//	getchar();
	return 0;
}
2024/10/16 11:14
加载中...