HDU 5095 Linearization of the kernel functions in SVM (坑水)
比较坑的水题,首项前面的符号,-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 (坑水)的更多相关文章
- HDU 5095 Linearization of the kernel functions in SVM(模拟)
主题链接:http://acm.hdu.edu.cn/showproblem.php? pid=5095 Problem Description SVM(Support Vector Machine) ...
- 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). ...
- 模拟 HDOJ 5095 Linearization of the kernel functions in SVM
题目传送门 /* 题意:表达式转换 模拟:题目不难,也好理解题意,就是有坑!具体的看测试样例... */ #include <cstdio> #include <algorithm& ...
- Linearization of the kernel functions in SVM(多项式模拟)
Description SVM(Support Vector Machine)is an important classification tool, which has a wide range o ...
- 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: ...
- Kernel Functions for Machine Learning Applications
In recent years, Kernel methods have received major attention, particularly due to the increased pop ...
- SVM Kernel Functions
==================================================================== This article came from here. Th ...
- Kernel Functions-Introduction to SVM Kernel & Examples - DataFlair
Kernel Functions-Introduction to SVM Kernel & Examples - DataFlairhttps://data-flair.training/bl ...
- hdu 5095 多项式模拟+有坑
http://acm.hdu.edu.cn/showproblem.php?pid=5095 就是把ax^2 + by^2 + cy^2 + dxy + eyz + fzx + gx + hy + i ...
随机推荐
- CloseHandle()函数的使用
CloseHandle()函数的使用?? 很多程序在创建线程都这样写的:............ThreadHandle = CreateThread(NULL,0,.....);CloseHande ...
- SCUT - 205 - 饲养牛 - 最大流
https://scut.online/p/205 连着做所以一开始就觉得是网络流. 这种至多分配几次的很有网络流的特征. 一开始想从食物和饮料流向牛,但是怎么搞都不对. 其实可以从s流向食物,食物流 ...
- IT兄弟连 JavaWeb教程 创建异步请求对象
异步请求对象:XMLHttpRequest对象,通过该对象向服务器发送异步请求.它是异步请求的技术,所有的现代浏览器(IE7+.FireFox.Chrome.Safari以及Opera)都支持,老版本 ...
- C 语言实例 - 一元二次方程
C 语言实例 - 一元二次方程 求一元二次方程:ax2+bx+c= 的根. 输入三个实数a,b,c的值,且a不等于0. 实例 #include <stdio.h> #include < ...
- 初探 Nginx 架构
转载自:http://wiki.jikexueyuan.com/project/nginx/nginx-framework.html Nginx 在启动后,在 unix 系统中会以 daemon 的方 ...
- Mysql 的 增删改查
mysql的增删改查 1:新建数据库 create database 数据库名 [其他选项]; 2:新建数据表 create table students ( id int unsigned not ...
- 03.Jquery Mobile中的按钮
一. 基础按钮 1.设置链接的data-role,使其变成按钮. <a href="index.html" data-role="button">L ...
- Jmeter 的 vars 和 props 用法
meter 的 JSR223 控件是 代替 BeanShell 的新一代脚本控件,支持多种脚本语言,尤其是其中的 Groovy,更是重点推荐使用的脚本语言,本文研究其中的 vars 和 props 两 ...
- ERROR 1366 (HY000): Incorrect string value: '\xB3\xA4\xC9\xB3' for column
在用以下方法之前,请先执行下面命令查看. show variables like 'character%'; ——查看所有编码方式 show create table table_name; — ...
- 16.创建与操纵表--SQL
一.新建表 利用CREA TE TA BLE创建表,必须给出下列信息: 新表的名字,在关键字CREA TE TA BLE之后给出: 表列的名字和定义,用逗号分隔: 有的DBMS还要求指定表的位置. C ...