#2211172

Solution for 0029: English Sentence by chiwawa_star

Source Code Status Test Cases
    Policy: public     Reviewed: 45    
00.00 sec    3004 KB    33 lines     753 bytes    2017-03-07 02:05
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++) 
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
int main()
{
    string S;
    vector<string> vc;
    while( cin >> S ){
        vc.emplace_back( S );
    }
    int tmp{}, tmp2{},  MAX{}, MAXS{}, res{}, res2{};
    REP( i, (int)vc.size() )
    {
        tmp = count( ALL(vc), vc[ i ] );
        tmp2 = vc[ i ].size();
        if( MAX < tmp )
        {
            MAX = tmp;
            res = i;
        }
        if( MAXS < tmp2 )
        {
            MAXS = tmp2;
            res2 = i;
        }
    }
    cout << vc[ res ] << " " << vc[ res2 ] << endl;
    return 0;
}

Compile Error Logs:
You are not authorized to see the message.

Status
Judge: 1/1 C++14 CPU: 00.00 sec Memory: 3004 KB Length: 753 B 2017-03-07 02:05 2017-03-07 02:05
Results for testcases
Case # Verdict CPU Time Memory In Out Case Name
Case #1: : Accepted 00.00 sec 3004 KB
< prev | / | next >  
 
Judge Input #  ( | ) Judge Output #  ( | )


Comments
 
 Under Construction.
 
Categories
 
 
Free Tags