Submission #259989

#TimeUsernameProblemLanguageResultExecution timeMemory
259989ly20Lottery (CEOI18_lot)C++17
0 / 100
178 ms65540 KiB
#include <bits/stdc++.h> using namespace std; const int MAXN = 11234; int v[MAXN]; vector <int> in[MAXN]; //int dif[MAXN][MAXN]; map <vector <int>, int> mp; int main() { int id = 0; int n, l; scanf("%d %d", &n, &l); for(int i = 0; i < n; i++) { scanf("%d", &v[i]); } for(int i = 0; i + l - 1 < n; i++) { id++; for(int j = 0; j < l; j++) { in[i].push_back(v[i + j]); } mp[in[i]]++; } int q; scanf("%d", &q); for(int i = 0; i < q; i++) { int r; scanf("%d", &r); for(int j = 0; j < id; j++) { printf("%d ", mp[in[j]] - 1); } printf("\n"); } return 0; }

Compilation message (stderr)

lot.cpp: In function 'int main()':
lot.cpp:11: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:13:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &v[i]);
   ~~~~~^~~~~~~~~~~~~
lot.cpp:23:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d", &q);
  ~~~~~^~~~~~~~~~
lot.cpp:26:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d", &r);
   ~~~~~^~~~~~~~~~
#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...