Submission #19722798
Source Code Expand
Copy
#include<bits/stdc++.h> #include<atcoder/all> using namespace std; using namespace atcoder; #define rep(i,n) for(int i=0;i<n;i++) int main(void){ int x,y; cin>>y>>x; int smin=1000000; int ans=0; vector<vector <int>> S(y,vector<int>(x)); rep(i,y){ rep(j,x){ cin>>S.at(i).at(j); if(smin>S.at(i).at(j)) smin=S.at(i).at(j); } } rep(i,y){ rep(j,x){ ans+=S.at(i).at(j)-smin; } } cout<<ans<<endl; }
Submission Info
Submission Time | |
---|---|
Task | B - Blocks on Grid |
User | Colted |
Language | C++ (GCC 9.2.1) |
Score | 200 |
Code Size | 470 Byte |
Status | AC |
Exec Time | 8 ms |
Memory | 3716 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_11.txt, random_12.txt, random_13.txt, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
random_01.txt | AC | 7 ms | 3712 KB |
random_02.txt | AC | 3 ms | 3668 KB |
random_03.txt | AC | 3 ms | 3640 KB |
random_04.txt | AC | 4 ms | 3644 KB |
random_05.txt | AC | 2 ms | 3460 KB |
random_06.txt | AC | 3 ms | 3536 KB |
random_07.txt | AC | 3 ms | 3640 KB |
random_08.txt | AC | 2 ms | 3516 KB |
random_11.txt | AC | 7 ms | 3556 KB |
random_12.txt | AC | 7 ms | 3716 KB |
random_13.txt | AC | 8 ms | 3684 KB |
sample_01.txt | AC | 2 ms | 3464 KB |
sample_02.txt | AC | 5 ms | 3592 KB |
sample_03.txt | AC | 2 ms | 3668 KB |