Submission #74652907
Source Code Expand
#include <bits/stdc++.h>
using ull = unsigned long long int;
using ll = long long int;
using lll = __int128;
using namespace std;
const int mod = 1e9 + 7;
int d[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
inline string sread() {
string s;
char ch = getchar();
// 跳过空白字符
while (ch == ' ' || ch == '\n' || ch == '\r') ch = getchar();
// 读取非空白字符
while (ch != ' ' && ch != '\n' && ch != '\r' && ch != EOF) {
s += ch;
ch = getchar();
}
return s;
}
ll read(){
ll k = 0,f = 1;
char c = getchar();
while(c < '0' || c > '9')
{
if(c == '-')f = -1;
c = getchar();
}
while(c >= '0' && c <= '9')k = k * 10 + c - '0',c = getchar();
return k * f; // 别忘记标记的负数要乘进去
}
// 调用时用 n = in();
void print(ll x){
if(x < 0)putchar('-'),x = -x;
if(x < 10)putchar(x + '0');
else print(x / 10),putchar(x % 10 + '0');
}
// 直接调用 out(n) 就行了
ll ksm(ll base, ll e){
ll res = 1;
while(e){
if(e & 1){
res = res * base % mod;
}
base = base * base % mod;
e >>= 1;
}
return res;
}//ksm板子
vector<vector<ll>> matrix_mul (vector<vector<ll>>& a, vector<vector<ll>>& b) {
int l1 = a.size(), l2 = b[0].size();
vector<vector<ll>>res(l1, vector<ll>(l2, 0));
for(int i = 0; i < l1; i++){
for(int k = 0; k < a[0].size(); k++){
if(a[i][k]){
for(int j = 0; j < l2; j++){
res[i][j] = (res[i][j] + a[i][k] * b[k][j]);
}
}
}
}
return res;
}// 矩阵a * 矩阵b(矩阵乘法)
void Solve(){
int n = read(), m = read();
vector<vector<char>>ans(n, vector<char>(m, '.'));
for(int j = 0; j < m; j++){
ans[0][j] = '#';
ans[n - 1][j] = '#';
}
for(int i = 0; i < n; i++){
ans[i][0] = ans[i][m - 1] = '#';
}
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
cout << ans[i][j];
}
cout << '\n';
}
}
signed main(){
int T = 1;
while(T--){
Solve();
}
return 0;
}
Submission Info
Submission Time
2026-04-04 21:09:06+0900
Task
B - Draw Frame
User
wmxw
Language
C++23 (GCC 15.2.0)
Score
200
Code Size
2250 Byte
Status
AC
Exec Time
2 ms
Memory
3620 KiB
Compile Error
./Main.cpp: In function 'std::vector<std::vector<long long int> > matrix_mul(std::vector<std::vector<long long int> >&, std::vector<std::vector<long long int> >&)':
./Main.cpp:53:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
53 | for(int k = 0; k < a[0].size(); k++){
| ~~^~~~~~~~~~~~~
Judge Result
Set Name
Sample
All
Score / Max Score
0 / 0
200 / 200
Status
Set Name
Test Cases
Sample
00_sample_00.txt, 00_sample_01.txt
All
00_sample_00.txt, 00_sample_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt
Case Name
Status
Exec Time
Memory
00_sample_00.txt
AC
1 ms
3472 KiB
00_sample_01.txt
AC
1 ms
3492 KiB
01_random_02.txt
AC
1 ms
3564 KiB
01_random_03.txt
AC
2 ms
3584 KiB
01_random_04.txt
AC
1 ms
3608 KiB
01_random_05.txt
AC
1 ms
3468 KiB
01_random_06.txt
AC
1 ms
3500 KiB
01_random_07.txt
AC
1 ms
3584 KiB
01_random_08.txt
AC
1 ms
3584 KiB
01_random_09.txt
AC
1 ms
3604 KiB
01_random_10.txt
AC
1 ms
3620 KiB
01_random_11.txt
AC
1 ms
3432 KiB
01_random_12.txt
AC
1 ms
3620 KiB
01_random_13.txt
AC
1 ms
3504 KiB