Submission #00089
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | #include <bits/stdc++.h> #define ll long long #define ldo long double #define INF INT_MAX #define r return #define endl "\n" #define loop(a,b) for(int a = 0;a < b;a++) #define rloop(a,b) for(int a = b-1;a >= 0;a--) #define quickstd cin.tie(nullptr);ios::sync_with_stdio(false); using namespace std; int main(){ quickstd /*方針*/ /*削る際、表面積の変動をする→現在の表面積を出しつ続ける。 また、w*Hの配列に残りの高さを入れておく。 表面積の変動 →高さが0になったらー2 四面に対しすべてが壁→升目分+ すべてが穴→升目分ー */ int w,d,h,c; cin >>w>>d>>h>>c; vector<vector< int >>hight(w+2,vector< int >(d+2,h)); //残りの高さ for ( int i = 0;i <= w+1;i++)hight[i][0] = 0; for ( int i = 0;i <= d+1;i++)hight[0][i] = 0; int sum = 2*((w*d)+(d*h)+(w*h)); //最初の表面積 cout <<sum<<endl; for ( int i = 0;i < c;i++){ int x,y,z; cin >>x>>y>>z; int w = 0; int a = 0; x++,y++; if (1){ //x+ w = hight[x+1][y]-max(hight[x][y]-z,0); w = max(w,0); w = min(w,z); a += w; a -= z-w; } if (1){ //y+ w = hight[x][y+1]-max(hight[x][y]-z,0); w = max(w,0); w = min(w,z); a += w; a -= z-w; } if (1){ //x- w = hight[x-1][y]-max(hight[x][y]-z,0); w = max(w,0); w = min(w,z); a += w; a -= z-w; } if (1){ //y- w = hight[x][y-1]-max(hight[x][y]-z,0); w = max(w,0); w = min(w,z); a += w; a -= z-w; } if (hight[x][y]-z <= 0){ sum-=2; } hight[x][y] = max(hight[x][y]-z,0); sum += a; //cout <<a<<endl; } cout <<sum<<endl; r 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0007 - 加工機 |
ユーザー名 | ei2332 |
投稿日時 | 2023-08-22 11:08:03 |
言語 | C++17 |
状態 | Wrong Answer |
得点 | 0 |
ソースコード長 | 2103 Byte |
最大実行時間 | 1000 ms |
最大メモリ使用量 | 262144 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 0 / 30 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in1 | WA | 28 ms | 604 KB |
1
|
in2 | WA | 29 ms | 3864 KB |
1
|
in3 | WA | 38 ms | 6024 KB |
1
|
in4 | MLE | 1000 ms | 262144 KB |
1
|
in5 | MLE | 1000 ms | 262144 KB |
1
|
in6 | MLE | 1000 ms | 262144 KB |
1
|
in7 | MLE | 1000 ms | 262144 KB |
1
|
in8 | MLE | 1000 ms | 262144 KB |
1
|
in9 | MLE | 1000 ms | 262144 KB |
1
|
in10 | MLE | 1000 ms | 262144 KB |
1
|
in11 | MLE | 1000 ms | 262144 KB |
1
|
in12 | MLE | 1000 ms | 262144 KB |
1
|
in13 | MLE | 1000 ms | 262144 KB |
1
|
in14 | WA | 24 ms | 3512 KB |
1
|
in15 | WA | 27 ms | 3592 KB |
1
|
in16 | WA | 222 ms | 112476 KB |
1
|
in17 | MLE | 1000 ms | 262144 KB |
1
|
in18 | MLE | 1000 ms | 262144 KB |
1
|
in19 | MLE | 1000 ms | 262144 KB |
1
|
in20 | MLE | 1000 ms | 262144 KB |
1
|
in21 | MLE | 1000 ms | 262144 KB |
1
|
in22 | MLE | 1000 ms | 262144 KB |
1
|
in23 | MLE | 1000 ms | 262144 KB |
1
|
in24 | MLE | 1000 ms | 262144 KB |
1
|
in25 | MLE | 1000 ms | 262144 KB |
1
|
in26 | MLE | 1000 ms | 262144 KB |
1
|