请教神牛 pku2316 有个地方不懂
Time Limit: 1000MS Memory Limit: 65536K
Total Submissions: 4569 Accepted: 2453
Description
Simulate a locked spinner puzzle.
A locked spinner puzzle is a puzzle where you can only change wheels in groups. It is a common puzzle to achieve some value on the spinners by only changing them in the allowed groups.
Imagine a row of D numbered wheels, each labeled sequentially with the digits 0 through 9. This is similar to what is on a briefcase combination lock.
Below this are a series of B buttons with labels that are D digits long. For example, D may be 4 and the labels are 1000 1200 1002 0111 and 0100. Pressing the button labeled 1000 moves the first wheel once, but leaves the others alone, while pressing the button labeled 1002 moves the first wheel once and the fourth wheel twice, leaving the center wheels unchanged.
Your task is to simulate such a locked spinner puzzle giving the final readout of the wheels.
Input
The input to your program will be a line containing D digits (at most 10) representing the starting positions of the wheels. Following this, each line will have the button label for which button is pressed next.There will always be at least 1 digit
Output
Output the final positions of the wheels.
Sample Input
0001
1003
0206
0034
1111
1003
Sample Output
3348
用c++做的代码:
#include<iostream>
#include<string>
using namespace std;
int main()
{
int array[10];
for (int s=0;s<10;++s)
array[s]=0;
string str;
while (cin>>str)
{
for (int s=0;s<str.length();++s)
array[s]+=str[s]-'0';
}
for (int s=0;s<length;++s)
array[s]=array[s]%10;
for (int s=0;s<length;++s)
cout<<array[s]<<endl;
return 0;
}
在执行时 只能不断输入,却没办法在输入完成后执行程序,请教该如何改???
相关推荐
很详细的PKU题目分类
这是关于PKU上的题目分类 很详细 适合不同水平的童鞋们参考
POJ分类题(按照算法分类)
分类很好,我自己也在做,我不是为了赚积分,只是为了分享给大家,2个积分,很便宜~
高校技术转移办公室如何提升科研成果的市场化对接效率?.docx
科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。
YOLO26算法室内家居椅子沙发目标检测+训练好的模型+689张数据集+pyqt可视化界面.zip
附训练好的 YOLO 权重与 PyQt 可视化检测界面,页面底部含可视化效果预览,毕设/课设开箱即用。 【数据集概况】 · 检测类别(中文):[椅子(Chair), 沙发(Sofa), 桌子(Table)] · 训练集:454 张 · 验证集:161 张 · 测试集:74 张 · 总计:689 张 该数据集聚焦室内家居场景中椅子与沙发的精准识别,为家居智能管理、家具电商商品识别等应用提供高质量标注数据,助力提升室内空间智能化管理水平。训练集454张、验证集161张、测试集74张的分配比例合理,充分覆盖不同材质、款式及光照条件下的椅子与沙发样本,确保模型训练、验证与测试环节的全面性与代表性。所有样本均采用严格标注规范,精准框定椅子与沙发的边界,标注一致性高,有效保障了模型训练的准确性与泛化能力... 【训练曲线与评估图】 【模型训练配置】 参数 | 值 模型 | yolo26n 训练轮数 | 100 epochs 输入尺寸 | 640x640 批次大小 | 24 优化器 | auto 初始学习率 | 0.01 训练设备 【关键指标汇总】 训练了 88 个 epoch,最终轮指标: 指标 | 数值 mAP50 | **0.9610** mAP50-95 | 0.8473 Precision | 0.8484 Recall | 0.9490 train/box_loss | 0.3764 train/cls_loss | 0.2789 val/box_loss | 0.5660 val/cls_loss | 0.3725 【训练过程分析】 训练过程分析的过程就像是在经历一场马拉松,每一步都充满挑战,尤其是在那个令人心潮澎湃的88个epoch的拐点。在训练初期,曲线走势平顺,模型在第10个epoch达到了一个小小... 使用场景:毕业设计、课程设计、深度学习入门、工业场景落地验证。
科技中介服务机构如何借助平台实现服务流程标准化与智能化?.docx
科易网基于AI模型+行业大数据,在技术转移、成果转化、技术经纪、知识产权、产业创新、科技招商等垂直领域的多样化应用场景,推出科技创新领域的AI+工具与数智化解决方案,推动科技创新与产业创新智能化发展。


