답안 #259989

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
259989 2020-08-08T21:40:56 Z ly20 Lottery (CEOI18_lot) C++17
0 / 100
178 ms 65540 KB
#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

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);
   ~~~~~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 512 KB Output is correct
2 Incorrect 1 ms 640 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 512 KB Output is correct
2 Incorrect 1 ms 640 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 1024 KB Output is correct
2 Correct 6 ms 1152 KB Output is correct
3 Correct 7 ms 1152 KB Output is correct
4 Correct 46 ms 12792 KB Output is correct
5 Runtime error 178 ms 65540 KB Execution killed with signal 9 (could be triggered by violating memory limits)
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 1024 KB Output is correct
2 Correct 6 ms 1152 KB Output is correct
3 Correct 7 ms 1152 KB Output is correct
4 Correct 46 ms 12792 KB Output is correct
5 Runtime error 178 ms 65540 KB Execution killed with signal 9 (could be triggered by violating memory limits)
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 512 KB Output is correct
2 Incorrect 1 ms 640 KB Output isn't correct
3 Halted 0 ms 0 KB -