跳到正文

题解

题解:P14117 [SCCPC 2021] Chuanpai

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

文章信息

收录
2025年12月31日
更新
2025年12月31日
篇幅
约 1 分钟
题目
P14117

版本

  1. v1当前

打表 !!

发现1≤x≤y≤61\le x \le y \le 6,因此只要k>12k>12就可以直接输出 00。

其余的1≤k≤121\le k \le 12的情况打表就行了。

C++
#include<bits/stdc++.h>

using namespace std;
int k;
int T;
int ans[17]={0,0,1,1,2,2,3,3,3,2,2,1,1};
int main(){
	cin>>T;
	while(T--){
		cin>>k;
		if(k>12){
			cout<<0<<endl;
		}
		else{
			cout<<ans[k]<<endl;
		}
	}
	return 0;
}
原文