Current work
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
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("shell.in");
|
||||
STDOUT("shell.out");
|
||||
|
||||
int guesses[4];
|
||||
F(i,0,4) guesses[i] = 0;
|
||||
|
||||
whileZ {
|
||||
takeIII(a,b,g);
|
||||
swap(guesses[a], guesses[b]);
|
||||
guesses[g]++;
|
||||
}
|
||||
|
||||
cout << *max_element(guesses, guesses + 4) << NL;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
3
|
||||
1 2 1
|
||||
3 2 1
|
||||
1 3 1
|
||||
Reference in New Issue
Block a user