mirror of
https://github.com/tiennm99/codeforces.git
synced 2026-10-14 14:17:20 +00:00
[Init] Solved solutions
This commit is contained in:
1 parent
51f667ac81
commit
20542601dd
131 files changed
+4148
No files matched your search
+99
@@ -0,0 +1,99 @@
|
||||
using System;
|
||||
|
||||
namespace problem_1000A
|
||||
{
|
||||
class problem_1000A
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
int n = int.Parse(Console.ReadLine());
|
||||
int[] a = new int[9];
|
||||
for (int i = 0; i<n; i++)
|
||||
{
|
||||
string s = Console.ReadLine();
|
||||
if (s == "M")
|
||||
{
|
||||
a[0]++;
|
||||
}
|
||||
else if (s == "S")
|
||||
{
|
||||
a[1]++;
|
||||
}
|
||||
else if (s == "XS")
|
||||
{
|
||||
a[2]++;
|
||||
}
|
||||
else if (s == "XXS")
|
||||
{
|
||||
a[3]++;
|
||||
}
|
||||
else if (s == "XXXS")
|
||||
{
|
||||
a[4]++;
|
||||
}
|
||||
else if (s == "L")
|
||||
{
|
||||
a[5]++;
|
||||
}
|
||||
else if (s == "XL")
|
||||
{
|
||||
a[6]++;
|
||||
}
|
||||
else if (s == "XXL")
|
||||
{
|
||||
a[7]++;
|
||||
}
|
||||
else if (s == "XXXL")
|
||||
{
|
||||
a[8]++;
|
||||
}
|
||||
}
|
||||
int c = 0;
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
string s = Console.ReadLine();
|
||||
if (s == "M" && a[0] > 0)
|
||||
{
|
||||
a[0]--;
|
||||
}
|
||||
else if (s == "S" && a[1] > 0)
|
||||
{
|
||||
a[1]--;
|
||||
}
|
||||
else if (s == "XS" && a[2] > 0)
|
||||
{
|
||||
a[2]--;
|
||||
}
|
||||
else if (s == "XXS" && a[3] > 0)
|
||||
{
|
||||
a[3]--;
|
||||
}
|
||||
else if (s == "XXXS" && a[4] > 0)
|
||||
{
|
||||
a[4]--;
|
||||
}
|
||||
else if (s == "L" && a[5] > 0)
|
||||
{
|
||||
a[5]--;
|
||||
}
|
||||
else if (s == "XL" && a[6] > 0)
|
||||
{
|
||||
a[6]--;
|
||||
}
|
||||
else if (s == "XXL" && a[7] > 0)
|
||||
{
|
||||
a[7]--;
|
||||
}
|
||||
else if (s == "XXXL" && a[8] > 0)
|
||||
{
|
||||
a[8]--;
|
||||
}
|
||||
else
|
||||
{
|
||||
c++;
|
||||
}
|
||||
}
|
||||
Console.Write(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user