Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
33339 | TianXiezuo | 【J】T1小清新清新题 | C++ | 通过 | 100 | 28 MS | 252 KB | 380 | 2024-10-07 17:13:01 |
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll n,l1=0,l2=0,ans=0; cin>>n; for(ll i=1;i<=n;i++){ ll x; cin>>x; if(x%3==0){ ans++; }else if(x%3==1){ l1++; }else{ l2++; } } if(l1>l2){ ans+=l2; l1-=l2; ans+=l1/3; }else{ ans+=l1; l2-=l1; ans+=l2/3; } cout<<ans<<endl; return 0; }