- 博客(7)
- 收藏
- 关注
原创 洛谷P1047 [NOIP2005 普及组] 校门外的树
C++代码:#include <bits/stdc++.h>using namespace std;int main(){ int l,m,tree[10010],a,b,s=0; memset(tree,0,sizeof(tree)); cin>>l>>m; for(int i=0;i<m;i++){ cin>>a>>b; for(int j=a;j<=b;j++) tree[j]=1; } f..
2022-05-21 17:34:25
271
原创 洛谷P1028 [NOIP2001 普及组] 数的计算
题目:C++代码:#include <bits/stdc++.h>using namespace std;const int N = 1010;int f[N];int n;int main() { cin >> n; f[1] = 1; for (int i = 2; i <= n; i++) { f[i] = 1; for (int j = 1; j <= i / 2; j++) f[
2022-05-21 17:18:12
285
原创 洛谷P1014 [NOIP1999 普及组] Cantor 表
题目C++代码:#include<bits/stdc++.h>using namespace std;int main(){ int n,tot=0; cin>>n; for(int i=1;;i++){ tot=tot+i; int sum=i+1; if(tot>=n){ int temp=tot-i; temp=n-temp; if(i%2){ cout<<(sum-temp)<<'/'
2022-05-21 17:14:59
232
原创 洛谷P1008 [NOIP1998 普及组] 三连击
#include<iostream>#include<algorithm>using namespace std;int main(){ int arr[9];//定义数组 for(int i = 0;i < 9;i++) arr[i] = i + 1; while(next_permutation(arr , arr + 9)){ int a = arr[0]*100 + arr[1]*10 + arr[2];.
2022-05-21 15:38:21
299
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人