首页
比赛
tracker
题库
课程
竞赛讨论区
登录
/
注册
去牛客
首页
>
while
12条解析
开通博客写题解
Leavery
发表于 2025-04-28 14:32:08
补完题 发一下个人题解 A 模拟 #include <iostream> using namespace std; int main() { string s, t = "while"; cin>>s; int cnt = 0; for (int i=0;
展开全文
可爱抱抱呀😥
发表于 2025-04-28 22:33:39
D~F Java题解,代码已去除冗余~~~ D 数组4.0 容易观察到,连续至少两种数字的集合,点与点之间可以相互到达,因为可以利用相邻的数字作为桥;连续一种数字,则需要组内数字连边至少成树;;而以上的组之间需要至少连边成树,时间复杂度(Tnlogn) import java.util.*; pub
展开全文
shanzhi7
发表于 2025-05-01 04:04:29
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 5; vector a; vector pre; unordered_map<int, int> me; int root(int x)
展开全文
shanzhi7
发表于 2025-05-01 04:06:01
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 5; vector<int> a; v
展开全文
牛客732405425号
发表于 2025-12-14 16:22:07
n=input() b=['w','h','i','l','e'] count=0 for i in range(5): if n[i] not in b[i]: count+=1 print(count)
涂图被offer砸中
发表于 2026-01-16 01:17:32
import java.util.Scanner; // 注意类名必须为 Main, 不要有任何 package xxx 信息 public class Main { public static void main(String[] args) { Scanner sc =
展开全文
_苏格拉底_
发表于 2025-11-25 20:59:05
#include<iostream> using namespace std; int main(){ string s; cin >> s; int times=0; if(s[0]!='w')times++; if(s[1]!='h
展开全文
FuTCodKing
发表于 2026-03-13 19:43:44
#include <iostream> using namespace std; int main() { string str; cin>>str; string s="while"; int cnt=0; fo
展开全文
霜山雨迟
发表于 2026-01-29 14:37:38
#include <iostream> #include <string> using namespace std; int main() { string s1; cin >> s1; string s2 = "whil
展开全文
While1729
发表于 2025-11-20 22:51:32
#include <stdio.h> #include<string.h> int main() { char target[]="while"; char input[6]; scanf("%5s",input
展开全文
查看本题
查看本题讨论
相关比赛
108038-牛客周赛 Round 91
进入比赛
108697-牛客周赛91内测
进入比赛
116521-NJIT算法启程赛-day2
进入比赛
119686-江西农业大学2025招新练习题5
进入比赛
122191-uit第一次机试考核
进入比赛
等你来战
查看全部
牛客小白月赛130
报名截止时间:2026-03-20 21:00
CACPC - 环海岸线联盟联合校赛决赛(同步赛)
报名截止时间:2026-03-21 18:00
2026年山东大学(威海)程序设计新星赛(同步赛)
报名截止时间:2026-03-21 18:00
2026 年中国传媒大学程序设计大赛(同步赛)
报名截止时间:2026-03-21 17:00
蓝桥杯多校模拟赛
报名截止时间:2026-03-21 18:00
第二十二届西南科技大学ACM程序设计竞赛(同步赛)
报名截止时间:2026-03-22 17:30
牛客周赛 Round 136
报名截止时间:2026-03-22 21:00
“⌬杯”蓝桥杯大赛省赛模拟赛
报名截止时间:2026-03-29 17:00
扫描二维码,关注牛客
意见反馈
下载牛客APP,随时随地刷题