A:水

#include <bits/stdc++.h>
#include <cstring>
#include <iostream>
#include <algorithm>
#define EPS 1.0e-8
#define PI acos(-1.0)
#define INF 3000000000
#define MOD 1000000009
#define mem(a,b) memset((a),b,sizeof(a))
#define TS printf("!!!\n")
#define pb push_back
//using ll = long long;
//using ull= unsigned long long;
//std::ios::sync_with_stdio(false);
using namespace std;
//priority_queue<int,vector<int>,greater<int>> que; //min
typedef long long ll;
typedef unsigned long long ull;
bool cmplow(int a,int b)
{
return a<b;
}
int num[];
int main()
{
freopen("bulls.in", "r", stdin);
freopen("bulls.out", "w", stdout);
mem(num,);
string a,b;
cin >> a >> b;
int n=,m=;
for(int i=;i<;i++)
{
num[a[i]-'']++;
}
for(int i=;i<;i++)
{
if(a[i]==b[i])
{
n++;
}
else
{
if(num[b[i]-'']!=)
m++;
}
}
cout<< n <<" "<< m;
}

B:要先搜 再记录路径 因为可走不代表是可行解 要后面门全部走完才能记录

include <bits/stdc++.h>
#include <cstring>
#include <iostream>
#include <algorithm>
#define EPS 1.0e-8
#define PI acos(-1.0)
#define INF 3000000000
#define MOD 1000000009
#define mem(a,b) memset((a),b,sizeof(a))
#define TS printf("!!!\n")
#define pb push_back
#define pai pair<int,int>
//using ll = long long;
//using ull= unsigned long long;
//std::ios::sync_with_stdio(false);
using namespace std;
//priority_queue<int,vector<int>,greater<int>> que; //min
typedef long long ll;
typedef unsigned long long ull;
struct way
{
int to;
int val;
}w[];
int ans[];
int pop=;
void dfs(int x)
{
for(int gate=*x-;gate<=*x;gate++)
{
if(w[gate].val==)
{
w[w[gate].to].val=;
w[gate].val=;
dfs((w[gate].to+)/);
ans[pop++]=w[gate].to;
ans[pop++]=gate;
}
}
}
int main()
{
freopen("courier.in", "r", stdin);
freopen("courier.out", "w", stdout);
mem(ans,);
mem(w,);
int n;
cin >> n;
for(int i=;i<=*n;i++)
{
int now,next;
scanf("%d %d",&now,&next);
w[now].to=next;
w[next].to=now;
w[now].val=w[next].val=;
}
dfs();
for(int i=;i<=*n;i++)
{
if(w[i].val==)
{
cout<<"No"<<endl;
return ;
}
}
cout<<"Yes"<<endl;
cout<<ans[];
for(int i=;i<=*n;i++)
{
cout<<" "<<ans[i];
}
}

C:没遇到一个转折点就往前和往后推

#include <bits/stdc++.h>
#include <cstring>
#include <iostream>
#include <algorithm>
#define EPS 1.0e-8
#define PI acos(-1.0)
#define INF 3000000000
#define MOD 1000000009
#define mem(a,b) memset((a),b,sizeof(a))
#define TS printf("!!!\n")
#define pb push_back
//using ll = long long;
//using ull= unsigned long long;
//std::ios::sync_with_stdio(false);
using namespace std;
//priority_queue<int,vector<int>,greater<int>> que; //min
typedef long long ll;
typedef unsigned long long ull;
int a[];
int ans[];
int pop=;
int main()
{
freopen("dales.in", "r", stdin);
freopen("dales.out", "w", stdout);
int t;
cin>> t;
while(t--)
{
int n;
cin >> n;
for(int i=;i<=n;i++)
scanf("%d",&a[i]);
int h=,d=;
for(int i=;i<n;i++)
{
if(a[i]>a[i-]&&a[i]>a[i+])
{
int now1,now2;
for(now1=i-;now1>;now1--)
{
if(a[now1]>=a[now1+])
break;
}
for(now2=i+;now2<=n;now2++)
{
if(a[now2]>=a[now2-])
break;
}
h=max(h,min(now2-i-,i-now1-));
}
else if(a[i]<a[i-]&&a[i]<a[i+])
{
int now1,now2;
for(now1=i-;now1>;now1--)
{
if(a[now1]<=a[now1+])
break;
}
for(now2=i+;now2<=n;now2++)
{
if(a[now2]<=a[now2-])
break;
}
d=max(d,min(now2-i-,i-now1-));
}
}
cout<<h<<" "<<d<<endl;
}
}

D:暴力打表找规律

1->2->4->10->32->122->544->2770->15872->101042->707584->5405530......要算ans[x] i从1开始到x-2 add=ans[i]*ans[x-1-i]/2*C(x-1,i) if(i!=1&&(x-i-i)!=1) add/=2 ans+=add;

#include <bits/stdc++.h>
#include <cstring>
#include <iostream>
#include <algorithm>
#define EPS 1.0e-8
#define PI acos(-1.0)
#define INF 3000000000
#define MOD 1000000009
#define mem(a,b) memset((a),b,sizeof(a))
#define TS printf("!!!\n")
#define pb push_back
#define pai pair<int,int>
//using ll = long long;
//using ull= unsigned long long;
//std::ios::sync_with_stdio(false); using namespace std;
//priority_queue<int,vector<int>,greater<int>> que; //min
typedef long long ll;
typedef unsigned long long ull;
struct way
{
int to;
int val;
}w[];
int ans[];
int pop=;
void dfs(int x)
{
for(int gate=*x;gate>=*x-;gate--)
{
if(w[gate].val==)
{
w[w[gate].to].val=;
w[gate].val=;
dfs((w[gate].to+)/);
ans[pop++]=w[gate].to;
ans[pop++]=gate;
}
}
}
int main()
{
freopen("courier.in", "r", stdin);
freopen("courier.out", "w", stdout);
mem(ans,);
mem(w,);
int n;
cin >> n;
for(int i=;i<=*n;i++)
{
int now,next;
scanf("%d %d",&now,&next);
w[now].to=next;
w[next].to=now;
w[now].val=w[next].val=;
}
dfs();
for(int i=;i<=*n;i++)
{
if(w[i].val==)
{
cout<<"No"<<endl;
return ;
}
}
cout<<"Yes"<<endl;
cout<<ans[];
for(int i=;i<=*n;i++)
{
cout<<" "<<ans[i];
}
}

F:打表约数 枚举

G:数位DP

Summer training #11的更多相关文章

  1. 2017ecjtu-summer training # 11 POJ 2492

    A Bug's Life Time Limit: 10000MS   Memory Limit: 65536K Total Submissions: 38280   Accepted: 12452 D ...

  2. 2017ecjtu-summer training #11 POJ 1018

    Communication System Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 29218   Accepted:  ...

  3. 壁虎书4 Training Models

    Linear Regression The Normal Equation Computational Complexity 线性回归模型与MSE. the normal equation: a cl ...

  4. Todo List

    Contest 11.13 2016ACM/ICPC亚洲区青岛站(5/13, solved 7/13) Training 11.06 2016年中国大学生程序设计竞赛(合肥)(solved 6/10) ...

  5. 每日英语:Boost Your Balance; Avoid Falls

    If you find yourself needing to sit down to take off your shoes, it might be time to start paying at ...

  6. PyTorch中的Batch Normalization

    Pytorch中的BatchNorm的API主要有: 1 torch.nn.BatchNorm1d(num_features, 2 3 eps=1e-05, 4 5 momentum=0.1, 6 7 ...

  7. 地区sql

    /*Navicat MySQL Data Transfer Source Server : localhostSource Server Version : 50136Source Host : lo ...

  8. 2014 Multi-University Training Contest 9#11

    2014 Multi-University Training Contest 9#11 Killing MonstersTime Limit: 2000/1000 MS (Java/Others)   ...

  9. 【Android Developers Training】 11. 支持不同语言

    注:本文翻译自Google官方的Android Developers Training文档,译者技术一般,由于喜爱安卓而产生了翻译的念头,纯属个人兴趣爱好. 原文链接:http://developer ...

随机推荐

  1. iscsi-分区类型

    iSCSI简介(Internet SCSI): iSCSI 小型计算机系统接口,IBM公司研发,用于在IP网络上运行SCSI协议:解决了 SCSI需要直连存储设备的局限性:可以不停机扩展存储容量,iS ...

  2. 安装与编译Dlib(以Ubuntu16.04+Python3.6+pip为例)

    安装与编译Dlib(以Ubuntu16.04+Python3.6+pip为例) Step1:下载Ubuntu (or Linux)系统支持库=>Install OS libraries -dev ...

  3. JAVA上传文件到数据库

    前端代码 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> &l ...

  4. Postfix to Infix

    Infix expression: The expression of the form a op b. When an operator is in-between every pair of op ...

  5. Sentence Screen Fitting

    Given a rows x cols screen and a sentence represented by a list of words, find how many times the gi ...

  6. IDEA连接 Oracle数据库

    package com.zxx.util;import org.apache.commons.dbutils.DbUtils;import java.sql.Connection;import jav ...

  7. Kick Start 2019 Round H. Elevanagram

    设共有 $N = \sum_{i=1}^{9} A_i$ 个数字.先把 $N$ 个数字任意分成两组 $A$ 和 $B$,$A$ 中有 $N_A = \floor{N/2}$ 个数字,$B$ 中有 $N ...

  8. SpringBoot2.x集成WebSocket

    WebSocket 不做过多得介绍,这里有篇比较全面得文章      Spring Boot系列十六 WebSocket简介和spring boot集成简单消息代理 我这里是精简版,只挑出核心代码记录 ...

  9. PAT A1020 Tree Traversals(25)

    题目描述 Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder ...

  10. GTID复制

    什么是GTID呢, 简而言之,就是全局事务ID(global transaction identifier ),最初由google实现,官方MySQL在5.6才加入该功能.GTID是事务提交时创建分配 ...