跳到正文

题解

《不可以,总司令》做法

warmingcium约 1 分钟
原文
文章信息与版本

文章信息

发布
2023年1月19日
收录
2025年12月12日
更新
2026年11月8日
篇幅
约 1 分钟
题目
CF1267H

版本

  1. v2当前
  2. v1

提供一种无脑做法: 每次使劲输出1,2,3,4,5…直到24,再回到1,无视p数组。这样可以最大可能性地避免2倍数重复。得分为91pts。 代码如下:

#include<bits/stdc++.h>
using namespace std;
int a[1100006];
int main(){
	int T,n;
	scanf("%d",&T);
	while(T--){
		scanf("%d",&n);
		for(int i=1;i<=n;i++){
			scanf("%d",&a[i]);
	   	}
		int pout=1;
		for(int i=1;i<=n;i++){
			if(pout>24) pout=1;
			printf("%d ",pout);
			pout++;
		}
		printf("\n");
	}
	return 0;
}
原文