Submission #3272163
Source Code Expand
#include<bits/stdc++.h> using namespace std; int main() { int n,k,i,x; scanf("%d%d",&n,&k); for(i=1;i<=n;++i) { scanf("%d",&x); if(x==1)return 0*printf("%d",(i-1+k-2)/(k-1)+(n-i+k-2)/(k-1)); } }
Submission Info
Submission Time | |
---|---|
Task | C - Minimization |
User | ditoly |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 214 Byte |
Status | WA |
Exec Time | 9 ms |
Memory | 256 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:6:21: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d%d",&n,&k); ^ ./Main.cpp:9:17: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&x); ^
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | 3 ms | 256 KB |
10.txt | AC | 7 ms | 256 KB |
2.txt | AC | 8 ms | 256 KB |
3.txt | AC | 5 ms | 256 KB |
4.txt | WA | 1 ms | 256 KB |
5.txt | WA | 5 ms | 256 KB |
6.txt | WA | 3 ms | 256 KB |
7.txt | AC | 1 ms | 256 KB |
8.txt | AC | 9 ms | 256 KB |
9.txt | WA | 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 |