|
|
back to boardWA 10 Posted by Ilia 26 Apr 2011 20:29 What's incorrect????? int main() { int n, k; scanf("%d %d", &n, &k); vector<int> mas(100);
mas.assign(100, -1); for (int i=0; i<n; i++) scanf("%d", &mas[i]); int s=n/k; if(n%k!=0) s++; for (int i=0; i<s; i++) { for(int j=0; j<k; j++) if (mas[s*j+i]!=-1) printf("%4d", mas[s*j+i]); printf("\n"); } return 0; } Edited by author 26.04.2011 20:30 Re: WA 10 vector<int>mas; mas.assign(111,-1); |
|
|