結果
問題 | No.987 N×Mマス計算(基本) |
ユーザー | kinsei0916 |
提出日時 | 2020-02-15 00:32:04 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 1,986 bytes |
コンパイル時間 | 2,126 ms |
コンパイル使用メモリ | 202,992 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-06 13:34:06 |
合計ジャッジ時間 | 3,171 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,248 KB |
testcase_02 | AC | 3 ms
5,248 KB |
testcase_03 | AC | 2 ms
5,248 KB |
testcase_04 | AC | 2 ms
5,248 KB |
testcase_05 | AC | 2 ms
5,248 KB |
testcase_06 | AC | 2 ms
5,248 KB |
testcase_07 | AC | 2 ms
5,248 KB |
testcase_08 | AC | 2 ms
5,248 KB |
testcase_09 | AC | 2 ms
5,248 KB |
testcase_10 | AC | 2 ms
5,248 KB |
testcase_11 | AC | 2 ms
5,248 KB |
testcase_12 | AC | 3 ms
5,248 KB |
testcase_13 | AC | 2 ms
5,248 KB |
testcase_14 | AC | 2 ms
5,248 KB |
testcase_15 | AC | 2 ms
5,248 KB |
testcase_16 | AC | 3 ms
5,248 KB |
testcase_17 | AC | 2 ms
5,248 KB |
testcase_18 | AC | 2 ms
5,248 KB |
testcase_19 | AC | 2 ms
5,248 KB |
コンパイルメッセージ
main.cpp: In function 'std::ostream& operator<<(std::ostream&, const std::vector<_Tp>&)': main.cpp:36:7: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 36 | rep(i, vec.size()) i == 0 ? os << vec[i] : os << ", " << vec[i]; | ^ main.cpp:6:48: note: in definition of macro '_rep3' 6 | #define _rep3(i, begin, end) for (register int i = (begin), i##_end = (end); i < i##_end; i++) | ^ main.cpp:10:43: note: in expansion of macro '_rep2' 10 | #define _overload3(_1, _2, _3, name, ...) name | ^~~~ main.cpp:36:3: note: in expansion of macro 'rep' 36 | rep(i, vec.size()) i == 0 ? os << vec[i] : os << ", " << vec[i]; | ^~~ main.cpp:36:7: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 36 | rep(i, vec.size()) i == 0 ? os << vec[i] : os << ", " << vec[i]; | ^ main.cpp:6:61: note: in definition of macro '_rep3' 6 | #define _rep3(i, begin, end) for (register int i = (begin), i##_end = (end); i < i##_end; i++) | ^ main.cpp:10:43: note: in expansion of macro '_rep2' 10 | #define _overload3(_1, _2, _3, name, ...) name | ^~~~ main.cpp:36:3: note: in expansion of macro 'rep' 36 | rep(i, vec.size()) i == 0 ? os << vec[i] : os << ", " << vec[i]; | ^~~ main.cpp: In function 'int main()': main.cpp:79:7: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 79 | rep(i, N) { | ^ main.cpp:6:48: note: in definition of macro '_rep3' 6 | #define _rep3(i, begin, end) for (register int i = (begin), i##_end = (end); i < i##_end; i++) | ^ main.cpp:10:43: note: in expansion of macro '_rep2' 10 | #define _overload3(_1, _2, _3, name, ...) name |
ソースコード
#pragma region #include "bits/stdc++.h" #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() #define _rep3(i, begin, end) for (register int i = (begin), i##_end = (end); i < i##_end; i++) #define _irep3(i, begin, end) for (register int i = (end)-1, i##_begin = (begin); i >= i##_begin; i--) #define _rep2(i, n) _rep3(i, 0, n) #define _irep2(i, n) _irep3(i, 0, n) #define _overload3(_1, _2, _3, name, ...) name #define rep(...) _overload3(__VA_ARGS__, _rep3, _rep2, )(__VA_ARGS__) #define irep(...) _overload3(__VA_ARGS__, _irep3, _irep2, )(__VA_ARGS__) #define out(x) cout << (x) << '\n'; #define debug(x) cerr << #x << " = " << (x) << " (line: " << __LINE__ << ") " << endl; using namespace std; using ll = long long; using vi = vector<int>; using vl = vector<long long>; using vvi = vector<vector<int>>; using vvl = vector<vector<long long>>; template <typename T> istream &operator>>(istream &is, vector<T> &vec) { for (auto &v : vec) is >> v; return is; } template <typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &pair) { cin >> pair.first >> pair.second; return is; } template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) { os << "[ "; rep(i, vec.size()) i == 0 ? os << vec[i] : os << ", " << vec[i]; os << " ]"; return os; } template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template <class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; } void init() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(16) << boolalpha; } #pragma endregion #define MOD 1000000007 #define INF 2147483647 int main() { init(); int N, M; cin >> N >> M; char op; vl A(N), B(M); cin >> op >> B >> A; rep(i, N) { rep(j, M) { if (j != 0) cout << ' '; cout << (op == '+' ? A[i] + B[j] : A[i] * B[j]); } cout << '\n'; } }