Current work
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
3
|
||||
fox box
|
||||
dog cat
|
||||
car bus
|
||||
@@ -0,0 +1,44 @@
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
// ----- FILE IO -----
|
||||
#define STDIN(filename) freopen(filename, "r", stdin)
|
||||
#define STDOUT(filename) freopen(filename, "w", stdout)
|
||||
#define NL '\n'
|
||||
|
||||
// ----- FOR LOOPS -----
|
||||
#define F(i,L,R) for (int i = L; i < R; i++)
|
||||
#define FE(i,L,R) for (int i = L; i <= R; i++)
|
||||
#define FD(i,L,R) for (int i = L; i > R; i--)
|
||||
#define FDE(i,L,R) for (int i = L; i >= R; i--)
|
||||
|
||||
// ----- WEZ -----
|
||||
#define takeI(n) int (n); cin >> n
|
||||
#define takeII(n,m) int (n),(m); cin >> n >> m
|
||||
#define takeIII(n,m,k) int (n),(m),(k); cin >>(n) >> (m) >> (k)
|
||||
#define whileZ takeI(T); while(T--)
|
||||
//
|
||||
// ----- MAX MIN -----
|
||||
#define REMAX(a,b) (a)=max((a),(b))
|
||||
#define REMIN(a,b) (a)=min((a),(b))
|
||||
|
||||
// ----- DEBUG -----
|
||||
#define DBG(vari) cerr<<#vari<<" = "<<(vari)<<endl
|
||||
#define printA(a,L,R) FE(i,L,R) cout << a[i] << (i==R?'\n':' ')
|
||||
#define printV(a) printA(a,0,a.size()-1)
|
||||
|
||||
// ----- STL DS
|
||||
#define ALL(c) (c).begin(),(c).end()
|
||||
|
||||
int main() {
|
||||
takeI(n);
|
||||
F(i, 0, n) {
|
||||
}
|
||||
|
||||
int blocksNeeded[26];
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
from collections import Counter
|
||||
|
||||
read = open("blocks.in")
|
||||
n = int(read.readline())
|
||||
blocksNeeded = [0] * 26
|
||||
|
||||
for _ in range(n):
|
||||
a, b = read.readline().split()
|
||||
a, b = Counter(a), Counter(b)
|
||||
for key in a:
|
||||
if key in b:
|
||||
blocksNeeded[ord(key) - ord("a")] += max(a[key], b[key])
|
||||
else:
|
||||
blocksNeeded[ord(key) - ord("a")] += a[key]
|
||||
|
||||
for key in b:
|
||||
if key in a:
|
||||
continue
|
||||
else:
|
||||
blocksNeeded[ord(key) - ord("a")] += b[key]
|
||||
|
||||
with open("blocks.out", "w") as out:
|
||||
for block in blocksNeeded:
|
||||
print(block, file=out)
|
||||
Reference in New Issue
Block a user