제출 #475412

#제출 시각아이디문제언어결과실행 시간메모리
475412Ahmed_SolymanAutomobil (COCI17_automobil)C++14
0 / 100
39 ms65540 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mod=1000000007; int main() { ll n,m,k;cin>>n>>m>>k; vector<vector<ll>>arr(n,vector<ll>(m)); ll u=1; for(ll i=0;i<n;i++){ for(ll j=0;j<m;j++){ arr[i][j]=(u++); } } while(k--){ char c; ll x,y;cin>>c>>x>>y; if(c=='R'){ for(ll i=0;i<m;i++){ arr[x-1][i]*=y; arr[x-1][i]%=mod; } } else{ for(ll i=0;i<n;i++){ arr[i][x-1]*=y; arr[i][x-1]%=mod; } } } ll ans=0; for(auto i:arr){ for(auto j:i){ ans+=j; } } cout<<ans<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...