I'm so burnt out rn
This commit is contained in:
parent
0887d8f969
commit
65b8ebda4c
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env lua
|
||||
local read = io.read
|
||||
local print = print
|
||||
|
||||
for t = 1, read('*n') do
|
||||
local s, w1, w2, w3 = read('*n', '*n', '*n', '*n')
|
||||
if w1 + w2 + w3 <= s then
|
||||
print(1)
|
||||
elseif w1 + w2 <= s or w2 + w3 <= s then
|
||||
print(2)
|
||||
else
|
||||
print(3)
|
||||
end
|
||||
end
|
|
@ -0,0 +1,33 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int min(int a, int b)
|
||||
{
|
||||
return (a < b) ? a : b;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
int t, n, m;
|
||||
|
||||
scanf("%d", &t);
|
||||
while (t--) {
|
||||
scanf("%d %d", &n, &m);
|
||||
size_t a[n][m];
|
||||
for (int i = 0; i < n; ++i)
|
||||
for (int j = 0; j < m; ++j)
|
||||
scanf("%zu", a[i] + j);
|
||||
|
||||
size_t count = 0;
|
||||
for (int i = 0; i < n; ++i)
|
||||
for (int j = 0; j < m; ++j) {
|
||||
int max = min(min(i, j), min(n-i, m-j)-1);
|
||||
for (int k = 0;
|
||||
k <= max && a[i+k][j] == a[i-k][j]
|
||||
&& a[i][j+k] == a[i][j-k];
|
||||
count++, ++k);
|
||||
}
|
||||
printf("%zu\n", count);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
for t in range(int(input())):
|
||||
n = 10 ** int(input())
|
||||
print(n*2 + int(input()), flush=True)
|
||||
print(n - int(input()), flush=True)
|
||||
print(n - int(input()), flush=True)
|
||||
input()
|
Loading…
Reference in New Issue