## 题目

### P1 – Container With Most Water

#### 代码

#include<bits/stdc++.h>
using namespace std;
inline long long read(){
long long ret=0,f=1;char ch=getchar();
while (ch<'0'||ch>'9') {if (ch=='-') f=-f;ch=getchar();}
while (ch>='0'&&ch<='9') ret=ret*10+ch-'0',ch=getchar();
return ret*f;
}
long long n,s[10000005],l,r;
long long ans=-2147483647;
int main(){
n=read();
l=1;
r=n;
for (register int i=1;i<=n;i++){
s[i]=read();
}
while (l<r){
long long now=1LL*min(s[l],s[r])*1LL*(r-l);
ans=max(ans,now);
if(s[l]<s[r]){
l++;
}else{
r--;
}
}
cout<<ans;
}

### P2 – 迷失代码库

#### 题面

##### Input Format

$100$ 份代码 c*.cpp 包含在下发文件中。

##### Output Format

• 第一个数 $idx \in [1,100]$ ，表示你将要开始描述第 $idx$ 份代码。
• 第二个数 $tot \in [1,100]$ ，表示你猜测共有 $tot$ 份代码与之是同一人写的。
• 接下来 $tot$ 个数 $lst_{1\cdots tot}$，表示第 $lst_i$ 份代码与之是同一个人写的，$lst$ 中包括 $idx$ 本身。

• $idx$、$tot$ 必须符合范围
• 相同的 $idx$ 不能重复出现多次，但是顺序任意
• 同一个 $lst$ 中，不能出现重复数字，但是顺序任意

1 3 1 2 4
3 4 3 5 6 7
6 4 3 6 5 7
4 3 1 2 4
2 3 1 4 2
5 4 3 7 6 5
7 4 3 5 6 7
##### Scoring

$${\ln|A\cap B|\over \ln| A\cup B|}\times 1.0$$

#### 思路

$scoring$ 在 $win$ 下跑不起来，好像可以写脚本通过这个套数据。

### P3 – Letter Gaps

#### 题面

Ponder This Challenge:

In the string CABACB, each letter appears exactly twice and the number of characters between the “A”s is one, between the “B”s is two, and between the “C”s is three.

The same problem with the letters A-E cannot be solved, but adding a space (in the form of a hyphen) allows it to be solved.

For example, in the string ADAEC-DBCEB, the number of characters between the “A”s is one, between the “B”s is two, between the “C”s is three (counting the space), between the “D”s is four, and between the “E”s is five.

Find a string of letters (A-Z) and “-” whose length is no more than 53 characters, where each of the 26 letters A-Z appears exactly twice, and there is one character between the “A”s, two between the “B”s … and 26 between the “Z”s.

#### 代码

#include<bits/stdc++.h>
using namespace std;
inline int read(){
int ret=0,f=1;char ch=getchar();
while (ch<'0'||ch>'9') {if (ch=='-') f=-f;ch=getchar();}
while (ch>='0'&&ch<='9') ret=ret*10+ch-'0',ch=getchar();
return ret*f;
}
int n,t[70];
char s[300];
void dfs(char x){
if (x=='A'-1){
for (int i=1;i<=2*n+1;i++){
if (s[i]=='*'){
s[i]='-';
}
cout<<s[i];
}
exit(0);
}
for (int i=1;i<=2*n+1;i++){
if (s[i]!='*'){
continue;
}
s[i]=x;
if (i+x-'A'+2<=2*n+1){
if (s[i+x-'A'+2]=='*'){
s[i+x-'A'+2]=x;
dfs(x-1);
s[i+x-'A'+2]='*';
}
}
if (i-(x-'A'+2)>=1){
if (s[i-(x-'A'+2)]=='*'){
s[i-(x-'A'+2)]=x;
dfs(x-1);
s[i-(x-'A'+2)]='*';
}
}
s[i]='*';
}
}
int main(){
cin>>n;
for (int i=0;i<=70;i++){
s[i]='*';
}
dfs('A'+n-1);
}

## 发送评论编辑评论

|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
（╯‵□′）╯︵┴─┴
￣﹃￣
(/ω＼)
∠( ᐛ 」∠)＿
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ｀)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ(￣∇￣o)
ヾ(´･ ･｀｡)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò｡)
Σ(っ °Д °;)っ
( ,,´･ω･)ﾉ"(´っω･｀｡)
╮(╯▽╰)╭
o(*////▽////*)q
＞﹏＜
( ๑´•ω•) "(ㆆᴗㆆ)

Emoji
AmashiroNatsukiEars