Submission #2722132


Source Code Expand

Copy
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <queue>
#include <utility>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;

#define For(i, a, b) for(int i = (a); i < (b); i++)
#define Rep(i, n) For(i, 0, (n))
#define Rrep(i, n) for(int i = (n - 1); i >= 0; i--)
#define pb push_back

const int inf = 999999999;
const int mod = 1000000007;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

int main(){
	int n, k, l = 0; cin >> n >> k; n--; k--;
	Rep(i, n){
		int t; cin >> t;
	}
	int ans = (n % k == 0) ? n / k : n / k + 1;
	cout << ans << endl;
}

Submission Info

Submission Time
Task C - Minimization
User niimi
Language C++14 (GCC 5.4.1)
Score 300
Code Size 698 Byte
Status
Exec Time 36 ms
Memory 256 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample1.txt, sample2.txt, sample3.txt
All 300 / 300 sample1.txt, sample2.txt, sample3.txt, 1.txt, 10.txt, 2.txt, 3.txt, 4.txt, 5.txt, 6.txt, 7.txt, 8.txt, 9.txt, sample1.txt, sample2.txt, sample3.txt
Case Name Status Exec Time Memory
1.txt 15 ms 256 KB
10.txt 28 ms 256 KB
2.txt 36 ms 256 KB
3.txt 20 ms 256 KB
4.txt 34 ms 256 KB
5.txt 35 ms 256 KB
6.txt 36 ms 256 KB
7.txt 3 ms 256 KB
8.txt 31 ms 256 KB
9.txt 1 ms 256 KB
sample1.txt 1 ms 256 KB
sample2.txt 1 ms 256 KB
sample3.txt 1 ms 256 KB