比较坑的水题,首项前面的符号,-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. dialog 设置maxHeight 最大高度

    WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);Displ ...

  2. c#实现最简快速排序,你绝对可以看懂

    原创文章,转载请注明出处 算法对于程序员的重要性不言而喻,今天我和大家分享算法中的一个基础算法,快速排序.作为一名程序员,相信大家都不陌生,但是要大家徒手一次性写出来,我估计还是有难度的.那么废话不多 ...

  3. poj3164(最小树形图&朱刘算法模板)

    题目链接:http://poj.org/problem?id=3164 题意:第一行为n, m,接下来n行为n个点的二维坐标, 再接下来m行每行输入两个数u, v,表点u到点v是单向可达的,求这个有向 ...

  4. CodeForces - 820

    Mister B and Book ReadingCodeForces - 820A 题意:C,V0,V1,A,L..总共有C页书,第一天以V0速度读,每天加A,但是不能超过V1,并且要从前一天的看到 ...

  5. 剑指Offer的学习笔记(C#篇)-- 链表中倒数第K个点

    题目描述 输入一个链表,输出该链表中倒数第k个结点. 一 . 数据结构基础概念普及(线性表). 线性表可分为顺序表与链表,它们是堆栈.队列.树.图等数据结构的实现基础. 顺序表,线性表的顺序存储结构是 ...

  6. 剑指Offer的学习笔记(C#篇)-- 跳台阶

    题目描述 一只青蛙一次可以跳上1级台阶,也可以跳上2级.求该青蛙跳上一个n级的台阶总共有多少种跳法(先后次序不同算不同的结果). 一 . 解题思路. 由题目可知,青蛙一次可以跳一阶或者两阶.假设台阶为 ...

  7. ELK系列(1) - Elasticsearch + Logstash + Kibana + Log4j2快速入门与搭建用例

    前言 最近公司分了个ELK相关的任务给我,在一边学习一边工作之余,总结下这些天来的学习历程和踩坑记录. 首先介绍下使用ELK的项目背景:在项目的数据库里有个表用来存储消息队列的消费日志,这些日志用于开 ...

  8. CC38:第k个数

    题目 有一些数的素因子只有3.5.7,请设计一个算法,找出其中的第k个数. 给定一个数int k,请返回第k个数.保证k小于等于100. 测试样例: 3 返回:7 解法 主要就是在于isPrime这个 ...

  9. BZOJ 4551: [Tjoi2016&Heoi2016]树 并查集(&&图论?)

    反向操作,先把所有的标记都打上(记得统计标记的数目),然后依次撤销,合并到自己的上一个点pre,即fa[u]=getf(pre[u]) #include<cstdio> #include& ...

  10. bzoj4650: [Noi2016]优秀的拆分 hash

    好气啊,没开longlong又biubiu了 底层: 用hash或者奇奇怪怪的算法兹磁logn求最长公共前后缀 思路: 统计出从一个点开始和结束的形如AA的子串的个数 统计的时候把相邻的结果相乘加起来 ...