恋爱SLG 最终关

题干是啥也忘了。。直接贴代码喽

T1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
n = int(input())
target = [[] for i in range(n)]
for i in range(0, n):
target[i] = input().split()
m = int(input())
pattern = [[] for i in range(m)]
for i in range(0, m):
pattern[i] = input().split()
for i in range(0, n - m + 1):
for j in range(0, n - m + 1):
if target[i][j] == pattern[0][0]:
# print(i, j)
flag = True
for k in range(i, i + m):
for l in range(j, j + m):
if target[k][l] != pattern[k - i][l - j]:
flag = False
if flag == True:
print(i, j)

T2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <bits/stdc++.h>

using namespace std;

int X, Y, Z, N, t1, t2;
vector<int> va, vb;
set<int> sa, sb;

int main() {
cin>>X>>Y>>Z>>N;
for(int i = 1; i <= N; ++i) {
cin>>t1>>t2;
if(t1) vb.push_back(t2);
else va.push_back(t2);
}
sort(va.begin(), va.end());
sort(vb.begin(), vb.end());
if(va.size()) {
sa.insert(va[0]);
for(int i = 1; i < va.size(); ++i) {
sa.insert(va[i] - va[i - 1]);
}
sa.insert(X - va[va.size() - 1]);
} else sa.insert(X);
if(vb.size()) {
sb.insert(vb[0]);
for(int i = 1; i < vb.size(); ++i) {
sb.insert(vb[i] - vb[i - 1]);
}
sb.insert(X - vb[vb.size() - 1]);
} else sb.insert(Y);
cout<<((*sa.begin()) * (*sb.begin()) * Z)<<endl;
return 0;
}

T3

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <bits/stdc++.h>

using namespace std;

long long ans = 1;

int main() {
//for(int k = 1; k <= 52; ++k) {
int k; cin >> k; ans = 1;
if(!k) return puts("1"), 0;
for(int i = k; i >= 1; --i) {
int j = i;
while(j % 10 == 0) j /= 10;
ans *= j;
while(ans % 10 == 0) ans /= 10;
//while(ans % 10 == 0) ans /= 10;
ans %= 10000000000;
//cout<<i<<" "<<(long long)ans<<endl;
}
cout<<ans % 1000000000<<endl;
//}
return 0;
}

死库水!

Author

LittleRewriter

Posted on

2018-02-23

Updated on

2021-07-28

Licensed under

Comments