Submission #1841314


Source Code Expand

#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(X,Y) ((X)>(Y)?X=(Y),true:false)
#define chmax(X,Y) ((X)<(Y)?X=(Y),true:false)
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}
 
int main(){
	int n;
	cin>>n;
	ll res = 0;
	vector<ll> a(n);
	rep(i, n) cin>>a[i];
	int p = 0;
	rep(i, n){
		if(p && a[i]>0){
			res++;
			p = 0;
		}
		res += a[i]/2;
		p = a[i]%2;
	}
	cout<<res<<endl;
	return 0;
}

Submission Info

Submission Time
Task B - Simplified mahjong
User Lepton
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1393 Byte
Status WA
Exec Time 44 ms
Memory 1024 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
WA × 2
AC × 8
WA × 16
Set Name Test Cases
Sample s1.txt, s2.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, s1.txt, s2.txt
Case Name Status Exec Time Memory
01.txt WA 41 ms 1024 KB
02.txt WA 41 ms 1024 KB
03.txt WA 41 ms 1024 KB
04.txt WA 30 ms 1024 KB
05.txt WA 30 ms 1024 KB
06.txt WA 30 ms 1024 KB
07.txt WA 36 ms 1024 KB
08.txt WA 36 ms 1024 KB
09.txt WA 41 ms 1024 KB
10.txt WA 41 ms 1024 KB
11.txt AC 17 ms 1024 KB
12.txt AC 44 ms 1024 KB
13.txt WA 41 ms 1024 KB
14.txt WA 41 ms 1024 KB
15.txt AC 18 ms 1024 KB
16.txt WA 42 ms 1024 KB
17.txt WA 41 ms 1024 KB
18.txt AC 1 ms 256 KB
19.txt AC 1 ms 256 KB
20.txt AC 1 ms 256 KB
21.txt AC 1 ms 256 KB
22.txt AC 1 ms 256 KB
s1.txt WA 1 ms 256 KB
s2.txt WA 1 ms 256 KB