第二次考核遭遇人生第一次爆零,总结下来那场比赛有以下做的不好的地方,以及我的缺陷:
一.太浪了,比赛是踩点到场的,一开始便没有进入状态
二.思维上走了很多弯路,之前那些微不足道的经验在作祟,经验不够丰厚,缺练
三.死磕两道题,其他题没有认真看,觉得这两道迟早写出来其他的题就没有多加思考
不找借口,其他直接从题目上分析(太丢人了题目链接就不发了)
//其实这个题面表达非常不清晰,管理员给出的数字,是按顺序给涛神和小钢的。
//即:管理员给出10,
//那么涛神头脑中闪现出的是“1”
//同时小钢头脑中闪现的是“0”,
//然后让他们两个猜一下,10这个数字。
//涛神 获得第一位数字,他只需要猜第二位上面的数字即可。
//小钢获得的是第二位数字,他也只需要猜第一位的数字.
//思路:思维,一个人说出的答案的俩个数字与自己的数字一样,另外一个人说出的答案与自己的数字不
//一样即可,所以是百分百通关。
#include <iostream>
using namespace std;
int main()
{
cout << "1.00" << endl << "1.00" << endl << "1.00" << endl << "1.00" << endl;
return 0;
}
//总结:题目没说清楚也没啥办法
//两种思路,第二种运行时间长,但是远达不到超时
//第一种:普通做法,不能兑换作为循环终止条件
#include <stdio.h>
int main()
{
int t;
scanf("%d", &t);
while (t--)
{
int n, a, b, c, d, sum;
scanf("%d", &n);
a = b = sum = n;
while (a >= 3 || b >= 4)
{
c = a / 3;
d = b / 4;
sum += c + d;
a = a % 3 + c + d;
b = b % 4 + c + d;
}
printf("%d\n", sum);
}
return 0;
}
//第二种思路,好兄弟想出来的,把兑换了的饮料数往总数上加
//总数作为循环的条件
//思路很奇妙,所以记录下来了
#include<stdio.h>
int main()
{
int t;
long long n;
scanf("%d", &t);
for (int i = 0; i < t; i++) {
scanf("%lld", &n);
for (int j = 1; j <= n; j++) {
if (j % 3 == 0) {
n = n + 1;
}
if (j % 4 == 0) {
n = n + 1;
}
}
printf("%lld\n", n);
}
return 0;
}
//总结:受之前做过的一题的影响,觉得两个空瓶时能借一个,导致一直死磕,推不出来
//纯脑抽,像是有那个大病。。。
//思路:贪心,计算平均每个老师的最小学生数, 再一一枚举各种情况,取最小值即可。
#include <iostream>
using namespace std;
typedef long long ll;
ll n;
ll min(ll x, ll y)
{
return (x < y) ? x : y;
}
int main()
{
int t;
cin >> t;
while (t--)
{
ll x, y, sum = 0;
cin >> n >> x >> y;
if (3 * x < 2 * y)
{
sum = n / 2 * x;
if (n % 2) sum = min(sum + min(x, y), sum - x + y);
}
else
{
sum = n / 3 * y;
if (n % 3 == 2) sum += min(x, y);
if (n % 3 == 1) sum = min(sum + min(x, y), sum - y + 2 * x);
}
cout << sum << endl;
}
}
//当时还没学贪心,估计考场上半天出不来思路
//结构体排序,没啥好说的
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
const int N = 30010;
int n, sum;
struct node
{
string a;
int b, c, d, w;
}g[N];
bool cmp(node x, node y)
{
if (x.w == y.w)
return x.a < y.a;
else
return x.w > y.w;
}
int main()
{
int t;
cin >> t;
sum = 0;
for (int i = 1; i <= t; i++)
{
cin >> n;
for (int j = 0; j < n; j++)
{
cin >> g[sum + j].a >> g[sum + j].w;
g[sum + j].c = i;
}
sort(g + sum, g + sum + n, cmp);
g[sum].d = 1;
for (int j = 1; j < n; j++)
{
if (g[sum + j].w == g[sum + j - 1].w)
{
g[sum + j].d = g[sum + j - 1].d;
}
else
{
g[sum + j].d = j + 1;
}
}
sum += n;
}
sort(g, g + sum, cmp);
g[0].b = 1;
for (int i = 1; i < sum; i++)
{
if (g[i].w == g[i - 1].w)
{
g[i].b = g[i - 1].b;
}
else
{
g[i].b = i + 1;
}
}
cout << sum << endl;
for (int i = 0; i < sum; i++)
{
cout << g[i].a;
cout << ' ' << g[i].b << ' ' << g[i].c << ' ' << g[i].d << endl;
}
return 0;
}
//当时觉得死磕能a出来,事实上不用死磕也能不到20分钟a出来
//考场上总觉得自己总排名排序那块搞不出来
//也是因为自己犯病,脑子不灵光
//简单题,把四个字符分为w和a,n,g两部分,比较个数的最小值
#include <iostream>
#include <string>
using namespace std;
int main()
{
string str;
int len;
scanf("%d", &len);
cin >> str;
int w, a, n, g;
w = a = n = g = 0;
for (int i = 0; i < len; i++) {
if (str[i] == 'w') w++;
if (str[i] == 'a') a++;
if (str[i] == 'n') n++;
if (str[i] == 'g') g++;
}
int ans;
if (w * 2 < min(min(a, n), g))
ans = w * 2;
else
ans = min(min(a, n), g);
printf("%d\n", ans);
return 0;
}
//因为死磕上面说的那两题而错过的简单题
//再次抽死自己,没话说
//思路:数学思维,把等式两边平方,发现a,b的乘积要是一个完全平方数,对于每个n,累加满足条件
//的个数。(注意:当a等于b是只能算一个解)
#include<iostream>
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
int main()
{
int n, ans = 0;
cin >> n;
for (int i = 1; i * i <= n; i++)
{
for (int j = 1; j * j <= i * i; j++)
{
if ((i * i) % j == 0)
{
if (j * j == (i * i))
ans++;
else ans += 2;
}
}
}
cout << ans << endl;
return 0;
}
//也是因为就看了一眼,唉,不想多说
以上就是按道理来说考场上就要a出来的题目。
这次爆零是一次惨痛的教训,以后类似的低级错误不准再发生