|
登上榜一纪念
题目 1423 [NOIP 2013]计数问题
2018-09-26 17:22:58
|
|
页面 30 [联赛可能考到但真的没有考]图论相关算法
2018-09-25 23:48:52
|
|
|
|
那我应该是2018第二评论
页面 16 [题目] 历年 NOIP/CSP 试题
2018-09-25 18:13:34
|
|
orzorzorz
HXF da lao
题目 1406 [UVa 11462] 年龄排序
2018-09-24 20:16:56
|
|
看错样例输出.........
orzorzorzorzorz 黄XF da lao
题目 87 [NOIP 2000J/S]乘积最大
2018-09-24 19:55:34
|
|
回复 @梦那边的美好ETMN :
orzorzorzorzorzorzorzorzorzorz orzorzorzorzorzorzorzorzorzorz orzorzorzorzorzorzorzorzorzorz orzorzorzorzorzorzorzorzorzorz 黄XF da lao
题目 4 双服务点设置
2018-09-24 18:17:47
|
|
[size=100]orz[/size]
|
|
Floyd一遍过,学校1.18的教学系统分类是树,老师也推荐用树,但用图论更简单
![]()
题目 326 医院设置
2018-09-23 14:15:14
|
|
#include <bits/stdc++.h>
using namespace std; int main(void) { freopen("pj07-1.in","r",stdin); freopen("pj07-1.out","w",stdout); int n = 0,a[1000]={0},b=0,c=0;int m[1000],sum=0,sum2=0,s=0; cin>>n; for(int i = 1;i<n+1;i++) { cin>>a[i]>>b >>c ; m[i]=a[i]+b+c; } for(int i = 1;i<6;i++) { for(int j = 1;j<n+1;j++) { if(m[j]>sum) { sum=m[j];sum2=a[j];s=j; } if(m[j]==sum&&a[j]>sum2) { sum=m[j];sum2=a[j];s=j; } }cout<<s<<" "<<m[s]<<endl;sum=0;sum2=0;m[s]=0; } } |
|
沙发
页面 20 [COGS] 题目规范
2018-09-22 22:09:24
|
|
题目 2872 [NOIP 2017PJ]棋盘
2018-09-22 10:59:00
|
|
回复 @E.M.B.E.R :
题目 159 [USACO Oct07] 完全平方数
2018-09-21 21:44:33
|
|
#include <iostream>
#include <cstdio> #include <vector> #include <algorithm> #include <string.h> using namespace std; int n,m; int t[100005]={0}; class node{ public: int z,r; long long sum; }tr[500001]; void build(int root,int z,int r){ tr[root].sum=t[r]-t[z-1]; tr[root].z=z; tr[root].r=r; if(z==r){ return; } int mid=(z+r)/2; build(root*2,z,mid); build(root*2+1,mid+1,r); } int ask(int root,int z,int r){ if(tr[root].z==z && tr[root].r==r){ return tr[root].sum; } int mid=(tr[root].z+tr[root].r)/2; if(r<=mid){ return ask(root*2,z,r); } if(z>mid){ return ask(root*2+1,z,r); } return ask(root*2,z,mid) + ask(root*2+1,mid+1,r); } void add(int root,int x,int y){ tr[root].sum+=y; if(tr[root].z==tr[root].r){ return; } int mid=(tr[root].z+tr[root].r)/2; if(x<=mid){ add(root*2,x,y); } if(x>mid){ add(root*2+1,x,y); } } int main(){ freopen("shulie.in","r",stdin); freopen("shulie.out","w",stdout); int x,y; char p[5]; scanf("%d",&n); t[0]=0; for(int a=1;a<=n;++a){ scanf("%d",&x); t[a]=t[a-1]+x; } build(1,1,n); scanf("%d",&m); for(int a=1;a<=m;++a){ scanf("%s%d%d",&p,&x,&y); if(p[0]=='S'){ printf("%d\n",ask(1,x,y)); } else{ add(1,x,y); } } return 0; }
题目 1 加法问题
2018-09-21 21:22:00
|
|
官方的数据没有考虑一种情况:即存在0环,但0环不影响符合条件路径的情况。如果只判断0环是否存在,不考虑0环是否在符合条件的路上的话,那么就是不正确的,故笔者修改了第一组数据的最后一小组,添加了这种情况:
6 9 0 10 1 3 2 1 5 1 2 4 0 3 2 4 3 6 2 3 5 1 4 2 0 4 6 2 5 6 3
题目 2866 [NOIP 2017]逛公园
2018-09-21 16:10:20
|
|
。
题目 1267 [NOIP 2012]疫情控制
2018-09-21 15:41:53
|
|
题目 547 [HAOI 2011]防线修建
2018-09-20 22:21:16
|
|
@无言 说好的关闭流同步会比scanf快呢?为啥并没有
题目 2963 [SYOI 2018] PH试纸
2018-09-20 21:41:55
|
|
你们都是7s 只有我大临哥2s,哈哈哈哈哈
题目 2963 [SYOI 2018] PH试纸
2018-09-20 20:43:17
|
|
宽搜硬是开了3000w的数组,血与泪的教训啊,一定一定要开大啊,调了10min、。。。。
|