
思维题
文章平均质量分 50
兔兔不爱吃萝卜
知识体系在逐步扩展中 *.*
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
1140:验证子串(字符串查找函数)
1140:验证子串时间限制: 1000 ms 内存限制: 65536 KB提交数: 30032 通过数: 14372【题目描述】输入两个字符串,验证其中一个串是否为另一个串的子串。【输入】输入两个字符串, 每个字符串占一行,长度不超过200且不含空格。【输出】若第一个串s1是第二个串s2的子串,则输出(s1) is substring of (s2)否则,若第二个串s2是第一个串s1的子串,输出(s2) is substring of (s1)否则,输出 No s原创 2022-02-28 22:04:01 · 758 阅读 · 0 评论 -
补码(牛客)
链接:https://ac.nowcoder.com/acm/contest/27740/F来源:牛客网#include <bits/stdc++.h>using namespace std;int main(){ int t; cin>>t; while(t--) { int x; cin>>x; for(int i=31;i>=0;i--) cout<<(x>>i&1); puts("").原创 2022-02-14 23:58:02 · 279 阅读 · 0 评论 -
小沙的痛苦(思维题)
链接:https://ac.nowcoder.com/acm/contest/27740/G来源:牛客网正确代码:#include <bits/stdc++.h>using namespace std;const int N=1e6+10;int a[N];int n,p;int main(){ scanf("%d%d",&n,&p); for(int i=0;i<n;i++) { scanf("%d",&a[i]); a[i]=a原创 2022-02-14 22:29:16 · 265 阅读 · 0 评论 -
(牛客)BFS
最开始的错误代码:(提交的编译器说是段错误,咱也不懂,呜呜呜呜)#include<cstdio>#include<cstring>#include<algorithm>#include<cmath>#include<iostream>#include<queue>#include<map>#include<vector>using namespace std;//typedef long l.原创 2021-09-20 15:14:10 · 148 阅读 · 0 评论 -
C. Registration system(map)
C. Registration systemtime limit per test5 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputA new e-mail service “Berlandesk” is going to be opened in Berland in the near future. The site administration wants to launch t原创 2021-09-11 11:59:10 · 160 阅读 · 0 评论 -
B. Moamen and k-subarrays(codeforce+二分查找)
B. Moamen and k-subarraystime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMoamen has an array of n distinct integers. He wants to sort that array in non-decreasing order by doing the following opera原创 2021-08-14 08:40:18 · 232 阅读 · 0 评论 -
A. Theatre Square(codefore)
A. Theatre Squaretime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputTheatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On the occasion of the city’s anniv原创 2021-08-13 15:51:19 · 324 阅读 · 0 评论