結果
| 問題 |
No.1225 I hate I hate Matrix Construction
|
| コンテスト | |
| ユーザー |
沙耶花
|
| 提出日時 | 2020-09-11 21:31:49 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 626 bytes |
| コンパイル時間 | 2,156 ms |
| コンパイル使用メモリ | 195,148 KB |
| 最終ジャッジ日時 | 2025-01-14 10:05:07 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 16 WA * 19 |
ソースコード
#include <stdio.h>
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 10000000000000
int main(){
int N;
cin>>N;
vector<int> c1(2,0),c2(2,0);
int n = N;
rep(i,2){
rep(j,N){
int a;
cin>>a;
if(a==1)c1[i]++;
else if(a==2)c2[i]++;
else n--;
}
}
int ans =N*(c2[0]);
if(ans!=0)ans += c1[0];
else ans += max(c1[0],c1[1]);
{
int t = N*(c1[0]);
if(t!=0)t += c1[1];
else t += max(c1[0],c1[1]);
ans = min(ans,t);
}
cout<<ans<<endl;
return 0;
}
沙耶花