Submission #3248334
Source Code Expand
#include <bits/stdc++.h> using namespace std; /***********************************************/ /* Dear online judge: * I've read the problem, and tried to solve it. * Even if you don't accept my solution, you should respect my effort. * I hope my code compiles and gets accepted. * ___ __ _______ _______ * |\ \|\ \ |\ ___ \ |\ ___ \ * \ \ \/ /|_\ \ __/| \ \ __/| * \ \ ___ \\ \ \_|/__\ \ \_|/__ * \ \ \\ \ \\ \ \_|\ \\ \ \_|\ \ * \ \__\\ \__\\ \_______\\ \_______\ * \|__| \|__| \|_______| \|_______| */ const long long mod = 1000000007; const int mxN = 100010; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int N,K; cin>>N>>K; vector<int> a(N); int ind = -1; for(int i = 0;i < N;i++) cin>>a[i], ind = a[i] == 1?i:ind; cout<<(N-1 + K - 2)/(K-1)<<'\n'; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Minimization |
User | vjudge2 |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 980 Byte |
Status | AC |
Exec Time | 9 ms |
Memory | 640 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample1.txt, sample2.txt, sample3.txt |
All | 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 | AC | 4 ms | 384 KB |
10.txt | AC | 7 ms | 512 KB |
2.txt | AC | 9 ms | 640 KB |
3.txt | AC | 5 ms | 512 KB |
4.txt | AC | 9 ms | 640 KB |
5.txt | AC | 9 ms | 640 KB |
6.txt | AC | 9 ms | 640 KB |
7.txt | AC | 2 ms | 256 KB |
8.txt | AC | 8 ms | 640 KB |
9.txt | AC | 1 ms | 256 KB |
sample1.txt | AC | 1 ms | 256 KB |
sample2.txt | AC | 1 ms | 256 KB |
sample3.txt | AC | 1 ms | 256 KB |