$$\href{https://www.acwing.com/blog/content/19191/}{个人主页}$$$$封禁家族组员$$

2335

zhyou

AcWing2AK

dp菜苟
xianxingchen

lsz_
JcWing
_Null_
kkksc03万岁

pikink
Foraino0267
SUPERDOGE

12小时前

#include <iostream>

using namespace std;

double a, b, c;

int main()
{
cin >> a >> b >> c;
if (a < b) swap(a, b);
if (a < c) swap(a, c);
if (b < c) swap(b, c);
if (a >= b + c)
puts("NAO FORMA TRIANGULO");
else
{
if (a * a == b * b + c * c)
puts("TRIANGULO RETANGULO");
if (a * a > b * b + c * c)
puts("TRIANGULO OBTUSANGULO");
if (a * a < b * b + c * c)
puts("TRIANGULO ACUTANGULO");
if (a == b && b == c)
puts("TRIANGULO EQUILATERO");
else if (a == b || b == c || a == c)
puts("TRIANGULO ISOSCELES");
}
return 0;
}


#include <iostream>

using namespace std;

double a, b;

int main()
{
cin >> a >> b;
if (a == 0 && b == 0)
puts("Origem");
else if (a == 0)
puts("Eixo Y");
else if (b == 0)
puts("Eixo X");
else if (a >= 0 && b >= 0)
puts("Q1");
else if (a >= 0 && b < 0)
puts("Q4");
else if (a < 0 && b >= 0)
puts("Q2");
else if (a < 0 && b < 0)
puts("Q3");
return 0;
}


#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;

int main()
{
string s;
int res = 0;
getline(cin, s);
for (int i = 0; i < s.size(); i ++)
if (s[i] <= '9' && s[i] >= '0' || s[i] <= 'Z' && s[i] >= 'A' || s[i] <= 'z' && s[i] >= 'a')
res ++;
cout << res << endl;
return 0;
}


#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;

int reverse(int x)
{
int y = 0;
while (x != 0)
{
y = y * 10 + x % 10;
x /= 10;
}
return y;
}

int main()
{
int n;
scanf("%d", &n);
printf("%d\n", reverse(n));
return 0;
}


#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;

int main()
{
string s, res;
cin >> s;
res += s.substr(0, 1);
res += s.substr(2, 3);
res += s.substr(6, 5);
int sum = 0;
for (int i = 0; i < res.size(); i ++)
sum += (res[i] - '0') * (i + 1);
if (sum % 11 == s[s.size() - 1] - '0')
printf("Right\n");
else if (sum % 11 == 10 && s[s.size() - 1] == 'X')
printf("Right\n");
else
{
if (sum % 11 == 10)
cout << s.substr(0, s.size() - 1) << "X";
else
cout << s.substr(0, s.size() - 1) << sum % 11;
}
return 0;
}


#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;

int main()
{
vector<char> v;
char c;
while ((c = getchar()) != EOF)
v.push_back(c);
int cnt1 = 0, cnt2 = 0;
for (int i = 0; i < v.size() && v[i] != 'E'; i ++)
{
if (v[i] == 'W')
cnt1 ++;
if (v[i] == 'L')
cnt2 ++;
if (cnt1 >= 11 || cnt2 >= 11)
{
if (abs(cnt1 - cnt2) >= 2)
{
cout << cnt1 << ":" << cnt2 << endl;
cnt1 = cnt2 = 0;
}
}
}
cout << cnt1 << ":" << cnt2 << endl << endl;
cnt1 = cnt2 = 0;
for (int i = 0; i < v.size() && v[i] != 'E'; i ++)
{
if (v[i] == 'W')
cnt1 ++;
if (v[i] == 'L')
cnt2 ++;
if (cnt1 >= 21 || cnt2 >= 21)
{
if (abs(cnt1 - cnt2) >= 2)
{
cout << cnt1 << ":" << cnt2 << endl;
cnt1 = cnt2 = 0;
}
}
}
cout << cnt1  << ":" << cnt2 << endl;
return 0;
}


#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;

const int N = 5005;
int n, m;

struct node
{
int id, s;
}q[N];

bool cmp(node a, node b)
{
return a.s > b.s || a.s == b.s && a.id < b.id;
}

int main()
{
scanf("%d%d", &n, &m);
m = int(m * 1.5);
for (int i = 0; i < n; i ++)
scanf("%d%d", &q[i].id, &q[i].s);
sort(q, q + n, cmp);
int res = m;
for (int i = m; i < n; i ++)
if (q[i].s == q[m - 1].s)
res ++;
printf("%d %d\n", q[m - 1].s, res);
for (int i = 0; i < res; i ++)
printf("%d %d\n", q[i].id, q[i].s);
return 0;
}