【CodeForces】426Div2 A The Useless Toy

FY-3E GNSS-R海面高度反演:物理模型与机器学习残差学习实战 海面高度反演是卫星遥感的核心任务之一,其原理是通过分析导航卫星反射信号与直射信号的路径差来提取海面高度信息。传统几何物理模型在开阔大洋中表现良好,但在高海况、近岸等复杂条件下误差显著增大。机器学习,特别是残差学习,能够有效学习物理改正后的系统偏差,提升反演精度。该技术已应用于国产FY-3E卫星的GNSS-R数据,结合延迟多普勒图处理和物理约束特征工程,实现了分米级海面高度产品。本文以FY-3E为例,详细拆解从原始观测量到高精度产品的完整链路,涵盖数据预处理、特征构建、模型选型与业务化部署,为遥感反演工程师提 阅读详情

链接:http://codeforces.com/contest/834/problem/A

Solution:
很简单的整除判断
因为太久没有写过代码怕出问题,写得非常累赘(暴力)

#include<stdio.h>

int ch(char a)
{
	if (a=='^') return 1;
	if (a=='>') return 2;
	if (a=='v') return 3;
	if (a=='<') return 4;
}

 int main()
 {
 	char a,b;
 	int n,r1,r2,i,j,tms;
 	bool cw,ccw;
 	scanf("%c %c",&a,&b);
 	scanf("%d",&n);
 	r1=ch(a);r2=ch(b);
 	i=r1,j=r2;
 	tms=0;
 	while (i!=j)
 	{
 		tms++;
 		if (i++==4) i=1;
 	}
 	cw=(tms<=n) && (((n-tms)&3)==0);
 	i=r1,j=r2;
 	tms=0;
 	while (i!=j)
 	{
 		tms++;
 		if (i--==1) i=4;
 	}
 	ccw=(tms<=n) && (((n-tms)&3)==0);
 	if (cw^ccw) puts(cw?"cw":"ccw")	;
 	else puts("undefined");
 }
DCMM评估报告模板样例 这篇DCMM评估报告对某数据管理公司2020年的数据管理能力进行了全面分析。报告显示,该公司在数据战略方面取得初步进展,但在数据治理和数据架构方面仍存在明显不足,包括缺乏有效治理流程、数据质量监控不足,以及数据标准化和转换灵活性不足等问题。评估报告提出了针对性改进建议,包括完善数据战略、建立治理流程、加强质量监控和提升数据转换灵活性等,为提升数据管理成熟度提供了重要指导。 阅读详情

相关推荐

Vue3项目实战:集成h265webjs打造高性能Web端H.265播放器

本文详细介绍了如何在Vue3项目中集成h265webjs库,构建高性能的Web端H.265播放器。通过封装播放器管理模块、利用Vue3组合式API优雅管理生命周期,并提供了从环境准备、核心集成到进阶优化的完整实战指南,有效解决了浏览器原生不支持H.265解码的难题,显著降低视频流带宽占用。

weixin_29016833的博客 364

【Codeforces Round #426 (Div. 2) A】The Useless Toy

【Link】:http://codeforces.com/contest/834/problem/A 【Description】 【Solution】 开个大小为4的常量字符数组; +n然后余4,-n然后余4; 相同位置就不行; 否则 判断是哪一种方式到最后一个字符 (没有非法的情况,所以不用考虑两种方式都不是,可以看题目描述有说) 【...

AWCXV 102

SAP WMS开发实战:用BAPI_L_TO_CREATE_MULTIPLE搞定LT01转储单(附完整代码)

本文详细解析了SAP WMS开发中如何利用BAPI_L_TO_CREATE_MULTIPLE函数模块批量创建LT01转储单。文章深入剖析了核心参数、常见错误及实战代码框架,重点强调了源/目标存储类型等关键字段的获取方法,为系统集成与自动化流程开发提供了可靠的解决方案。

view3的博客 561

Codeforces Round #426 (Div. 2) A The Useless Toy

A. The Useless Toy time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard outputWalking through the streets of Marshmallow City, Slastyona have spotted so

NITjianbagengmu的博客 226

ADS(Arm Developer Suite)安装的坑!

实验课老师让我们区安装ADS,作为嵌入式开发的工具,原本以为这只是一个简单的软件,但是当我安装的时候,我才发现这软件太难了!安装了我大半天,看了其他的博客之后,最终才安装成功???????? 安装过程的一个巨坑就是:安装路径!以及安装许可注册文件 如果没有注意路径,最后安装成功以后打开软件就是蜜汁报错???? 报错了怎么办?删掉已安装的东西,重新安装吧,而且要删干净 再次安装的时候,打开安装包是这个提示...

weixin_42795819的博客 8220

stm32f103c8t6+esp8266在WiFi下通过手机控制外设

stm32f103c8t6+esp8266在WiFi下通过手机控制外设前言 前言 通过上一篇,介绍了esp8266的基本功能,这篇将用stm32c8t6配合esp8266进行数据交互,实现用手机通过无线的方式去控制外设、开关等;这里相当于把stm32作为上一篇的串口助手和esp8266进行通信; ...

weixin_45430735的博客 1万+

Codeforces Round #426 (Div. 2) A. The Useless Toy

题目链接:The Useless Toy题目大意:给你两个方向,然后给你一个n,问你是逆时针旋转n次从一个方向到第二个方向,还是顺时针旋转n次从一个方向到第二个方向,如果都可以或者都不可以,输出undefined题目思路:直接模拟就好#include <cstdio> #include <cmath> #include <cstring> #include <cstdlib> #include <i

Nemaleswang的博客 310

嵌入式设备系统日志记录及调试技巧_嵌入式日志系统(1),如何成为杰出的程序员

这里面我使用的芯片为哈弗体系,全局常量存储编译器默认分配在flash,需要注意如果使用片内flash时,注意存储调试等级的flash块不要与代码区重合,要不然修改调试等级擦除flash块同时PC指针指向当前块的代码区,会导致仪器死机;这个也是之前用的比较多的,以上代码是模仿linux 内核的写法,可以比较好的做到日志信息分层,编译时相加对应的编译开关即可。但有个弊端就是,切换debug等级时,需要重新编译且需更新固件,而嵌入式设备出现异常后更新固件往往复位后,故障有时很难复现,调试起来比较浪费时间。

2401_84240431的博客 1295

Codeforces Round #426 (Div. 2) A. The Useless Toy

A. The Useless Toy time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Walking through the streets of Marshmallow City

shyoldman的博客 268

C#实现跨域访问共享文件夹的账号密码验证方案

本文详细介绍了在C#中实现跨域访问共享文件夹的账号密码验证方案。通过调用Windows API LogonUser函数,结合LOGON32_LOGON_NEW_CREDENTIALS登录类型,可安全模拟指定用户身份,有效解决工作组与域环境间的文件共享访问难题。文章提供了完整的工具类封装、多种实战场景示例及详细的错误排查指南。

pea55的博客 541

基于线性约束最小方差准则(LCMV)的自适应波束形成算法的matlab仿真

波束形成(BeamForming)通过对多路麦克风(常为多路全向麦)信号进行合并,抑制非目标方向信号,增强目标方向信号;进而能够实现对特定方向的聚焦拾音,能够有效提高接收信号的信噪比,也有起到降噪的作用。基本原理是波的干涉:通过调整不同阵列单元信号之间的参数,使得某些角度的信号增强,而另一些角度的信号相互抵消,例如下图中来自±45°的输入信号未被增强,而在0度方向的输入信号同相位叠加后被增强。为了将窄带波束形成扩展至宽带,可以使用频域LCMV波束形成器。

平时工作较为繁忙,私信消息一般晚上回复,谢谢大家~~ 763

Codeforces Round #426 (Div. 2) A. The Useless Toy

A. The Useless Toy time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Walking through the streets of Marshm...

weixin_34088583的博客 102

《ATF(TF-A)专题精讲》目录——146篇,完整覆盖整个ATF的官方文档

本文摘要介绍了Trusted Firmware-A (TF-A)项目的技术文档体系。主要内容包括:项目概述、组件解析(如ARM RAS/RME/CCA等安全技术)、系统设计(启动流程、中断管理、信任链等)、开发指南(构建环境、移植策略)、性能分析、平台支持(涵盖NXP、Marvell、Xilinx等主流芯片厂商)、开发流程规范以及安全通告(CVE漏洞分析)。文档体系全面覆盖了ARM安全固件的技术实现、硬件适配和开发实践,为开发者提供了从理论到实践的完整参考。

Linux内核架构师 1115

Codeforces Round #426 (Div. 2)-A. The Useless Toy

题目:                                                  A. The Useless Toy                                                  time limit per test 1 second                                  

愚者 309

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Codeforces Round #426 (Div. 2)

Codeforces Round #426 (Div. 2) Codeforces Round #426 (Div. 2)A. The Useless ToyB. The Festive EveningC. The Meaningless Game A. The Useless Toy Walking through the streets of Marshmallow City...

weixin_34405925的博客 151

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

CodeForces - 426A. The Useless Toy

题意: 对于给出的方向经过n次旋转后,能否转成第二个方向,如果能输出顺时针还是逆时针旋转,如果不能或者两种方式都能转到就输出undefined。 思路: 直接模拟风车的旋转,然后判断即可。 #include using namespace std; int main() { char ni[8]={'v','>','^','','^','<',}; char sun[8]={'v','

blaze_jack 369

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

Codeforces Round #426 (Div. 2) The Useless Toy

题意:东南西北四个方向,每次转到上一个或者下一个位置。现在告诉你 转的次数 和 起点 终点 问你是经过顺时针得到的还是逆时针得到的。 思路:hash一下,然后算出起点顺时针和逆时针转n次的终点,判断一下关系就OVER了#include<bits/stdc++.h> using namespace std;int judge(char ch) // hash { if(ch=='^'

Haipai1998的博客 329

Codeforces Round #426 (Div. 2) The Useless Toy 数组环

The Useless Toytime limit per test 1 second memory limit per test 256 megabytes input standard input output standard outputWalking through the streets of Marshmallow City, Slastyona have spotted

? 221

CF Round #426 (Div. 2) The Useless Toy 思维 水题

  题目链接:http://codeforces.com/contest/834/problem/A   题目描述: 输入起始状态和结束状态和数列长度, 判断旋转方向是顺时针逆时针还是不合理   解题思路: 长度模4, 因为我们只关心起始和结尾, 然后判断   代码: #include <iostream> #include <cstdio> #in...

weixin_33757609的博客 115

ARM Cortex-A/R/M核心区别与嵌入式开发选型实战指南

在嵌入式系统与微控制器领域,处理器内核的选型是项目成功的基石。ARM架构作为主流指令集,其Cortex系列针对不同场景进行了专业化设计。从原理上看,处理器内核的设计哲学决定了其技术特性:Cortex-M系列追求极致的能效比与确定性中断响应,专为实时控制而生;Cortex-R系列则在可靠性与硬实时性能上深度优化,内置锁步核等安全机制;Cortex-A系列则通过集成内存管理单元(MMU)支持虚拟内存,从而能够运行Linux等完整操作系统。这种差异化的设计带来了截然不同的技术价值:Cortex-M适用于对功耗和成

weixin_30378623的博客 364

Codeforces Round #426 (Div. 2) A,B,C

A. The Useless Toy 题目链接:http://codeforces.com/contest/834/problem/A 思路: 水题 实现代码: #include<bits/stdc++.h> #include<iostream> #include<cstdio> #include<string> #include...

weixin_30375427的博客 115

Codeforces Round #426 (Div. 2)A题&&B题&&C题

A. The Useless Toy:http://codeforces.com/contest/834/problem/A 题目意思:给你两个字符,还有一个n,问你旋转n次以后从字符a变成b,是顺时针还是逆时针还是无法确定。 思路: 直接把c=n%4,然后搞出a->b需要顺时针转x下, 那么4-x就是逆时针需要转多少下了,如果顺逆时间是一样的 ,肯定无法判断,如果等于其中一个那该顺时...

weixin_30301183的博客 100
上一篇: 【Wannafly Daily】20170423 Product it again
下一篇: 【CodeForces】426Div2 B The Festive Evening
Pure_W
博客等级 码龄10年 19粉丝 158原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值