Exemple #1
0
 public LIB_FactorizedNumber(LIB_FactorizedNumber x)
 {
     foreach (var item in x)
     {
         this[item.Key] = item.Value;
     }
 }
Exemple #2
0
 public void Div(LIB_FactorizedNumber x)
 {
     foreach (var item in x)
     {
         this[item.Key] -= item.Value;
     }
 }
Exemple #3
0
 public void LCM(LIB_FactorizedNumber y)
 {
     foreach (var item in y)
     {
         this[item.Key] = Max(this[item.Key], item.Value);
     }
 }
Exemple #4
0
        public void GCD(LIB_FactorizedNumber y)
        {
            var removeKeys = new HashSet <long>(Keys);

            foreach (var item in y)
            {
                if (removeKeys.Contains(item.Key))
                {
                    removeKeys.Remove(item.Key);
                    this[item.Key] = Min(item.Value, this[item.Key]);
                }
            }
            foreach (var item in removeKeys)
            {
                Remove(item);
            }
        }
Exemple #5
0
 public bool Equals(LIB_FactorizedNumber x) => this == x;