hiho week 62 register

Ended

Participants:714

Verdict:Accepted
Score:100 / 100
Submitted:2015-09-05 23:17:24

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "iostream"
using namespace std;
#include "string"
#include "map"
map<string, int>ans;
string s[1000000];
int main()
{
    
    int a = 1,cnt=0;
    int m, n;
    cin >> m >> n;
    for (int i = 1; i <= m; i++)
    {
        cin >> s[i];
    }
    for (int i = 1; i <= m; i++)
    {
        if (ans[s[i]] >= a&&ans[s[i]] <= i)
        {
            cout << "Cache" << endl;
        }
        else
        {
            cnt++;
            if (cnt > n)
            {
                a++;
                
            }
            cout << "Internet" << endl;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX