# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
561743 | nghiass001 | Parrots (IOI11_parrots) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define FOR(i,l,r) for(int i=(l); i<=(r); ++i)
#define REP(i,l,r) for(int i=(l); i<(r); ++i)
#define FORD(i,r,l) for(int i=(r); i>=(l); --i)
#define REPD(i,r,l) for(int i=(r)-1; i>=(l); --i)
#define getbit(x, i) (((x) >> (i)) & 1)
#define MASK(i) (1 << (i))
using namespace std;
/// BigNum
const long long MOD = (long long)1e16;
typedef vector<long long> BigNum;
bool operator < (BigNum A, BigNum B) {
if (A.size() != B.size()) return A.size() < B.size();
REPD(i, (int)A.size(), 0) if (A[i] != B[i]) return A[i] < B[i];
return false;
}
bool operator <= (BigNum A, BigNum B) {
if (A.size() != B.size()) return A.size() < B.size();
REPD(i, (int)A.size(), 0) if (A[i] != B[i]) return A[i] < B[i];
return true;
}
BigNum operator + (BigNum A, BigNum B) {
BigNum C(max(A.size(), B.size()));
long long carry = 0;
REP(i, 0, C.size()) {
if (i < A.size()) carry += A[i];