标签:queue cstring its 技术分享 pac div closed c++ spl
A
/*#include<cstring>#include<algorithm>#include<queue>#include<vector>#include<cstdio>#include<cmath>#include<iostream>*/ #include<bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 300005; int main() { int k, n, s, p; cin >> k >> n >> s >> p; int ans = n / s + (1 - (n % s == 0)); ans *= k; cout << ans / p + (1 - (ans % p == 0)) << endl; return 0; }
B
/*#include<cstring>#include<algorithm>#include<queue>#include<vector>#include<cstdio>#include<cmath>#include<iostream>*/ #include<bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 300005; char f[105][105]; int ans; int aimc = 1; int aimr = 1; int flag; int now; int main() { int n, k; cin >> n >> k; for (int i = 1; i <= n; i++) { scanf("%s", f[i] + 1); } for (int i = 1; i <= n; i++) { for (int j = 1; j <= n; j++) { if (f[i][j] == ‘#‘) { continue; } now = 0; for (int dx = j - k + 1; dx <= j; dx++) { if (dx + k > n + 1) { break; } if (dx < 1) { continue; } flag = 1; for (int w = dx; w <= dx + k - 1; w++) { if (f[i][w] == ‘#‘) { flag = 0; break; } } if (flag) { now++; } } for (int dy = i - k + 1; dy <= i; dy++) { if (dy + k > n + 1) { break; } if (dy < 1) { continue; } flag = 1; for (int w = dy; w <= dy + k - 1; w++) { if (f[w][j] == ‘#‘) { flag = 0; break; } } if (flag) { now++; } } if (now > ans) { ans = now; aimc = i, aimr = j; } } } cout << aimc << " " << aimr << endl; return 0; }
C
D
标签:queue cstring its 技术分享 pac div closed c++ spl
原文地址:https://www.cnblogs.com/Aragaki/p/8955664.html