5 条题解
-
1
#include <queue> #include <math.h> #include <stack> #include <stdio.h> #include <iostream> #include <vector> #include <iomanip> #include <string.h> #include <algorithm> using namespace std; #define int long long #define float double #define N 0x1c9c38a #define INF 0xc00000fd #define scf scanf #define ptf printf #define gtc getchar #define ptc putchar #define psp ptc(' ') #define pel ptc('\n') queue<int> Q; stack<int> S; vector<int> V; vector<int> travel(vector<int> A, vector<int> B, vector<int> U, vector<int> V, vector<int> W); #ifndef SOMETHING_H #define SOMETHING_H #endif inline int wei(int n){ int cnt = 0; while(n > 0){ n /= 10; cnt++; } return cnt; } inline bool isPrime(int n){ if(n < 2) return 0; for(int i = 2; i * i <= n; ++i) if(n % i == 0) return 0; return 1; } inline int read(string n){ int x = 0, f = 1; ptf("%s", n.c_str()); char c = gtc(); while(c < '0' || c > '9'){ if(c == '-') f = -1; c = gtc(); } while(c >= '0' && c <= '9'){ x = x * 10 + c - 48; c = gtc(); } return x * f; } inline float input(string n){ float x = 0, f = 1, x2 = 0, cnt = 0, i = 0; ptf("%s", n.c_str()); char c = gtc(); while(c < '0' || c > '9'){ if(c == '-') f = -1; c = gtc(); } while(c >= '0' && c <= '9'){ x = x * 10 + c - 48; c = gtc(); } c = gtc(); while(c >= '0' && c <= '9'){ x2 = x2 * 10 + c - 48; cnt++; c = gtc(); } for(; i < cnt; i++) x2 /= 10.0; return (x + x2) * f; } inline void write(int n){ if(n < 0){ ptc('-'); n = -n; } if(n > 9) write(n / 10); ptc(n % 10 + '0'); return; } #define read() read("") #define input() input("") int n = read(), m = read(); char c = gtc(); bool b = read(); inline void t(){ for(int i = 1; i <= n; i++){ for(int j = 1; j <= m; j++) ptc(c); pel; } return; } inline void f(){ for(int i = 1; i <= m; i++) ptc(c); pel; for(int i = 2; i < n; i++){ ptc(c); for(int j = 2; j < m; j++) psp; ptc(c); pel; } for(int i = 1; i <= m; i++) ptc(c); return; } inline void Main(){ b ? t() : f(); return; } signed main(signed argc, char **argv){ Main(); pel; return 0; }
信息
- ID
- 912
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 4
- 标签
- 递交数
- 238
- 已通过
- 103
- 上传者