結果
| 問題 |
No.11 カードマッチ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-12-13 15:31:19 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 701 bytes |
| コンパイル時間 | 688 ms |
| コンパイル使用メモリ | 67,168 KB |
| 実行使用メモリ | 817,664 KB |
| 最終ジャッジ日時 | 2024-09-15 11:42:48 |
| 合計ジャッジ時間 | 2,348 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 MLE * 1 -- * 14 |
ソースコード
#include <iostream>
#include <vector>
using namespace std;
int main(){
int w, h, n;
long long int match=0;
cin >> w >> h >> n;
vector< vector<int> > hand(n, vector<int>(2));
vector< vector<bool> > talon(w, vector<bool>(h, true));
for(int i=0; i<n; ++i){
for(int j=0; j<2; ++j){
cin >> hand[i][j];
--hand[i][j];
}
talon[hand[i][0]][hand[i][1]]=false;
}
for(int i=0; i<n; ++i){
for(int j=0; j<h; ++j){
if(talon[hand[i][0]][j]==true){
++match;
talon[hand[i][0]][j]=false;
}
}
for(int j=0; j<w; ++j){
if(talon[j][hand[i][1]]==true){
++match;
talon[j][hand[i][1]]=false;
}
}
}
cout << match << "\n";
return 0;
}