绝世好题
  • 板块灌水区
  • 楼主xUwT
  • 当前回复6
  • 已保存回复6
  • 发布时间2023/10/11 21:29
  • 上次更新2023/11/2 14:23:57
查看原帖
绝世好题
109652
xUwT楼主2023/10/11 21:29

绝世好题 奇怪算法

//测试
//测试
#include <iostream>
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include<ctime>
using namespace std;
const int INF=1e5+10;
int n,a[INF],l[INF],len=1;
int main(){
	scanf("%d",&n);
	srand(time(0));
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);
	l[1]=a[1];
	for(int i=2;i<=n;i++){
		if(a[i]&l[len]) l[++len]=a[i];
		else
    		l[len]|=159;//可以随便改试试
	}
	cout <<len<<endl;
	return 0;
} 
2023/10/11 21:29
加载中...