Submission #260711

#TimeUsernameProblemLanguageResultExecution timeMemory
260711biggLottery (CEOI18_lot)C++14
0 / 100
331 ms65536 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] -1 ); for(int i = l + 1; i <= n; i++){ v.pop(); v.push(a[i]); printf("%d ", freq[v] - 1); } 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...