Skip to content

Commit

Permalink
did ccc juniour 2021
Browse files Browse the repository at this point in the history
  • Loading branch information
Ynng committed Feb 23, 2021
1 parent c7dab03 commit ca68ba2
Show file tree
Hide file tree
Showing 8 changed files with 251 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"Local: ccc21j1","url":"f:\\GitHub\\Practice\\CCC\\ccc21j1.cpp","tests":[{"id":1614107871441,"input":"99","output":"95\n1"},{"id":1614107884284,"input":"102","output":"110\n-1"}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"f:\\GitHub\\Practice\\CCC\\ccc21j1.cpp","group":"local","local":true}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"Local: ccc21j2","url":"f:\\GitHub\\Practice\\CCC\\ccc21j2.cpp","tests":[{"id":1614108045795,"input":"3\nAhmed\n300\nSuzanne\n500\nIvona\n450","output":"Suzanne"},{"id":1614108051944,"input":"2\nIjeoma\n20\nGoor\n20","output":"Ijeoma"}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"f:\\GitHub\\Practice\\CCC\\ccc21j2.cpp","group":"local","local":true}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"Local: ccc21j3","url":"f:\\GitHub\\Practice\\CCC\\ccc21j3.cpp","tests":[{"id":1614108385907,"input":"57234\n00907\n34100\n99999","output":"right 234\nright 907\nleft 100"}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"f:\\GitHub\\Practice\\CCC\\ccc21j3.cpp","group":"local","local":true}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"Local: ccc21j4","url":"f:\\GitHub\\Practice\\CCC\\ccc21j4.cpp","tests":[{"id":1614108566540,"input":"LMMMS","output":"0"},{"id":1614108571656,"input":"LLSLM","output":"2"},{"id":1614110085899,"input":"MLSLM","output":""}],"interactive":false,"memoryLimit":1024,"timeLimit":3000,"srcPath":"f:\\GitHub\\Practice\\CCC\\ccc21j4.cpp","group":"local","local":true}
46 changes: 46 additions & 0 deletions CCC/ccc21j1.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;

#define INF 0x3f3f3f3f // for int
#define LL_INF 0x3f3f3f3f3f3f3f3f // for ll
#define sz(x) (int)(x).size()
#define ms(x, y) memset(x, y, sizeof(x))
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert

const int MOD = 1000000007, MX = 10000 + 5;

int B;
int main()
{
scanf("%d", &B);
B = 5 * B - 400;
int P = 0;
if (B < 100)
P = 1;
else if (B > 100)
P = -1;
printf("%d\n%d", B, P);

return 0;
}
54 changes: 54 additions & 0 deletions CCC/ccc21j2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;

#define INF 0x3f3f3f3f // for int
#define LL_INF 0x3f3f3f3f3f3f3f3f // for ll
#define sz(x) (int)(x).size()
#define ms(x, y) memset(x, y, sizeof(x))
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert

const int MOD = 1000000007, MX = 10000 + 5;

int N;
int mx;
string mxName;
int main()
{
cin >> N;
for (int i = 1; i <= N; i++)
{
string name;
int amount;
cin >> name >> amount;
if (amount > mx)
{
mx = amount;
mxName = name;
}
}

cout << mxName << endl;

return 0;
}
65 changes: 65 additions & 0 deletions CCC/ccc21j3.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;

#define INF 0x3f3f3f3f // for int
#define LL_INF 0x3f3f3f3f3f3f3f3f // for ll
#define sz(x) (int)(x).size()
#define ms(x, y) memset(x, y, sizeof(x))
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert

const int MOD = 1000000007, MX = 10000 + 5;

char str[6];
bool l;
int main()
{
while (true)
{
scanf("%s", str);
bool end = true;
for (int i = 0; i < 5; i++)
{
if (str[i] != '9')
{
end = false;
break;
}
}
if (end)
break;

int sum = str[0] + str[1] - 2 * '0';
if (sum % 2)
l = true;
else if (sum != 0)
l = false;
if (l)
printf("left ");
else
printf("right ");
printf("%s\n", str + 2);
}

return 0;
}
82 changes: 82 additions & 0 deletions CCC/ccc21j4.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;

#define INF 0x3f3f3f3f // for int
#define LL_INF 0x3f3f3f3f3f3f3f3f // for ll
#define sz(x) (int)(x).size()
#define ms(x, y) memset(x, y, sizeof(x))
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert

const int MOD = 1000000007, MX = 100000 + 5;

char str[MX];
int len;
int sizes[3];
int arr[4];
int main()
{
scanf("%s", str);
len = strlen(str);
for (int i = 0; i < len; i++)
{
if (str[i] == 'L')
str[i] = 0;
if (str[i] == 'M')
str[i] = 1;
if (str[i] == 'S')
str[i] = 2;

sizes[str[i]]++;
}


for (int i = 0; i <= len; i++)
{
if (i < sizes[0])
{
if (str[i] == 1)
arr[0]++;
if (str[i] == 2)
arr[1]++;
}
else if (i < sizes[0] + sizes[1])
{
if (str[i] == 2)
arr[2]++;
}
else
{
if (str[i] == 1)
arr[3]++;
}
}

#ifdef DEBUG
printf("%d %d %d\n", sizes[0], sizes[1], sizes[2]);
printf("%d %d %d %d\n", arr[0], arr[1], arr[2], arr[3]);
#endif

printf("%d\n", arr[0] + arr[1] + arr[2] + arr[3] - min(arr[2], arr[3]));
return 0;
}

0 comments on commit ca68ba2

Please sign in to comment.