mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 17:51:58 +00:00
parent
b1d87c3ee5
commit
e4083fecd7
47
S2OJ/1566/1566.cpp
Normal file
47
S2OJ/1566/1566.cpp
Normal file
@ -0,0 +1,47 @@
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
|
||||
using std::cin;
|
||||
using std::cout;
|
||||
const char endl = '\n';
|
||||
|
||||
const int N = 1e6 + 5;
|
||||
|
||||
int main() {
|
||||
std::ios::sync_with_stdio(false);
|
||||
cin.tie(nullptr);
|
||||
|
||||
int t;
|
||||
|
||||
cin >> t;
|
||||
|
||||
while (t--) {
|
||||
int n, k;
|
||||
|
||||
cin >> n >> k;
|
||||
|
||||
std::vector<int> a(1), b(1), c(n + 1), d(n + 2);
|
||||
|
||||
std::copy_n(std::istream_iterator<int>(cin), n, std::back_inserter(a));
|
||||
std::copy_n(std::istream_iterator<int>(cin), n, std::back_inserter(b));
|
||||
|
||||
for (int i = 1; i <= n; i++) {
|
||||
c[i] = b[i] - a[i];
|
||||
}
|
||||
|
||||
for (int i = 1; i <= n; i++) {
|
||||
d[i] = c[i] - c[i - 1];
|
||||
}
|
||||
|
||||
for (int i = 1; i + k - 1 <= n; i++) {
|
||||
d[i + k] += d[i];
|
||||
d[i] = 0;
|
||||
}
|
||||
|
||||
cout << (std::count(d.begin() + 1, d.begin() + 1 + n, 0) == n ? "YES" : "N0") << endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
BIN
S2OJ/1566/data/dispatch1.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch1.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch1.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch1.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch10.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch10.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch10.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch10.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch100.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch100.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch100.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch100.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch11.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch11.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch11.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch11.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch12.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch12.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch12.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch12.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch13.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch13.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch13.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch13.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch14.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch14.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch14.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch14.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch15.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch15.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch15.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch15.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch16.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch16.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch16.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch16.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch17.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch17.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch17.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch17.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch18.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch18.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch18.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch18.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch19.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch19.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch19.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch19.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch2.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch2.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch2.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch2.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch20.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch20.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch20.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch20.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch21.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch21.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch21.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch21.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch22.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch22.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch22.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch22.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch23.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch23.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch23.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch23.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch24.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch24.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch24.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch24.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch25.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch25.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch25.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch25.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch26.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch26.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch26.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch26.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch27.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch27.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch27.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch27.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch28.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch28.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch28.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch28.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch29.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch29.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch29.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch29.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch3.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch3.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch3.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch3.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch30.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch30.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch30.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch30.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch31.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch31.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch31.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch31.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch32.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch32.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch32.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch32.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch33.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch33.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch33.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch33.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch34.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch34.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch34.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch34.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch35.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch35.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch35.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch35.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch36.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch36.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch36.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch36.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch37.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch37.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch37.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch37.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch38.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch38.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch38.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch38.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch39.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch39.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch39.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch39.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch4.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch4.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch4.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch4.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch40.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch40.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch40.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch40.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch41.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch41.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch41.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch41.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch42.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch42.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch42.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch42.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch43.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch43.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch43.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch43.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch44.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch44.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch44.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch44.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch45.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch45.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch45.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch45.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch46.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch46.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch46.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch46.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch47.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch47.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch47.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch47.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch48.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch48.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch48.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch48.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch49.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch49.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch49.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch49.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch5.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch5.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch5.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch5.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch50.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch50.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch50.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch50.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch51.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch51.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch51.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch51.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch52.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch52.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch52.out
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch52.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
S2OJ/1566/data/dispatch53.in
(Stored with Git LFS)
Normal file
BIN
S2OJ/1566/data/dispatch53.in
(Stored with Git LFS)
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user