Skip to content

Commit 48e430b

Browse files
13.09.2025 02:17
1 parent f33d908 commit 48e430b

File tree

5 files changed

+120
-0
lines changed

5 files changed

+120
-0
lines changed

1512A Spy Detected!.cpp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#include <iostream>
2+
#include <map>
3+
using namespace std;
4+
int main()
5+
{
6+
int t;
7+
cin >> t;
8+
while (t--)
9+
{
10+
int n;
11+
cin >> n;
12+
map<int, int> m;
13+
int arr[n];
14+
for (int i = 0; i < n; i++)
15+
{
16+
cin >> arr[i];
17+
m[arr[i]]++;
18+
}
19+
int hlp;
20+
for (auto el : m)
21+
{
22+
if (el.second == 1)
23+
{
24+
hlp = el.first;
25+
}
26+
}
27+
for (int i = 0; i < n; i++)
28+
{
29+
if (arr[i] == hlp)
30+
{
31+
cout << i + 1 << endl;
32+
break;
33+
}
34+
}
35+
}
36+
return 0;
37+
}

1760A Medium Number.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#include <iostream>
2+
using namespace std;
3+
int main()
4+
{
5+
int t;
6+
cin >> t;
7+
while (t--)
8+
{
9+
int a, b, c;
10+
cin >> a >> b >> c;
11+
cout << a + b + c - min(a, min(b, c)) - max(a, max(b, c)) << endl;
12+
}
13+
return 0;
14+
}

1791A Codeforces Checking.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include <iostream>
2+
using namespace std;
3+
int main()
4+
{
5+
int t;
6+
string s = "codeforces";
7+
cin >> t;
8+
while (t--)
9+
{
10+
char c;
11+
bool flag = true;
12+
cin >> c;
13+
for (int i = 0; i < s.size(); i++)
14+
{
15+
if (s[i] == c)
16+
{
17+
cout << "YES" << endl;
18+
flag = false;
19+
break;
20+
}
21+
}
22+
if (flag)
23+
{
24+
cout << "NO" << endl;
25+
}
26+
}
27+
return 0;
28+
}

1915A Odd One Out.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include <iostream>
2+
using namespace std;
3+
int main()
4+
{
5+
int t;
6+
cin >> t;
7+
while (t--)
8+
{
9+
int a, b, c;
10+
cin >> a >> b >> c;
11+
if (a == b)
12+
{
13+
cout << c << endl;
14+
}
15+
else if (a == c)
16+
{
17+
cout << b << endl;
18+
}
19+
else
20+
{
21+
cout << a << endl;
22+
}
23+
}
24+
return 0;
25+
}

1999A A+B Again.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include <iostream>
2+
using namespace std;
3+
int main()
4+
{
5+
int t;
6+
cin >> t;
7+
while (t--)
8+
{
9+
string s;
10+
cin >> s;
11+
int one = s[0] - '0';
12+
int two = s[1] - '0';
13+
cout << one + two << endl;
14+
}
15+
return 0;
16+
}

0 commit comments

Comments
 (0)