示例#1
0
int main() {
    long long n ;
    long long a,b;
    int T;
    scanf("%d",&T);
    while(T-->0) {
        scanf("%lld %lld",&a,&b);
        if(b>mn) b = mn;
        if(a>mn) a = mn;
        long long ans=0;
        /* for(long long i=a;i<=b;i++){
                  if(isdel(i)){
                     ans++;
                  }
         }
         printf("%lld\n",ans);*/
        if(a>=mn&&b>=mn) {
            printf("0\n");
            return 0;
        }
        bool isa = isdel(a);
        printf("%lld\n",dop(b)-dop(a)+(isa?1:0));
    }
    //  scanf("%lld",&n);
}
示例#2
0
/**
 * Prosesses NMEA GPGSA sentences
 * \param[in] Buffer for parsed nmea GPGSA sentence
 */
void NMEAParser::nmeaProcessGPGSA(char* packet)
{
        // start parsing just after "GPGSA,"
        // attempt to reject empty packets right away
        if(packet[6]==',' && packet[7]==',')
                return;

        if(!nmeaChecksum(packet)) {
            // checksum not valid
            return;
        }
        nmeaTerminateAtChecksum(packet);

        QString nmeaString( packet );
        QStringList tokenslist = nmeaString.split(",");

        // M=Manual, forced to operate in 2D or 3D
        // A=Automatic, 3D/2D
        QString fixmodeValue = tokenslist.at(1);
        if (fixmodeValue == "A") {
            emit fixmode(QString("Auto"));
        } else if (fixmodeValue == "B") {
            emit fixmode(QString("Manual"));
        }

        // Mode: 1=Fix not available, 2=2D, 3=3D
        int fixtypeValue = tokenslist.at(2).toInt();
        if (fixtypeValue == 1) {
            emit fixtype(QString("NoFix"));
        } else if (fixtypeValue == 2) {
            emit fixtype(QString("Fix2D"));
        } else if (fixtypeValue == 3) {
            emit fixtype(QString("Fix3D"));
        }

        // 3-14 = IDs of SVs used in position fix (null for unused fields)
        QList<int> svList;
        for(int pos = 0; pos < 12;pos ++) {
            QString sv = tokenslist.at(3+pos);
            if(!sv.isEmpty()) {
                svList.append(sv.toInt());
            }
        }
        emit fixSVs(svList);

        // 15   = PDOP
        // 16   = HDOP
        // 17   = VDOP
        GpsData.PDOP = tokenslist.at(15).toDouble();
        GpsData.HDOP = tokenslist.at(16).toDouble();
        GpsData.VDOP = tokenslist.at(17).toDouble();
        emit dop(GpsData.HDOP, GpsData.VDOP, GpsData.PDOP);
}
void CompilerStatsInfo :: translateToExternalFormat(SQL_QUERY_COMPILER_STATS_INFO *query_comp_stats_info, short xnReqd)
{
  query_comp_stats_info->affinityNumber
    = affinityNumber();

  query_comp_stats_info->dop
    = dop();

  query_comp_stats_info->xnNeeded
    = xnReqd;

  query_comp_stats_info->mandatoryCrossProduct
    = mandatoryCrossProduct();

  query_comp_stats_info->missingStats
    = missingStats();
  query_comp_stats_info->numOfJoins
    = totalJoins();
	      
  query_comp_stats_info->fullScanOnTable
    = fullScanOnTable();

  query_comp_stats_info->highDp2MxBufferUsage
    = 0;  // this data member is not present in the TDB yet

  query_comp_stats_info->rowsAccessedForFullScan
    = dp2RowsAccessedForFullScan();

  query_comp_stats_info->dp2RowsAccessed
    = dp2RowsAccessed();

  query_comp_stats_info->dp2RowsUsed
    = dp2RowsUsed();
  query_comp_stats_info->statsCollectionType 
    = collectStatsType();
  query_comp_stats_info->numOfBmos 
    = bmo();
  query_comp_stats_info->numOfUdrs
    = udr();
  query_comp_stats_info->overflowMode
    = ofMode();
  query_comp_stats_info->overflowSize
    = ofSize();
  query_comp_stats_info->queryType
    = queryType();
  query_comp_stats_info->subqueryType
    = subqueryType();
 

}