2021-01-26

这是某大学的训练题,别骂别骂
我先用来交一下作业,吓吓人

day1

问题 A: A+B Problem

问题描述

计算a+b的值。

输入

两个整数 a,b (0<=a,b<=10)

输出

输出 a+b

样例输入

1 2

样例输出

3

#include <stdio.h>

int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    printf("%d",a+b);
    return 0;
}

问题 B: 求和问题

问题描述

给定正整数n,你需要输出SUM(n) = 1 + 2 + 3 + … + n。

输入

输入一个正整数n(n<=10,000),含义如上所示。

输出

输出一个正整数SUM(n) = 1 + 2 + 3 + … + n。

样例输入

100

样例输出

5050

#include<stdio.h>
int main()
{
    int a,i,sum;
    sum=0;
    scanf("%d",&a);
    for(i=1;i<=a;i++)
        sum=sum+i;
    printf("%d",sum);
    return 0;
}

问题 C: 高精A+B

题目描述

输入A和B,计算A+B的值

输入

两行数据,分别是A和B
0<=A<=1E200
0<=B<=10^200

输出

A+B的结果

样例输入

1
1

样例输出

2

#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    char a1[100],b1[100];
    int a[100],b[100],c[100],lena,lenb,lenc,i,x;
    memset(a,0,sizeof(a));
    memset(b,0,sizeof(b));
    memset(c,0,sizeof(c));
    gets(a1);
    gets(b1);
    lena=strlen(a1);
    lenb=strlen(b1);
    for(i=0;i<=lena-1;i++)
        a[lena-i]=a1[i]-48;
    for(i=0;i<=lenb-1;i++)
        b[lenb-i]=b1[i]-48;
    lenc=1;
    x=0;
    while(lenc<=lena||lenc<=lenb){
        c[lenc]=a[lenc]+b[lenc]+x;
        x=c[lenc]/10;
        c[lenc]%=10;
        lenc++;
    }
    c[lenc]=x;
    if(c[lenc]==0)
        lenc--;
    for(i=lenc;i>=1;i--)
        cout<<c[i];
    cout<<endl;
    return 0;

}

问题D:最大子段和(SEQ)

贪心算法

题目描述

老师给笑笑布置了一份的作业,笑笑不知如何解决,找你帮忙解决。
老师给了一串很长的数列,要求从中找出连续的一段来使得总和最大。

输入

文件中第一行包括一个整数N,表示数列长度为N(N <= 100000)。
第二行包括N个整数来描述这个数列,每个整数的绝对值不超过1000。

输出

文件中只有一个整数,为最大的连续段总和。

样例输入

5
1 -2 3 1 -4

样例输出

4

问题 E: Let the Balloon Rise

题目描述

Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges’ favorite time is guessing the most popular problem. When the contest is over, they will count the balloons of each color and find the result.
This year, they decide to leave this lovely job to you.

输入

Input contains only one case. Starts with a number N (0 < N <= 1000) – the total number of balloons distributed. The next N lines contain one color each. The color of a balloon is a string of up to 15 lower-case letters.

输出

Print the color of balloon for the most popular problem on a single line. It is guaranteed that there is a unique solution.

样例输入

5
green
red
blue
red
red

样例输出

red

问题 F: Number Sequence

题目描述

此题HDUOJ数据过水,网上题解中直接将n%49的做法是错误的。
A number sequence is defined as follows:
f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.
Given A, B, and n, you are to calculate the value of f(n).

输入

The input consists of multiple test cases. Each test case contains 3 integers A, B and n on a single line (1 <= A, B <= 1000, 1 <= n <= 100,000,000). Three zeros signal the end of input and this test case is not to be processed.

输出

For each test case, print the value of f(n) on a single line.

样例输入

1 1 3
1 2 10
0 0 0

样例输出

2
5

问题 G: 最高位

题目描述

给定一个正整数n,输出n的n次方的最高位。

输入

本题为多组数据。
第一行一个整数T(T<=100),表示数据组数。
接下来T行,每行输入一个正整数n(n<=1,000,000,000),含义如上所示。

输出

对于第i组数据,在第i行输出一个0~9的整数,表示n的n次方的最高位。

样例输入

2
3
4

样例输出

2
2

问题 H: 最低位

问题描述

给定一个正整数n,输出n的n次方的最低位。

输入

本题为多组数据。
第一行一个整数T(T<=100),表示数据组数。
接下来T行,每行输入一个正整数n(n<=1,000,000,000),含义如上所示。

输出

对于第i组数据,在第i行输出一个0~9的整数,表示n的n次方的最低位。

样例输入

2
3
4

样例输出

7
6

问题 I: Text Reverse

问题描述

Ignatius likes to write words in reverse way. Given a single line of text which is written by Ignatius, you should reverse all the words and then output them.

输入

The input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow.
Each test case contains a single line with several words. There will be at most 1000 characters in a line.

输出

For each test case, you should output the text which is processed.

样例输入

3
olleh !dlrow
m’I morf .uzz
I ekil .mca

样例输出

hello world!
I’m from zzu.
I like acm.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
2021-03-26 20:54:33,596 - Model - INFO - Epoch 1 (1/200): 2021-03-26 20:57:40,380 - Model - INFO - Train Instance Accuracy: 0.571037 2021-03-26 20:58:16,623 - Model - INFO - Test Instance Accuracy: 0.718528, Class Accuracy: 0.627357 2021-03-26 20:58:16,623 - Model - INFO - Best Instance Accuracy: 0.718528, Class Accuracy: 0.627357 2021-03-26 20:58:16,623 - Model - INFO - Save model... 2021-03-26 20:58:16,623 - Model - INFO - Saving at log/classification/pointnet2_msg_normals/checkpoints/best_model.pth 2021-03-26 20:58:16,698 - Model - INFO - Epoch 2 (2/200): 2021-03-26 21:01:26,685 - Model - INFO - Train Instance Accuracy: 0.727947 2021-03-26 21:02:03,642 - Model - INFO - Test Instance Accuracy: 0.790858, Class Accuracy: 0.702316 2021-03-26 21:02:03,642 - Model - INFO - Best Instance Accuracy: 0.790858, Class Accuracy: 0.702316 2021-03-26 21:02:03,642 - Model - INFO - Save model... 2021-03-26 21:02:03,643 - Model - INFO - Saving at log/classification/pointnet2_msg_normals/checkpoints/best_model.pth 2021-03-26 21:02:03,746 - Model - INFO - Epoch 3 (3/200): 2021-03-26 21:05:15,349 - Model - INFO - Train Instance Accuracy: 0.781606 2021-03-26 21:05:51,538 - Model - INFO - Test Instance Accuracy: 0.803641, Class Accuracy: 0.738575 2021-03-26 21:05:51,538 - Model - INFO - Best Instance Accuracy: 0.803641, Class Accuracy: 0.738575 2021-03-26 21:05:51,539 - Model - INFO - Save model... 2021-03-26 21:05:51,539 - Model - INFO - Saving at log/classification/pointnet2_msg_normals/checkpoints/best_model.pth 我有类似于这样的一段txt文件,请你帮我写一段代码来可视化这些训练结果
最新发布
02-06

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值