結果
問題 |
No.178 美しいWhitespace (1)
|
ユーザー |
![]() |
提出日時 | 2018-02-21 02:24:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 474 bytes |
コンパイル時間 | 547 ms |
コンパイル使用メモリ | 70,052 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-13 19:23:00 |
合計ジャッジ時間 | 1,365 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 15 WA * 6 |
ソースコード
#include<iostream> #include<vector> #include<algorithm> #include<string> #include<cstdio> using namespace std; int main(){ long long N,a,b,i,sum[1000],m=0,ans=0; bool flag = false; cin >> N; for(i=0;i<N;i++){ cin >> a >> b; sum[i] = a + b*4; m = max(m,sum[i]); } for(i=0;i<N;i++){ ans += (m-sum[i]); if((m-sum[i])%2==0) flag = true; } if(flag) cout << ans/2; else cout << ans; return 0; }