TOPIC

PROBLEM 1452 - URI Fórum 1.0

URI Online Judge asked 6 years ago

URI Online Judge Fórum 1.0

MOD

This topic was solved and cannot recieve new replies.

  • Miguel Mendes replied 5 years ago

    Eu estava com o mesmo problema, WA 90%.

    A solução foi criar um script que gerasse aleatoriamente casos de teste e conferir se a saída do toolkit batia.

    Aqui vão casos de teste que eu usei.

    Ai sim eu consegui identificar.

    Entrada:

    1 1
    4 c b a f
    3 b a c
    3 3
    3 c a b
    4 b a c d
    3 a c b
    2 a b
    2 c a
    4 b c f e
    19 32
    16 ABR DQK KAT RGV TIV VQI WEF VPY ISA NNV GXL PEU UVA AXQ SJH EAQ
    6 MQE AMY RBC LYI AWP VHK
    20 OJL NTW DRY WEG AJV GMJ SBZ HPL UOC MDE QEQ PKM TWQ WKC AVQ DQD UVS GKB FWM DNO
    15 VYN IMF TFO LSL QYM YFH TSI VCX HBP WZR WOY LMK KNI ZWT LNC
    11 VXB AZI XKI ECW TPH ABI RBJ AKJ SWY OCV NLC
    15 JWN GRG IVL ZHS RKG JGL UVM RAM TDQ SMN ODR XPU VWI QVY ZCZ
    5 OQZ VRE CZD CRW JMO
    15 KKU PDQ APL KQS HLY RNS UAM YMZ KFC XWG XUU RBY YPT AKF EIK
    1 TXL
    13 MEA IUK LUK XGB MXZ BCL HBV AOZ WOX EAR LXG JQW LQB
    3 ETQ WJL VNH
    15 PGK EMQ JLQ BAI XRY QMV BWS LGI DJS LSJ ITF NRL TVI KVK FHP
    4 GLW CFJ HRG VFH
    7 LUW LDZ XTX BRH WJE LVD NCG
    1 FCJ
    2 QXD MPI
    2 QLS MWQ
    10 IUQ PEK WFW KMA SXU JCT HHK JDC XCA EKR
    8 ECW YYY TGN EGX OSI ORG MKA ZHI
    3 IUQ JGL WKC
    5 GKB KQS EAR AVQ TFO
    11 WEG FHP RBC HBP YYY IVL SMN WKC PDQ ETQ JQW
    7 APL PKM VXB MXZ WZR JQW YMZ
    13 CZD SJH ABR AKF AVQ RNS GMJ GXL YYY TGN CFJ SWY VNH
    10 HBP VWI WEG KNI MXZ BAI ITF AWP DQD TPH
    6 QEQ ECW WZR NRL QLS QYM
    6 VWI GMJ JLQ IVL GMJ XGB
    12 OQZ GXL WJL WZR SWY ITF XUU NRL FWM ZCZ EMQ WOX
    18 HPL RBY MXZ MDE UVA SMN LUW ABI XKI MXZ PGK GLW JWN DNO WKC GRG JGL PEU
    8 ORG UVA RBY FWM BRH WJL LDZ DQD
    11 DNO CZD KFC XRY JCT NTW VPY EAR LGI ITF QEQ
    3 XGB VCX LMK
    5 ABI VPY WKC OJL VNH
    4 XWG GRG PEU YMZ
    1 RBY
    20 VXB QYM HLY HBP JGL UVA KMA RGV ISA UVM IUQ YMZ VRE SBZ HPL JWN MKA LVD JQW ABR
    19 YPT EKR ABI RBY OJL IMF LVD TFO RGV ECW GKB GRG HLY UAM EGX SJH UVS RBC ISA
    8 ZHS ORG ECW TGN JDC HHK TDQ BRH
    20 ABR LNC ISA TGN PKM KVK AMY VFH SWY LXG IVL HHK EAR RGV LXG WZR ZCZ ZHS HRG ECW
    13 YYY WKC XCA LNC MDE WZR FCJ PEU VNH NLC YYY HPL EAQ
    1 VHK
    2 LDZ XRY
    19 JQW WEF MXZ JCT KKU YPT DQK JWN DQK FCJ GLW KFC RAM VCX GKB TDQ SMN ZCZ JGL
    11 IVL HPL PGK ZHS KMA AOZ WJL WKC NNV CRW AXQ
    6 ZHI KMA KMA QXD ZHI HLY
    16 BRH ECW AKJ ODR QYM KAT VFH GMJ EMQ KAT BAI DQK ABI FCJ TSI MQE
    9 ZHS HPL LSL GKB XCA MEA CRW JLQ EGX
    12 PEK BRH VRE VYN JCT BCL RBJ TIV YFH CRW OCV XTX
    15 LGI LGI ZHS LMK ZHI ECW DRY MPI TXL TGN GRG WJL VRE SBZ TSI
    14 GLW ECW DJS VNH BCL WEF KNI QXD XWG SJH NNV SMN MQE MXZ
    13 XGB GRG MPI VNH LSL JDC LUW JDC IUQ LSL TWQ TFO RBY
    36 2
    17 AWF SVU QYQ SVH TKB HAU PQA DRV VYA KZA WOP FMP OGK PEZ KLR PWA HVJ
    18 HSO ADU IVI EXW FNP TQI VQG NMC RPL GAG BPA ZCP IOX HDR EHG HTV KQB AKR
    17 PNM BJD QPG RLY GHK LCG ZCD TZQ VQF CVP STK FMM TFL WRD OFQ IMQ MZZ
    18 AIW ROD PWI MHQ ZTE MKR PCM UBE WWR BQG CBI ZEA NCA PRU OPD YED FPG MHW
    15 DCI IEO NXD FQQ VGN WCK NIL HBR EUE YZV RFV XWU QKE WAF YOH
    13 AVU FPT DYU DPF MRB OTI WNO MPX HXU CWL UVY PRO ZZR
    6 NOG VJD CTR HVQ XMW ASA
    11 FIL GYR UAL ZNS KMZ ZZZ BRU TOG IOR TDX WSR
    18 VQD VRD FYB CHG HBS COI IJU QDZ RRJ GBX IGY BCL KWM NTH YZG BXG VCN BOL
    7 XOM TOH RUW PDL PMY XAB UMA
    19 QVH CZE WXM RWJ PGE NWL QWJ QJD OVB AND VQS MST LAV FSN GJZ ABW PSX XPT FNZ
    16 WOD JXX EJB VKQ QOH VFW HUC YNU NGR YVW NFW VHG WDR SUH CYG TTR
    18 CCV DXX DOQ OKI PXO RQT YOX FOS HNT DXD RMH JLA BGQ UUY LYI ZEX WDD MLD
    13 RMA OHP GXI NJI YPO GQX GHM REY MIN BWB PSZ CSW LUQ
    7 EFQ QNS MOB NWM ROC VSN HMG
    4 SXI ISE HLD KBE
    17 WML QCB OGA HZJ NWL FGX JMR BKH TEJ KUX EDD TOB LYY UKG WRC OAA WEV
    16 IXY SBE UVJ WSC YWU ZLE SEE MYF ANR RQN TAY PMJ KAV AUB YLE XLN
    5 EMW DMU HRN LRQ BGV
    15 IEV CXB MRO NAC MDO CNZ OEY DPL QJU RYD MVI JEN IXN XCZ VBB
    5 SEA APT GZO YNE OGA
    10 UAY UPS OHQ KUZ XCW ZYO TIG QJL NPZ HEZ
    14 COG DVV FSX OJH DWB OWR ZVI SKI TLU ENK MVE QEN ZVY EOU
    9 PWT DNU TIO MWG SFP QBF DRN FAT YNL
    19 HKH RTV SXV QOG DQH OGH PTO AFB MSV DYL ELG BGF JTA UPB OJI UCM TPC UGX WEB
    4 NQD DWV LCY WQE
    13 DKC RCC PZF FIV ZMY NIP SWH NDX CHX XEJ LOI FKQ DPO
    8 NNZ WOH WTK NQG RLY QXD ZLJ NQQ
    5 MSQ SQX DSF KQF ZDN
    13 UBA MVV CHT VEZ LHG HFC YPN NDA FMO LLK SJN XDB HVI
    9 JPT DTF IAF UXY QJS UBF YNW UZM ENH
    1 XXL
    4 HAI DNI FSM PCF
    20 VTM MRR KFC WJZ NOO GUP OGQ ART JPE MVB FFO JON AIP NOI XHE DLY RPS HGP QXB GXD
    14 YIP YZM WDK EYM FIZ JWS SOB FNN ACH OAA MGS XZW WEX XKZ
    2 DMB QEJ
    15 GXD BWB PNM OGA EYM IXN VTM MRB ZZR WEV XEJ HEZ OTI YLE KUZ
    7 VBB YWU RQN UBF QEJ BCL KQB
    9 20
    18 TF WX TN HC KG OI IK EU VN ZB GP IC OA ZI BL DN FW IP
    4 QS XS IU HY
    1 OK
    12 UD WJ FS WZ ZK BU HY WI AF YH ZP KD
    6 ZO KI TL ZA AU YU
    13 TJ TQ UJ JV WQ BF JW JX UG JQ CN VC FA
    5 SM ZD NN VW JL
    20 RY MT MK PJ IQ BO MT NX WO QA AL KG MN YX WI VH NW JO EH TE
    1 TA
    5 ZD UG OK EU KG
    15 JQ AU FW JO BL YX OA ZP BO JO JO FS MN KD WI
    4 VH WJ OI KD
    8 NN YX VW YX QA AF WI QS
    13 WI WX BU EU ZB MN BU GP JX KD EU MK QA
    18 FS IK BU OK BO JX IC ZA JQ ZP GP WZ ZB RY BU GP DN OA
    2 FW VH
    8 MK DN KG ZA TL FW XS MN
    2 AL QA
    3 MT NN KG
    2 WI UG
    2 QS ZD
    14 TF FS KD ZB ZB FS JL WI BL YX SM ZP BO IP
    17 JW TQ WI WX BU HY KG NX EU HY XS ZO JV WJ TF FA ZP
    18 WZ TE WQ TL ZI BU JL BF PJ WO VN AU JL QA TJ UD BL XS
    13 WI HY MK IK AL TN AF KI JW TL JV VC KI
    15 JX ZA MT WZ TA ZP AU TQ NX MT WZ RY WZ OI PJ
    20 KI XS BO XS OI FW WO XS HC TQ BL VN BO YX OI KG MN HY IU JO
    1 JQ
    13 OK YH ZP FA MT ZP CN RY XS JQ FW UJ SM
    0 0

    Saida:

    1
    9
    214
    17
    85
  • Jean Marcos da Rosa replied 6 years ago

    Alguém pode me dar uma dica? Já tentei vários casos de testes, escrevi dos mais diversos, e todos batem com o resultado do toolkit :(

  • Jean Marcos da Rosa replied 6 years ago

    Segue meu código, pois este caso de teste também esta funcionando para mim, e levei wrong answer (90%) com ele, se puder me indicar onde estou pecando agradeço, já revisei todo o código e não consegui imaginar onde esteja errando :P

    //Gloud Computing
    
    #include <iostream>
    #include <cstdlib>
    #include <cmath>
    #include <stdio.h>
    #include <map>
    #include <vector>
    #include <algorithm>
    
    using namespace std;
    
    int main(){
        int n, m, a;
        string aplicacao;
        while((cin >> n >> m)&&(n!=0||m!=0)){
            map<string, vector<int> > g;
            int soma=0;
            for(int i=0; i<n; i++){
                cin >> a;
                for(int j=0;j<a;j++){
                    cin >> aplicacao;
                    g[aplicacao].push_back(i);
                }
            }
            for(int i=0;i<m;i++){
                vector<int> connectados, servers;
                cin >> a;
                for(int j=0;j<a;j++){
                    cin >> aplicacao;
                    servers = g[aplicacao];
                    //cout << endl << endl << "Aplicacao: " << aplicacao << ", Servers: ";
                    for(vector<int>::iterator it=servers.begin(); it!=servers.end();++it){
                    //    cout << " " << *it ;
                        if(!binary_search(connectados.begin(), connectados.end(), *it)) connectados.push_back(*it);
                    }
                    //cout << "\n";
                }
                soma+=connectados.size();
            }
            cout << soma << "\n";
        }
        return EXIT_SUCCESS;
    }
  • Cristhian Bonilha replied 6 years ago

    Alguns:

    1 1
    3 a b c
    3 a b c
    3 3
    3 a b c
    3 a b c
    3 a b c
    2 a b
    2 a c
    2 b c
    0 0

    Mais do que isso, só vendo o seu código mesmo.

  • Jean Marcos da Rosa replied 6 years ago

    Olá, alguém poderia postar mais alguns casos de teste, estou levando wrong answer porém com os exemplos do problema esta funcionando :/