3606

lsz_

miles2002
hlf.

PUsg
lviy_ptilopsis

konng0120

signed

#### C++ 代码

//这个题目其实可以不需要二分，可以将其存入某个二维数组中即可
#include <iostream>
#include <cstring>

using namespace std;
int a[10005][2];
signed main()
{
int n,m;
cin>>n>>m;
memset(a,-1,sizeof(a));
for(int i=0;i<n;i++)
{
int x;
cin>>x;
if(a[x][0]!=-1)
{
a[x][1]=i;
}
else
{
a[x][0]=i;
a[x][1]=i;
}
}
while (m -- ){
int x;
cin>>x;
cout<<a[x][0]<<" "<<a[x][1]<<endl;
}
}


//这里填你的代码^^
x = int(input())

lista = list(map(int,input().split()))

zda = {}
maxn = 0
for i in lista:
if i not in zda:
zda[i]=lista.count(i)
else:
continue
print(max(zda.values()))
//注意代码要放在两组三个点之间，才可以正确显示代码高亮哦~


2个月前
//这里填你的代码^^
#include <iostream>
#include <algorithm>

using namespace std;

signed main()
{
int x1,x2,x3,x4,y1,y2,y3,y4;
cin>>x1>>y1>>x2>>y2>>x3>>y3>>x4>>y4;
int d = max(max(x2,x4) - min(x1,x3),max(y2,y4) - min(y1,y3));
cout<<d*d<<endl;
return 0;
}
//注意代码要放在两组三个点之间，才可以正确显示代码高亮哦~


2个月前
//这里填你的代码^^
#include <bits/stdc++.h>
using namespace std;
set<char> st1;
set<pair<char,char>> st2;
string a[3];
int dx[24]={0,0,0,1,1,1,2,2,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2},dy[24]={0,1,2,0,1,2,0,1,2,0,0,0,1,1,1,2,2,2,0,1,2,2,1,0};
int main(){
int t=0;
for(int i=0;i<3;i++){
cin >> a[i];
}
for(int i=0;i<8;i++){
int flag=0;
char c=a[dx[t]][dy[t++]],tmp;
for(int j=1;j<3;j++){
if(a[dx[t]][dy[t]]!=c){
flag++;
tmp=a[dx[t]][dy[t]];
}
t++;
}
if(!flag) st1.insert(c);
else if(flag==1){
if(!st2.count({tmp,c}))
st2.insert({c,tmp});
}
}
cout << st1.size()<< endl << st2.size()<<endl;
return 0;
}
//注意代码要放在两组三个点之间，才可以正确显示代码高亮哦~


3个月前

### 题目描述

#### python 代码

import random
# n, k = map(int, input().split())
# y = input()
# sum = 0
# zfc = ""
# f = 0
# bn = 1
# for i in range(len(y)):
#     if f == 0 and y[i] != " ":
#         zfc += y[i]
#     elif f == 0 and y[i] == " ":
#         f = 1
#     if f and y[i] == " ":
#         sum += 1
#         xzfc = zfc + " "
#         for j in range(i+1,len(y)):
#             #print(y[j])
#             if y[j] != " ":
#                 xzfc += y[j]
#             else:
#                 break
#         #print(xzfc,sum)
#         if len(xzfc) - sum > k:
#             print(zfc)
#             zfc = ""
#             sum = 0
#             bn = 1
#             f = 0
#         else:
#             zfc = xzfc
# print(zfc)

x = int(input())

sxb = {'Ox':0,'Tiger':1,'Rabbit':2,'Dragon':3,'Snake':4,'Horse':5,'Goat':6,'Monkey':7,'Rooster':8,'Dog':9,'Pig':10,'Rat':11}
sx = {'Bessie':'Ox'}
age = {'Bessie': 0}
while x:
x = x - 1
zfc = input()
zf = ''
lista = []
for i in zfc:
if i == ' ':
lista.append(zf)
zf = ''
else:
zf += i
lista.append(zf)
sx[lista[0]] = lista[4]
if sx[lista[7]] == sx[lista[0]]:
if lista[3] == 'previous':
age[lista[0]] = age[lista[-1]] - 12
else:
age[lista[0]] = age[lista[-1]] + 12
else:
if lista[3] == 'previous':
age[lista[0]] = age[lista[-1]] - (sxb[sx[lista[-1]]] - sxb[lista[4]] + 12) % 12
else:
age[lista[0]] = age[lista[-1]] + (sxb[lista[4]] - sxb[sx[lista[-1]]] + 12) % 12
print(abs(age['Elsie']))



3个月前
//这里填你的代码^^
import random
# n, k = map(int, input().split())
# y = input()
# sum = 0
# zfc = ""
# f = 0
# bn = 1
# for i in range(len(y)):
#     if f == 0 and y[i] != " ":
#         zfc += y[i]
#     elif f == 0 and y[i] == " ":
#         f = 1
#     if f and y[i] == " ":
#         sum += 1
#         xzfc = zfc + " "
#         for j in range(i+1,len(y)):
#             #print(y[j])
#             if y[j] != " ":
#                 xzfc += y[j]
#             else:
#                 break
#         #print(xzfc,sum)
#         if len(xzfc) - sum > k:
#             print(zfc)
#             zfc = ""
#             sum = 0
#             bn = 1
#             f = 0
#         else:
#             zfc = xzfc
# print(zfc)

x = int(input())

sxb = {'Ox':0,'Tiger':1,'Rabbit':2,'Dragon':3,'Snake':4,'Horse':5,'Goat':6,'Monkey':7,'Rooster':8,'Dog':9,'Pig':10,'Rat':11}
sx = {'Bessie':'Ox'}
age = {'Bessie': 0}
while x:
x = x - 1
zfc = input()
zf = ''
lista = []
for i in zfc:
if i == ' ':
lista.append(zf)
zf = ''
else:
zf += i
lista.append(zf)
sx[lista[0]] = lista[4]
if sx[lista[7]] == sx[lista[0]]:
if lista[3] == 'previous':
age[lista[0]] = age[lista[-1]] - 12
else:
age[lista[0]] = age[lista[-1]] + 12
else:
if lista[3] == 'previous':
age[lista[0]] = age[lista[-1]] - (sxb[sx[lista[-1]]] - sxb[lista[4]] + 12) % 12
else:
age[lista[0]] = age[lista[-1]] + (sxb[lista[4]] - sxb[sx[lista[-1]]] + 12) % 12
print(abs(age['Elsie']))

//注意代码要放在两组三个点之间，才可以正确显示代码高亮哦~


3个月前

### 题目描述

#### python代码

import random
n, k = map(int, input().split())
y = input()
sum = 0
zfc = ""
f = 0
bn = 1
for i in range(len(y)):
if f == 0 and y[i] != " ":
zfc += y[i]
elif f == 0 and y[i] == " ":
f = 1
if f and y[i] == " ":
sum += 1
xzfc = zfc + " "
for j in range(i+1,len(y)):
#print(y[j])
if y[j] != " ":
xzfc += y[j]
else:
break
#print(xzfc,sum)
if len(xzfc) - sum > k:
print(zfc)
zfc = ""
sum = 0
bn = 1
f = 0
else:
zfc = xzfc
print(zfc)


3个月前
//这里填你的代码^^
import random
n, k = map(int, input().split())
y = input()
sum = 0
zfc = ""
f = 0
bn = 1
for i in range(len(y)):
if f == 0 and y[i] != " ":
zfc += y[i]
elif f == 0 and y[i] == " ":
f = 1
if f and y[i] == " ":
sum += 1
xzfc = zfc + " "
for j in range(i+1,len(y)):
#print(y[j])
if y[j] != " ":
xzfc += y[j]
else:
break
#print(xzfc,sum)
if len(xzfc) - sum > k:
print(zfc)
zfc = ""
sum = 0
bn = 1
f = 0
else:
zfc = xzfc
print(zfc)
//注意代码要放在两组三个点之间，才可以正确显示代码高亮哦~


3个月前
//这里填你的代码^^
#include <iostream>
#include <cstring>

using namespace std;
int a[27];

signed main()
{
string s;
cin>>s;
for(int i=0;i<26;i++) a[s[i]-'a'] = i;
cin>>s;
int sum =1;
for(int i=1;i<s.size();i++)
{
if(a[s[i]-'a'] <= a[s[i-1]-'a']) sum++;
}
cout<<sum<<endl;
}
//注意代码要放在两组三个点之间，才可以正确显示代码高亮哦~


3个月前
//这里填你的代码^^
#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;
int a[21];
int b[21][21];
signed main()
{
int n,m;
cin>>m>>n;
for(int l=0;l<m;l++)
{
for (int j = 1; j <= n; j++) scanf("%d", &a[j]);
for (int j = 1; j < n; j++)
for (int x = j + 1; x <= n; x++) b[a[j]][a[x]]++;

}
int ans = 0;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++) if (b[i][j] == m) ans++;
} printf("%d\n", ans);
}
//注意代码要放在两组三个点之间，才可以正确显示代码高亮哦~