Submission #260709

#TimeUsernameProblemLanguageResultExecution timeMemory
260709biggLottery (CEOI18_lot)C++14
0 / 100
5 ms384 KiB
#include<bits/stdc++.h>
using namespace std;
map<queue<int>, int > freq;
const int MAXN = 1e4 + 10;
int n, l;
int a[MAXN];
queue<int> v;
int main(){
	scanf("%d %d", &n, &l);
	for(int i = 1; i <= n; i++)scanf("%d", &a[i]);
	for(int i = 1; i <= l; i++)v.push(a[i]);
	freq[v]++;
	for(int i = l + 1; i <= n; i++){
		v.pop();
		v.push(a[i]);
		freq[v]++;
	}
	while(!v.empty()) v.pop();
	int q, k;
	scanf("%d", &q);
	scanf("%d", &k);
	for(int i = 1; i <= l; i++)v.push(a[i]);
	printf("%d ",freq[v] );
	for(int i = l + 1; i <= n; i++){
		v.pop();
		v.push(a[i]);
		printf("%d ", freq[v]);
	}
	printf("\n");
}

Compilation message (stderr)

lot.cpp: In function 'int main()':
lot.cpp:9:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d", &n, &l);
  ~~~~~^~~~~~~~~~~~~~~~~
lot.cpp:10:34: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int i = 1; i <= n; i++)scanf("%d", &a[i]);
                             ~~~~~^~~~~~~~~~~~~
lot.cpp:20:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &q);
  ~~~~~^~~~~~~~~~
lot.cpp:21:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &k);
  ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...