HDU 5095 Linearization of the kernel functions in SVM(模拟)
来源:互联网 发布:软件项目计划书 编辑:程序博客网 时间:2024/04/30 20:24
题目:Linearization of the kernel functions in SVM
题意:意思不难懂,就是每次读10个数字,依次作为pqruvwxyz的系数,最后一个数字是常数,然后将表达式输出。
这个题目就是细节比较多。
当系数为0时,就不用输出对应的变量。
当变量的系数为1或-1时,1要省略,但是常数的-1和1是不能省略1的。
再者就是当所有系数都是0时,要保留常数0。
#include<cstdio>#include<cstring>int T, a[10];char s[20]="pqruvwxyz";int main(){scanf("%d", &T);while(T--){for(int i=0;i<10; i++)scanf("%d", a+i);bool flag = 0;for(int i=0;i<10; i++){if(a[i]){if(flag && a[i]>0)putchar('+');flag = 1;if(i<9){if(a[i]>0){if(a[i]!=1)printf("%d",a[i]);}else{if(a[i]!=-1)printf("%d",a[i]);elseputchar('-');}putchar(s[i]);}elseprintf("%d",a[i]);}}if(!flag)putchar('0');puts("");}return 0;}
0 0
- hdu 5095 Linearization of the kernel functions in SVM(模拟)
- HDU 5095--Linearization of the kernel functions in SVM【模拟】
- HDU 5095 Linearization of the kernel functions in SVM【模拟】
- HDU 5095 Linearization of the kernel functions in SVM(模拟)
- HDU 5095 Linearization of the kernel functions in SVM(模拟, 水题)
- HDU 5095 Linearization of the kernel functions in SVM(模拟)
- hdu 5095 Linearization of the kernel functions in SVM(模拟)
- hdu 5095 Linearization of the kernel functions in SVM(模拟)
- hdoj 5095 Linearization of the kernel functions in SVM 【模拟】
- HDU5095 Linearization of the kernel functions in SVM(模拟)
- 【瞎搞】 HDU 5095 Linearization of the kernel functions in SVM
- hdu 5095 Linearization of the kernel functions in SVM(水题)
- HDU 5095 - Linearization of the kernel functions in SVM
- HDU 5095 Linearization of the kernel functions in SVM
- HDU 5095 Linearization of the kernel functions in SVM
- hdu 5095 Linearization of the kernel functions in SVM (简单模拟)
- HDU 5095Linearization of the kernel functions in SVM(水题)
- HDU 5095 Linearization of the kernel functions in SVM (上海邀请赛水题)
- 老师,请不要这样讲中国
- android 判断登录是否邮箱或手机号
- Problem A Forever 0.5(推理构造)
- Review of Codeforces 6B and 6C
- 第十二周上机项目三
- HDU 5095 Linearization of the kernel functions in SVM(模拟)
- POJ 2406--Power Strings(kmp算法)
- 实验四
- hdu 5104 Primes Problem(数学)
- Objective-C基础笔记(4)Category
- JAVA的反射机制与动态代理
- LeetCode - Text Justification 题解
- ASP.NET动态网站开发培训-24.论文管理系统(四、制作Login页面和后台论文管理主页)
- 2014.11.15