比较坑的水题,首项前面的符号,-1,+1,只有数字项的时候要输出0。

感受一下这些数据

16
0 0 0 0 0 0 0 0 0 -1
0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0
-1 0 0 0 0 0 0 0 0 0
-1 -1 -1 -41 -1 -1 -1 -1 -1 -1
-1 5 -2 0 0 0 0 0 0 0
1 1 1 1 1 1 1 1 1 1
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1
0 0 0 0 0 -1 -1 -1 -1 -1
0 0 0 0 0 1 1 1 1 1
1 1 1 1 1 0 0 0 0 0
-1 -1 -1 -1 -1 0 0 0 0 0
1 1 1 1 1 1 1 1 1 0
0 46 3 4 -5 -22 -8 -32 24 27
2 31 -5 0 0 12 0 0 -49 12

#include<cstdio>
#include<cstring>
#include<cmath>
char *bin = "pqruvwxyz";
typedef int ll; ll a[];
int flag;
void dfs(int d)
{
if(d == ) {
return;
}
if(a[d]){
if(std::abs(a[d]) == ){
if(a[d]>){
if(flag) printf("+");
printf("%c",bin[d]);
}
else printf("-%c",bin[d]);
}
else {
if(a[d]>){
if(flag) printf("+");
printf("%d%c",a[d],bin[d]); }else {
printf("%d%c",a[d],bin[d]);
}
}
flag = ; }
dfs(d+);
} int main()
{
int n;
scanf("%d",&n);
while(n--){
// memset(a,0,sizeof(a));
for(int i = ; i < ; i++)
scanf("%d",a+i);
flag = ;
dfs();
if(!flag){
printf("%d",a[]);
}
else {
if(a[]){
if(a[]>)
printf("+%d",a[]);
else
printf("%d",a[]);
}
}
printf("\n");
}
return ;
}

HDU 5095 Linearization of the kernel functions in SVM (坑水)的更多相关文章

  1. HDU 5095 Linearization of the kernel functions in SVM(模拟)

    主题链接:http://acm.hdu.edu.cn/showproblem.php? pid=5095 Problem Description SVM(Support Vector Machine) ...

  2. hdu 5095 Linearization of the kernel functions in SVM(模拟,分类清楚就行)

    题意: INPUT: The input of the first line is an integer T, which is the number of test data (T<120). ...

  3. 模拟 HDOJ 5095 Linearization of the kernel functions in SVM

    题目传送门 /* 题意:表达式转换 模拟:题目不难,也好理解题意,就是有坑!具体的看测试样例... */ #include <cstdio> #include <algorithm& ...

  4. Linearization of the kernel functions in SVM(多项式模拟)

    Description SVM(Support Vector Machine)is an important classification tool, which has a wide range o ...

  5. HDU 5095--Linearization of the kernel functions in SVM【模拟】

    Linearization of the kernel functions in SVM Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: ...

  6. Kernel Functions for Machine Learning Applications

    In recent years, Kernel methods have received major attention, particularly due to the increased pop ...

  7. SVM Kernel Functions

    ==================================================================== This article came from here. Th ...

  8. Kernel Functions-Introduction to SVM Kernel & Examples - DataFlair

    Kernel Functions-Introduction to SVM Kernel & Examples - DataFlairhttps://data-flair.training/bl ...

  9. hdu 5095 多项式模拟+有坑

    http://acm.hdu.edu.cn/showproblem.php?pid=5095 就是把ax^2 + by^2 + cy^2 + dxy + eyz + fzx + gx + hy + i ...

随机推荐

  1. JAVA学习笔记——(二)

    今日内容介绍 1.变量 2.运算符 01变量概述 * A: 什么是变量? * a: 变量是一个内存中的小盒子(小容器),容器是什么?生活中也有很多容器,例如水杯是容器,用来装载水:你家里的大衣柜是容器 ...

  2. 以交互方式将文本添加到图形中(matlab)

    这篇博客记录一下怎么用matlab在图形中简单的添加一些文本,以直方图均衡化为例.先看几张图片吧,第一幅是较暗的花粉的电子显微图像和对应的直方图,第二幅是其直方图均衡化的图像和对应的直方图,第三幅是对 ...

  3. update-alternatives --Install

    up vote 1 down vote favorite I typed: sudo update-alternatives --install "/usr/bin/java" & ...

  4. Tcp编程demo之三部曲

    下面的demo的目的是通过代码来快速的了解tcp编程的步骤 1首先呢,对InetAddress类简单了解其作用 public static void main(String[] args) throw ...

  5. [poj]开关类问题 枚举 位运算

    poj 1222  EXTENDED LIGHTS OUT 开关只有两种方案 按和不按,按两次相当于关 只用枚举第一排开关的按法即可,剩下的行为使上一排的灯全部关闭,按法可以确定,并且是唯一的. 最后 ...

  6. hdu1506 直方图中最大的矩形 单调栈入门

    hdu1506 直方图中最大的矩形 单调栈入门 直方图是由在公共基线对齐的矩形序列组成的多边形.矩形具有相同的宽度,但可能具有不同的高度.例如,左侧的数字显示了由高度为2,1,4,5,1,3,3的矩形 ...

  7. 解决phpwind 9 转换到 discuz x 3.1的头像仍然不显示问题

    phpwind 9 转换到 discuz x 3.1后,按照discuz转换程序的步骤做,头像仍然不显示,后来登录后重新上传头像发现,是文件名的原因,如下操作改名即可(还好我的论坛会员不多,不然手改累 ...

  8. 黑马旅游网 url-pattern不加斜杠报错 java.util.concurrent.ExecutioException: org.apache.catalina.LifecycleException

  9. [TCP/IP]ARP与RARP的总结

    一. 总述 简单的说,ARP协议就是将IP地址转换为MAC物理地址:而RARP,就是ARP的逆向,也就是将MAC物理地址转换为IP地址.看起来这两个协议是完全对称的,但发明这两个协议的初衷基本上没有什 ...

  10. 长春理工大学第十四届程序设计竞赛(重现赛)H.Arithmetic Sequence

    题意: 数竞选手小r最喜欢做的题型是数列大题,并且每一道都能得到满分. 你可能不相信,但其实他发现了一个结论:只要是数列,无论是给了通项还是给了递推式,无论定义多复杂,都可以被搞成等差数列.这样,只要 ...