上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 67 下一页
摘要: 身份证号必须是 \(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) 编辑
摘要: $BFS$水题~。 const int N=1e5+10; vector<int> g[N]; int din[N]; int dist[N]; int n; int idx; void bfs(int st) { queue<int> q; q.push(st); dist[st]=0; whil 阅读全文
posted @ 2021-04-19 20:04 Dazzling! 阅读(60) 评论(0) 推荐(0) 编辑
摘要: $DFS$水题~。 注意边界$case$:只有一个节点且是得道者。 const int N=1e5+10; vector<int> g[N]; double expand[N]; int n; double m,r; double sum; void dfs(int u,double power) 阅读全文
posted @ 2021-04-19 19:55 Dazzling! 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 5717. 最少操作使数组递增 签到题,每个数至少比前一个数的数值大一,即可满足严格递增。 class Solution { public: int minOperations(vector<int>& nums) { int res=0; for(int i=1;i<nums.size();i++ 阅读全文
posted @ 2021-04-19 19:07 Dazzling! 阅读(39) 评论(0) 推荐(0) 编辑
摘要: 水题~。 const int N=10010; struct Node { string name; int grade; int rank; bool operator<(const Node &W) const { if(grade != W.grade) return grade > W.gr 阅读全文
posted @ 2021-04-19 15:23 Dazzling! 阅读(60) 评论(0) 推荐(0) 编辑
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 67 下一页