Vibe code scripts to edit and add usaco solutions
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
3 8
|
||||
AATCCCAT
|
||||
GATTGCAA
|
||||
GGTCGCAA
|
||||
ACTCCCAG
|
||||
ACTCGCAT
|
||||
ACTTCCAT
|
||||
@@ -0,0 +1,70 @@
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
#include <set>
|
||||
#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() {
|
||||
STDIN("cownomics.in");
|
||||
STDOUT("cownomics.out");
|
||||
|
||||
takeII(n, m);
|
||||
vector<set<char>> S(m, set<char>());
|
||||
vector<set<char>> P(m, set<char>());
|
||||
F(i, 0, n) {
|
||||
F(j, 0, m) {
|
||||
char k;
|
||||
cin >> k;
|
||||
S[j].insert(k);
|
||||
}
|
||||
}
|
||||
|
||||
F(i, 0, n) {
|
||||
F(j, 0, m) {
|
||||
char k;
|
||||
cin >> k;
|
||||
P[j].insert(k);
|
||||
}
|
||||
}
|
||||
|
||||
int res = 0;
|
||||
F(j, 0, m) {
|
||||
vector<char> intersect;
|
||||
set_intersection(S[j].begin(), S[j].end(), P[j].begin(), P[j].end(), back_inserter(intersect));
|
||||
if (intersect.size() == 0) {
|
||||
res++;
|
||||
}
|
||||
}
|
||||
|
||||
cout << res;
|
||||
}
|
||||
Reference in New Issue
Block a user