比较坑的水题,首项前面的符号,-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. js读取excel中日期格式转换问题

    在使用js-xlsx插件来读取excel时,会将2018/10/16这种数据自动装换成48264.12584511. 所以需要自己手动再转换回来 // excel读取2018/01/01这种时间格式是 ...

  2. Mac下安装rJava,xlsx,ReporteRs包

    xlsx包可以用来读取excel数据,ReporteRs包可以用来直接输出word报告,这两个包都对rJava包有依赖,所以必须先安装rJava. (1)查看mac的java信息 java版本: &g ...

  3. Lightoj1028【计算约数个数】

    思路: 最终就是求一个数的约数(除了1)对吧. 然后想要枚举sqrt(N)受阻,枚举素数数组受阻,加上prime[i]*prime[i]<=n就好了?那就好了吧. #include <bi ...

  4. 洛谷P4768 [NOI2018]归程(克鲁斯卡尔重构树+最短路)

    传送门 前置技能,克鲁斯卡尔重构树 我们按道路的高度建一个最大生成树,然后建好克鲁斯卡尔重构树 那么我们需要知道一颗子树内到1点距离最近是多少(除此之外到子树内任何一个点都不需要代价) 可以一开始直接 ...

  5. values.xml:3:5-58:857: AAPT: error: resource android:attr/fontVariationSettings not found.

    修改app/build.gradle中的版本 compileSdkVersion 28 targetSdkVersion 28 具体不知道为何要修改为28,但在android/build.gradle ...

  6. 关于idea的快捷键提示

    IntelliJ Idea 常用快捷键列表 Ctrl+Shift + Enter,语句完成“!”,否定完成,输入表达式时按 “!”键Ctrl+E,最近的文件Ctrl+Shift+E,最近更改的文件Sh ...

  7. CF914D Bash and a Tough Math Puzzle 线段树+gcd??奇怪而精妙

    嗯~~,好题... 用线段树维护区间gcd,按如下法则递归:(记题目中猜测的那个数为x,改动次数为tot) 1.若子区间的gcd是x的倍数,不递归: 2.若子区间的gcd是x的倍数,且没有递归到叶子结 ...

  8. 微软官方NET Core 2.0

    NET Core 2.0 微软官方发布的.NET Core 2.0相关的博客: Announcing .NET Standard 2.0 Announcing .NET Core 2.0 F# and ...

  9. scrapy-redis 分布式哔哩哔哩网站用户爬虫

    scrapy里面,对每次请求的url都有一个指纹,这个指纹就是判断url是否被请求过的.默认是开启指纹即一个URL请求一次.如果我们使用分布式在多台机上面爬取数据,为了让爬虫的数据不重复,我们也需要一 ...

  10. jsfiddle.net上的记录

    1.JQuery: http://jsfiddle.net/uryc1908/ 2.e-chart: http://jsfiddle.net/8fq96a7s/ 3.easyUI http://jsf ...