結果
| 問題 |
No.1910 High Element on Grid
|
| コンテスト | |
| ユーザー |
Nachia
|
| 提出日時 | 2022-04-22 22:43:54 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 20 ms / 2,000 ms |
| コード長 | 891 bytes |
| コンパイル時間 | 729 ms |
| コンパイル使用メモリ | 78,752 KB |
| 最終ジャッジ日時 | 2025-01-28 20:33:32 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 41 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
int main(){
int H, W; cin >> H >> W;
vector<vector<int>> A(H, vector<int>(W));
rep(y,H) rep(x,W) A[y][x] = y * 2 * 10'000 + x * 2;
A[0][0] = 200'000'000;
vector<int> R(H); rep(y,H) cin >> R[y];
vector<int> C(W); rep(x,W) cin >> C[x];
for(int y=1; y<H; y++) A[y][0] = y * 2 * 10'000 + ((W - R[y]) * 2 + 1);
for(int x=1; x<W; x++) A[0][x] = ((H - C[x]) * 2 + 1) * 10'000 + x * 2;
rep(y,H){
rep(x,W) cout << A[y][x] << ' ';
cout << '\n';
}
return 0;
}
struct ios_do_not_sync{
ios_do_not_sync(){
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
}
} ios_do_not_sync_instance;
Nachia