結果
問題 | No.1225 I hate I hate Matrix Construction |
ユーザー |
|
提出日時 | 2020-09-11 21:29:56 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 387 bytes |
コンパイル時間 | 763 ms |
コンパイル使用メモリ | 63,360 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-27 02:34:30 |
合計ジャッジ時間 | 1,982 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 35 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main() | ^~~~
ソースコード
#include<iostream>using namespace std;int N;int s[500],t[500];int sc[3],tc[3];main(){cin>>N;for(int i=0;i<N;i++){cin>>s[i];sc[s[i]]++;}for(int i=0;i<N;i++){cin>>t[i];tc[t[i]]++;}int ans=-sc[2]*tc[2];ans+=sc[2]*N;if(tc[2]==0)ans+=sc[1];ans+=tc[2]*N;if(sc[2]==0)ans+=tc[1];if(sc[2]==0&&tc[2]==0)ans-=sc[1]<tc[1]?sc[1]:tc[1];cout<<ans<<endl;}