結果

問題 No.1338 Giant Class
ユーザー aogeraaogera
提出日時 2024-03-26 22:53:50
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,655 bytes
コンパイル時間 4,271 ms
コンパイル使用メモリ 235,556 KB
実行使用メモリ 9,856 KB
最終ジャッジ日時 2024-03-26 22:54:01
合計ジャッジ時間 10,370 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 178 ms
7,552 KB
testcase_07 AC 258 ms
9,216 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 25 ms
6,676 KB
testcase_12 WA -
testcase_13 AC 172 ms
7,168 KB
testcase_14 AC 42 ms
6,676 KB
testcase_15 AC 63 ms
6,676 KB
testcase_16 AC 22 ms
6,676 KB
testcase_17 AC 174 ms
7,168 KB
testcase_18 AC 40 ms
6,676 KB
testcase_19 AC 75 ms
6,676 KB
testcase_20 AC 305 ms
9,856 KB
testcase_21 AC 310 ms
9,856 KB
testcase_22 AC 300 ms
9,856 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function 'void in(T& ...)':
main.cpp:18:53: warning: fold-expressions only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   18 | template<class... T>void in(T&... a){(cin >> ... >> a);}
      |                                                     ^
main.cpp: In function 'void out(const T&, const Ts& ...)':
main.cpp:19:100: warning: fold-expressions only available with '-std=c++17' or '-std=gnu++17' [-Wc++17-extensions]
   19 | template<class T, class... Ts>void out(const T& a, const Ts&... b){cout << a;((cout << ' ' <<  b), ...);cout << '\n';}
      |                                                                                                    ^~~

ソースコード

diff #

#include<bits/stdc++.h>
#include <atcoder/all>
using namespace std;using namespace atcoder;using vst = vector<string>;using ll = long long;
using ld = long double;using pll = pair<ll,ll>;using vll = vector<ll>;using vvll = vector<vll>;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repp(i,k,n) for (ll i = k; i < n; i++)
#define per(i,s,e) for(ll i = s; i >= e; i--)
#define all(v) v.begin(),v.end()
#define no() {cout << "No" << endl; return 0;}
#define yes(){cout << "Yes" << endl;return 0;}
#define CHECK(a) a ? cout << "Yes" << endl : cout << "No" << endl
#define MODD 998244353LL
#define MOD 1000000007LL
#define UNOmap unordered_map
#define UNOset unordered_set
#define ASC(T) T,vector<T>,greater<T>
#define join(G,a,b) G[a].push_back(b);G[b].push_back(a);
template<class... T>void in(T&... a){(cin >> ... >> a);}
template<class T, class... Ts>void out(const T& a, const Ts&... b){cout << a;((cout << ' ' <<  b), ...);cout << '\n';}
void vin(vll &v){for(ll i = 0; i < (ll)v.size(); i++)in(v[i]);}
void vout(vll &v){for(ll i = 0; i < (ll)v.size(); i++) cout << v[i] << ' ';}
ll INF = 1LL << 62;

// #include<boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision;

// using mint = modint998244353;
// using mint = modint1000000007;
//using mint = modint;


// cout << fixed << setprecision(15);
//----------------------------------------------


int main(){
  ll H,W,Q;
  in(H,W,Q);
  ll ans = H*W;
  map<ll,ll> mp;
  rep(i,Q){
    ll y,x;
    in(y,x);
    y--;
    x--;
    if(mp.count(x) == 0) {
      mp[x] = y;
      ans -= H-y;
    }
    else if(mp[x] > y){
      ans -= mp[x] - y;
    }
    out(ans);
    
  }
  
  
}
0