結果
問題 | No.960 マンハッタン距離3 |
ユーザー | kmjp |
提出日時 | 2019-12-23 00:48:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 1,333 bytes |
コンパイル時間 | 1,647 ms |
コンパイル使用メモリ | 170,044 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-14 21:36:31 |
合計ジャッジ時間 | 9,168 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | RE | - |
testcase_01 | RE | - |
testcase_02 | RE | - |
testcase_03 | AC | 2 ms
5,376 KB |
testcase_04 | AC | 2 ms
5,376 KB |
testcase_05 | AC | 2 ms
5,376 KB |
testcase_06 | AC | 2 ms
5,376 KB |
testcase_07 | AC | 2 ms
5,376 KB |
testcase_08 | AC | 2 ms
5,376 KB |
testcase_09 | AC | 2 ms
5,376 KB |
testcase_10 | AC | 2 ms
5,376 KB |
testcase_11 | AC | 2 ms
5,376 KB |
testcase_12 | AC | 2 ms
5,376 KB |
testcase_13 | AC | 2 ms
5,376 KB |
testcase_14 | AC | 2 ms
5,376 KB |
testcase_15 | AC | 2 ms
5,376 KB |
testcase_16 | AC | 2 ms
5,376 KB |
testcase_17 | AC | 2 ms
5,376 KB |
testcase_18 | AC | 2 ms
5,376 KB |
testcase_19 | AC | 3 ms
5,376 KB |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | AC | 2 ms
5,376 KB |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | AC | 2 ms
5,376 KB |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | AC | 2 ms
5,376 KB |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | AC | 2 ms
5,376 KB |
testcase_36 | WA | - |
testcase_37 | WA | - |
testcase_38 | WA | - |
testcase_39 | WA | - |
testcase_40 | AC | 2 ms
5,376 KB |
testcase_41 | AC | 2 ms
5,376 KB |
testcase_42 | AC | 2 ms
5,376 KB |
testcase_43 | AC | 2 ms
5,376 KB |
testcase_44 | AC | 2 ms
5,376 KB |
testcase_45 | AC | 2 ms
5,376 KB |
testcase_46 | WA | - |
testcase_47 | WA | - |
testcase_48 | WA | - |
testcase_49 | WA | - |
testcase_50 | WA | - |
testcase_51 | WA | - |
testcase_52 | WA | - |
testcase_53 | WA | - |
testcase_54 | AC | 2 ms
5,376 KB |
testcase_55 | AC | 2 ms
5,376 KB |
testcase_56 | AC | 2 ms
5,376 KB |
testcase_57 | AC | 2 ms
5,376 KB |
testcase_58 | AC | 2 ms
5,376 KB |
testcase_59 | AC | 2 ms
5,376 KB |
testcase_60 | WA | - |
testcase_61 | WA | - |
testcase_62 | WA | - |
testcase_63 | WA | - |
testcase_64 | AC | 2 ms
5,376 KB |
testcase_65 | AC | 2 ms
5,376 KB |
testcase_66 | AC | 2 ms
5,376 KB |
testcase_67 | AC | 2 ms
5,376 KB |
testcase_68 | AC | 2 ms
5,376 KB |
testcase_69 | AC | 2 ms
5,376 KB |
testcase_70 | AC | 2 ms
5,376 KB |
testcase_71 | AC | 2 ms
5,376 KB |
testcase_72 | AC | 2 ms
5,376 KB |
testcase_73 | AC | 2 ms
5,376 KB |
testcase_74 | AC | 2 ms
5,376 KB |
testcase_75 | AC | 2 ms
5,376 KB |
testcase_76 | AC | 2 ms
5,376 KB |
testcase_77 | AC | 2 ms
5,376 KB |
testcase_78 | AC | 2 ms
5,376 KB |
testcase_79 | AC | 2 ms
5,376 KB |
testcase_80 | AC | 2 ms
5,376 KB |
testcase_81 | AC | 2 ms
5,376 KB |
testcase_82 | AC | 2 ms
5,376 KB |
testcase_83 | AC | 2 ms
5,376 KB |
testcase_84 | AC | 2 ms
5,376 KB |
testcase_85 | AC | 2 ms
5,376 KB |
testcase_86 | AC | 2 ms
5,376 KB |
testcase_87 | AC | 2 ms
5,376 KB |
testcase_88 | WA | - |
testcase_89 | WA | - |
testcase_90 | WA | - |
testcase_91 | WA | - |
testcase_92 | AC | 2 ms
5,376 KB |
testcase_93 | AC | 2 ms
5,376 KB |
testcase_94 | WA | - |
testcase_95 | WA | - |
testcase_96 | WA | - |
testcase_97 | WA | - |
testcase_98 | AC | 2 ms
5,376 KB |
testcase_99 | AC | 2 ms
5,376 KB |
testcase_100 | WA | - |
testcase_101 | WA | - |
testcase_102 | WA | - |
testcase_103 | AC | 2 ms
5,376 KB |
testcase_104 | AC | 2 ms
5,376 KB |
testcase_105 | AC | 2 ms
5,376 KB |
testcase_106 | WA | - |
testcase_107 | WA | - |
testcase_108 | WA | - |
testcase_109 | WA | - |
testcase_110 | AC | 2 ms
5,376 KB |
testcase_111 | AC | 2 ms
5,376 KB |
testcase_112 | AC | 2 ms
5,376 KB |
testcase_113 | AC | 2 ms
5,376 KB |
testcase_114 | AC | 2 ms
5,376 KB |
testcase_115 | AC | 2 ms
5,376 KB |
testcase_116 | AC | 2 ms
5,376 KB |
testcase_117 | AC | 2 ms
5,376 KB |
testcase_118 | AC | 2 ms
5,376 KB |
testcase_119 | AC | 2 ms
5,376 KB |
testcase_120 | AC | 2 ms
5,376 KB |
testcase_121 | AC | 2 ms
5,376 KB |
testcase_122 | AC | 2 ms
5,376 KB |
testcase_123 | AC | 2 ms
5,376 KB |
testcase_124 | AC | 2 ms
5,376 KB |
testcase_125 | AC | 2 ms
5,376 KB |
testcase_126 | AC | 2 ms
5,376 KB |
testcase_127 | AC | 2 ms
5,376 KB |
testcase_128 | WA | - |
testcase_129 | WA | - |
testcase_130 | WA | - |
testcase_131 | WA | - |
testcase_132 | WA | - |
testcase_133 | WA | - |
testcase_134 | AC | 7 ms
5,376 KB |
testcase_135 | WA | - |
testcase_136 | WA | - |
testcase_137 | AC | 13 ms
5,376 KB |
testcase_138 | WA | - |
testcase_139 | WA | - |
testcase_140 | AC | 24 ms
5,376 KB |
testcase_141 | WA | - |
testcase_142 | WA | - |
testcase_143 | AC | 16 ms
5,376 KB |
testcase_144 | WA | - |
testcase_145 | WA | - |
testcase_146 | WA | - |
testcase_147 | WA | - |
testcase_148 | AC | 9 ms
5,376 KB |
testcase_149 | AC | 15 ms
5,376 KB |
testcase_150 | AC | 20 ms
5,376 KB |
testcase_151 | AC | 3 ms
5,376 KB |
testcase_152 | AC | 17 ms
5,376 KB |
testcase_153 | AC | 23 ms
5,376 KB |
testcase_154 | WA | - |
testcase_155 | WA | - |
testcase_156 | WA | - |
testcase_157 | WA | - |
testcase_158 | WA | - |
testcase_159 | WA | - |
testcase_160 | WA | - |
testcase_161 | WA | - |
testcase_162 | AC | 21 ms
5,376 KB |
testcase_163 | AC | 12 ms
5,376 KB |
testcase_164 | AC | 23 ms
5,376 KB |
testcase_165 | AC | 18 ms
5,376 KB |
testcase_166 | AC | 5 ms
5,376 KB |
testcase_167 | AC | 12 ms
5,376 KB |
testcase_168 | WA | - |
testcase_169 | WA | - |
testcase_170 | WA | - |
testcase_171 | WA | - |
testcase_172 | AC | 10 ms
5,376 KB |
testcase_173 | AC | 3 ms
5,376 KB |
testcase_174 | AC | 20 ms
5,376 KB |
testcase_175 | AC | 24 ms
5,376 KB |
testcase_176 | AC | 17 ms
5,376 KB |
testcase_177 | AC | 4 ms
5,376 KB |
testcase_178 | AC | 18 ms
5,376 KB |
testcase_179 | AC | 19 ms
5,376 KB |
testcase_180 | AC | 22 ms
5,376 KB |
testcase_181 | AC | 6 ms
5,376 KB |
testcase_182 | AC | 10 ms
5,376 KB |
testcase_183 | AC | 14 ms
5,376 KB |
testcase_184 | AC | 11 ms
5,376 KB |
testcase_185 | AC | 16 ms
5,376 KB |
testcase_186 | AC | 20 ms
5,376 KB |
testcase_187 | AC | 16 ms
5,376 KB |
testcase_188 | AC | 2 ms
5,376 KB |
testcase_189 | AC | 2 ms
5,376 KB |
testcase_190 | AC | 2 ms
5,376 KB |
testcase_191 | AC | 2 ms
5,376 KB |
testcase_192 | AC | 2 ms
5,376 KB |
testcase_193 | AC | 2 ms
5,376 KB |
testcase_194 | AC | 2 ms
5,376 KB |
testcase_195 | AC | 2 ms
5,376 KB |
testcase_196 | WA | - |
testcase_197 | WA | - |
testcase_198 | WA | - |
testcase_199 | WA | - |
testcase_200 | AC | 20 ms
5,376 KB |
testcase_201 | AC | 12 ms
5,376 KB |
testcase_202 | WA | - |
testcase_203 | WA | - |
testcase_204 | WA | - |
testcase_205 | WA | - |
testcase_206 | AC | 21 ms
5,376 KB |
testcase_207 | AC | 16 ms
5,376 KB |
testcase_208 | WA | - |
testcase_209 | WA | - |
testcase_210 | WA | - |
testcase_211 | WA | - |
testcase_212 | AC | 6 ms
5,376 KB |
testcase_213 | AC | 12 ms
5,376 KB |
testcase_214 | WA | - |
testcase_215 | WA | - |
testcase_216 | WA | - |
testcase_217 | WA | - |
testcase_218 | AC | 22 ms
5,376 KB |
testcase_219 | AC | 12 ms
5,376 KB |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define ALL(a) (a.begin()),(a.end()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) //------------------------------------------------------- ll H,W; int N; ll X[101010],Y[101010]; void solve() { int i,j,k,l,r,x,y; string s; cin>>W>>H; cin>>N; int C[2]={}; FOR(i,N) { cin>>X[i]>>Y[i]; X[i]--; Y[i]--; C[(X[i]+Y[i])%2]++; } if(C[0]>0 && C[0]<N) return _P("0\n"); if(N==2) { if(X[0]>X[1]) swap(X[0],X[1]),swap(Y[0],Y[1]); if(abs(X[0]-X[1])<abs(Y[0]-Y[1])) cout<<W<<endl; else if(abs(X[0]-X[1])>abs(Y[0]-Y[1])) cout<<H<<endl; else { ll ret=0; if(Y[0]<Y[1]) ret+=(Y[0]+1)*(W-X[1])+(H-Y[1])*(X[0]+1)+(X[1]-X[0]-1); else ret+=(Y[1]+1)*(X[0]+1)+(H-Y[0])*(W-X[1])+(X[1]-X[0]-1); cout<<ret<<endl; } } else if(N>=5) { cout<<0<<endl; } else { assert(0); } } int main(int argc,char** argv){ string s;int i; if(argc==1) ios::sync_with_stdio(false), cin.tie(0); FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin); cout.tie(0); solve(); return 0; }