首页 > 其他分享 >chu-sai-zi-ce

chu-sai-zi-ce

时间:2022-11-06 18:23:50浏览次数:69  
标签:tmp sai yourans string int double ce chu include

初赛自测

posted on 2021-09-20 00:05:18 | under 灌水 | source

如果你记了答案可以测一下(误)

S

#include <cctype>
#include <string>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int pdnum[]={4,3,3};
string stdans="abaccccbdaacccbtfftdctffbcbftfbdddadcadaddc";
string yourans;
double w[1010];
double init(){
    for(int i=1;i<=15;i++) w[i]=2;
    for(int i=16;i<=28;i+=6){
        for(int j=i;j<i+pdnum[(i-16)/6];j++) w[j]=1.5;
        for(int j=i+pdnum[(i-16)/6];j<i+6;j++) w[j]=3;
    }
    for(int i=34;i<=43;i++) w[i]=3;
    w[19]=2,w[21]=2.5,w[33]=4;
    return 0;
}
double tot=init();
int main(){
    string tmp;
    while(cin>>tmp) yourans+=tmp;
    cout<<stdans<<endl<<yourans<<endl;
    for(size_t i=1;i<=43;i++){
        if(toupper(stdans[i-1])==toupper(yourans[i-1])) tot+=w[i];
    }
    cout<<tot<<endl;
    return 0;
}

J

#include <cctype>
#include <string>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int pdnum[]={5,3,3};
string stdans="dbacddcabbbacbbffftfbfttbbctffaccdccdbbdcbd";
string yourans;
double w[1010];
double init(){
    for(int i=1;i<=15;i++) w[i]=2;
    for(int i=16;i<=28;i+=6){
        for(int j=i;j<i+pdnum[(i-16)/6];j++) w[j]=1.5;
        for(int j=i+pdnum[(i-16)/6];j<i+6;j++) w[j]=3;
    }
    for(int i=34;i<=43;i++) w[i]=3;
    w[27]=3.5,w[29]=w[30]=2,w[33]=4;
    return 0;
}
double tot=init();
int main(){
    string tmp;
    while(cin>>tmp) yourans+=tmp;
    cout<<stdans<<endl<<yourans<<endl;
    for(size_t i=1;i<=43;i++){
        if(toupper(stdans[i-1])==toupper(yourans[i-1])) tot+=w[i];
    }
    cout<<tot<<endl;
    return 0;
}

标签:tmp,sai,yourans,string,int,double,ce,chu,include
From: https://www.cnblogs.com/caijianhong/p/16863295.html

相关文章

  • centroid-decomposition
    【模板】点分治CentroidDecompositionpostedon2022-07-2018:59:16|under模板|source0x00模板(P3806)给定$n,k$和一棵树,计算$$\sum\limits_{i,j\leqn}[{\tt......
  • Codeforces Round #832 (Div. 2) D (预处理+二分)
    D.YetAnotherProblem观察题干发现一定要是odd考虑发掘性质发现之后还会将[l,r]长度为奇数的区间全部赋值成这个区间的异或和我们设长度为lenlen-1个偶数个异或为......
  • Batch Normalization: Accelerating Deep Network Training by Reducing Internal Cov
    BN层只是从一定程度上解决了梯度衰减的问题但是并没有完全解决如果输入值的差距过大会导致模型加BN层后loss依旧无变化。代码:fromenumimportautofromscipy.ioimpo......
  • RHCE模拟题
    RHCE模拟题系统信息在本考试期间,您将操作下列虚拟系统:系统IP地址Ansible角色control172.25.250.254ansiblecontrolnodenode1172.25.250.9ansible......
  • Caused by java.io.EOFException SSL peer shut down incorrectly
    错误信息:javax.net.ssl.SSLHandshakeException:Remotehostclosedconnectionduringhandshakeatsun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1......
  • centos系统制作ISO镜像文件
    MondoRescue是什么?MondoRescue(简称Mondo):是一款开源免费的故障恢复和备份工具,可以说是Linux操作系统下的Ghost,你可以轻松地创建系统(Linux或Windows)克隆或备份的IS......
  • Codeforces-1753B Factorial Divisibility题解
    Codeforces-1753BFactorialDivisibility参考:https://blog.csdn.net/qq_38236082/article/details/127500190题意:问$a_1!+a_2!+a_3!+...+a_n!$能否被$x!$整除。......
  • CentOS7编译安装haproxy-2.6.6
    创建用户并安装依赖包#selinux会影响haproxy启动,会有'cannotbindUNIXsocket(Permissiondenied)'的报错,请关闭它除非你知道设置selinux规则sed-i'/SELINUX/s/enf......
  • centos下搭建sockets5代理
    #安装依赖及ss5yum-yinstallgccopenldap-develpam-developenssl-develwgethttps://nchc.dl.sourceforge.net/project/ss5/ss5/3.8.9-8/ss5-3.8.9-8.tar.gztar-x......
  • 题解 [AGC044C] Strange Dance
    这道题启示我们Trie树是可以支持全局下标加\(1\)的。首先把\(3^n\)个人从低位到高位建到三进制Trie树上。类似二叉树的左右儿子,我们称由\(0,1,2\)边连接的儿子......