摘要: 身份证号必须是 \(18\) 位的数字,数字,数字,大概是眼瞎了。 同一个身份证号若在第 i 天申请成功,则接下来的 P 天不能再次申请。也就是说,若第 i 天申请成功,则等到第 i+P+1 天才能再次申请; 按照提交时间的先后顺序发放,直至全部记录处理完毕或 S个名额用完。如果提交时间相同,则按照 阅读全文
posted @ 2021-04-20 23:27 Dazzling! 阅读(313) 评论(0) 推荐(0) 编辑
摘要: 水题~。 const int N=1010; int a[N]; stack<int> num; stack<char> opt; int n; int main() { cin>>n; for(int i=0;i<n;i++) { int x; cin>>x; num.push(x); } for 阅读全文
posted @ 2021-04-20 22:16 Dazzling! 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 水题。 const int N=210; int g[N][N]; int n,m,q; int tot,ans,idx; int main() { cin>>n>>m; memset(g,0x3f,sizeof g); while(m--) { int a,b,c; cin>>a>>b>>c; g 阅读全文
posted @ 2021-04-20 21:50 Dazzling! 阅读(314) 评论(0) 推荐(0) 编辑
摘要: 水题。 const int N=1e5+10; int a[N]; int n; int main() { cin>>n; for(int i=0;i<n;i++) cin>>a[i]; sort(a,a+n); int res=0; for(int i=0;i<n/2;i++) res+=a[n- 阅读全文
posted @ 2021-04-20 19:07 Dazzling! 阅读(117) 评论(0) 推荐(0) 编辑
摘要: 按题意模拟就好了...咳咳。 $vis$数组判断每轮迭代至数字$1$的过程中是否出现过重复数字。 哈希表$S$存储迭代过程中产生的中间数字,以便最后输出答案时过滤掉依附于其他数字的幸福数。 const int N=1e4+10; bool vis[N]; int l,r; unordered_set 阅读全文
posted @ 2021-04-20 17:18 Dazzling! 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 根据完全二叉树的性质(编号为$u$的节点的左儿子编号为$u2$,右儿子编号为$u2+1$),并利用后序遍历进行递归建树。 $level[i]$存储编号为$i$的节点的值。 const int N=35; int post[N]; int level[N]; int n; int k; void df 阅读全文
posted @ 2021-04-20 16:43 Dazzling! 阅读(160) 评论(0) 推荐(0) 编辑