摘要:
题意:输入一个n(2<=n<=79) 找出是否从存在abcde/fghij=n的表达式 直接枚举,对于每一个fghij,判断abcde,所有数字不相等就可以(每个数字都出现),但要注意枚举的范围,还有格式,格式真的头疼。 代码如下 #include <bits/stdc++.h> #define i 阅读全文
摘要:
https://ac.nowcoder.com/acm/contest/3003/D 牛牛得到了一个平面,这个平面上有 n 个不重合的点,第 i 个点的坐标为 (xi,yi) 牛牛想知道,这 n 个点形成的三角形中,总共有多少个钝角三角形。 题意:给n个点的坐标,判断有多少个钝角三角形,直接暴力每个 阅读全文
摘要:
链接:https://ac.nowcoder.com/acm/contest/3002/G题目描述 eli拿到了一个仅由小写字母组成的字符串。 她想截取一段连续子串,这个子串包含至少 个相同的某个字母。 她想知道,子串的长度最小值是多少? 题意 相当于就是找字符串当中拥有k个相同字母的最小长度。 直 阅读全文
摘要:
题意是给个a,b,求(a^c)&(b^c)的最小值,最小值最小为0,也就是求让式子的值为0的c 通过神奇的位运算知识,得到c=a&b,但题目中要求c是非0的,特判一下当a&b=0,c=1; 代码如下 int t; cin>>t; while(t--) { ll a,b; cin>>a>>b; ll 阅读全文
摘要:
Now, here is a fuction: F(x) = 6 * x^7+8*x^6+7*x^3+5*x^2-y*x (0 <= x <=100)Can you find the minimum value when x is between 0 and 100. 题意,输入一个y,然后确定这个 阅读全文
摘要:
Alice and Bob are playing a game with nn piles of stones. It is guaranteed that nn is an even number. The ii-th pile has aiai stones. Alice and Bob wi 阅读全文
摘要:
You are given an array a1,a2,…,ana1,a2,…,an. In one operation you can choose two elements aiai and ajaj (i≠ji≠j) and decrease each of them by one. You 阅读全文
摘要:
给出n条路线公交车的到达时间以及发车间隔时间,路线编号为1~n,Alice在t时刻到达,求她最早可以上哪班车。Input第一行输入路线数n和Alice到达的时间t n,t(1≤n≤100,1≤t≤10e5) 接下来n行,每行两个数字s和d(1≤s,d≤1e5),分别为该条路线首辆车到达的时间和两辆车 阅读全文