8.3

· · 个人记录

卧的总结

这篇文章特别的水

未满126913467789岁🚫看

牢屎泰老6啦,让我们写文章!!!!!

错题修改

1.B2066 救援

错误原因

牢屎出的
不会

思路

x_{2}+y_{2}=距离

贞雀代码

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    double sum=0;
    for(int i=1;i<=n;i++)
    {
        double a,b;
        cin>>a>>b;
        int f;
        cin>>f;
        sum+=sqrt(a*a+b*b)/50*2+f*1.5;
    }
    cout<<int(ceil(sum));

   return 0;
}

2.P8813 [CSP-J 2022] 乘方

错误原因

牢屎出的 不会

思路

I a==1
  输出1
II
  1.sum>1e9
      输出-1
  2.sum!=1e9
      输出sum

真确代码

#include<bits/stdc++.h>
using namespace std;

int main()
{
    long long a,b;
    cin>>a>>b;
    if(a==1)cout<<1;
    else 
    {
        long long sum=1;
        for(int i=1;i<=b;i++)
        {
            sum*=a;
            if(sum>1e9)
            {
                cout<<"-1";
                return 0;
            }

        }
        cout<<sum;
    }
    return 0;
}

3.2108 图像模糊处理

错误原因

牢屎没交

round不知道

函数写错啦!!

贞雀代码

#include<bits/stdc++.h>
using namespace std;
int a[110][110];

int main()
{
    int m,n;
    cin>>m>>n;
    for(int i=1;i<=m;i++)
    {
        for(int j=1;j<=n;j++)
        {
            cin>>a[i][j];
        }
    }

    for(int i=1;i<=m;i++)
    {

        for(int j=1;j<=n;j++)
        {
            if(i==1||j==1||i==m||j==n)
            {
                cout<<a[i][j]<<" ";
            }
            else 
            {
                double ans=a[i-1][j]+a[i+1][j]+a[i][j-1]+a[i][j+1]+a[i][j];



                cout<<round(ans/5)<<" ";
            }
        }
        cout<<endl;
    }
    return 0;
}

4.「MXOI Round 1」宝箱

错误原因

牢屎出的 不会

死路

min(0->a->b,0->b->a);

真确垈马

#include<bits/stdc++.h>
using namespace std;

int main()
{
    int a,b;

    cin>>a>>b;
    cout<<min(abs(a)+abs(b-a),abs(b)+abs(b-a));
    return 0;
}

5.P1803 凌乱的yyy / 线段覆盖

错误原因

牢屎出的 不会

真确垈马

6.[NOIP 2004 提高组] 合并果子

错误原因

司炉

priority_queue<int,vector<int>,greater<int>>q;

贞雀代码

#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    cin>>n;
    priority_queue<int,vector<int>,greater<int>>q;
    while(n--)
    {
        int x;
        cin>>x;
        q.push(x);
    }
    int res=0;
    while(q.size()>1)
    {
        int a=q.top();
        q.pop();
        int b=q.top();
        q.pop();
        res+=a+b;
        q.push(a+b);
    }
    cout<<res;
    return 0;
}

牢屎泰老6啦,让我们写文章!!!!!

老屎🧑‍🏫肥肠聪明(✔️)

老屎🧑‍🏫是个大帅哥(❌)

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

看到的是家住┏┛墓┗┓

不是的

|

|

|

https://www.luogu.com.cn/paste/asbfig58

a

a

a

a