hiho week 186 register

Ended

Participants:166

Verdict:Accepted
Score:100 / 100
Submitted:2018-01-23 21:54:32

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<cstdio>
#include<iostream>
#include<string>
#include<cstring>
#include<vector>
#include<unordered_map>
using namespace std;
typedef long long ll;
// copy n times starting at (x, y)
void ncopy(const vector<int> &nums,int n,int m,ll &x,int &y){
    for(int i = 0; i < n; ++i){
        for(int j = 0; j < (int)nums.size(); ++j){
            if(y == m)
                y = 0, ++x;
            ++y;
            if(y+nums[j] > m)
                y = 0, ++x;
            y += nums[j];
        }
    }
}
int main(){
    int n,m;
    scanf("%d%d",&n,&m);
    vector<int> words;
    string str;
    while(cin>>str)
        words.push_back(str.size());
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX