Submission #844867
Source Code Expand
Copy
// tested by Hightail: https://github.com/dj3500/hightail
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <cmath>
#include <algorithm>
#include <sstream>
#include <stack>
#include <cstring>
#include <iomanip>
#include <ctime>
#include <cassert>
using namespace std;
#define pb push_back
#define INF 1001001001
#define FOR(i,n) for(int (i)=0;(i)<(n);++(i))
#define FORI(i,n) for(int (i)=1;(i)<=(n);++(i))
#define mp make_pair
#define pii pair<int,int>
#define ll long long
#define vi vector<int>
#define SZ(x) ((int)((x).size()))
#define fi first
#define se second
#define wez(n) int (n); scanf("%d",&(n));
#define wez2(n,m) int (n),(m); scanf("%d %d",&(n),&(m));
#define wez3(n,m,k) int (n),(m),(k); scanf("%d %d %d",&(n),&(m),&(k));
inline void pisz(int n) { printf("%d\n",n); }
template<typename T,typename TT> ostream& operator<<(ostream &s,pair<T,TT> t) {return s<<"("<<t.first<<","<<t.second<<")";}
template<typename T> ostream& operator<<(ostream &s,vector<T> t){FOR(i,SZ(t))s<<t[i]<<" ";return s; }
#define DBG(vari) cout<<"["<<__LINE__<<"] "<<#vari<<" = "<<(vari)<<endl;
#define ALL(t) t.begin(),t.end()
#define FOREACH(i,t) for (__typeof(t.begin()) i=t.begin(); i!=t.end(); i++)
#define TESTS wez(testow)while(testow--)
#define REP(i,a,b) for(int (i)=(a);(i)<=(b);++i)
#define REPD(i,a,b) for(int (i)=(a); (i)>=(b);--i)
#define REMAX(a,b) (a)=max((a),(b));
#define REMIN(a,b) (a)=min((a),(b));
#define IOS ios_base::sync_with_stdio(0);
int main () {
bool b = 0;
ll res = 0;
TESTS {
wez(x);
if (b && (x > 0)) {
--x;
++res;
}
res += x/2;
b = x % 2;
}
cout << res;
}
Submission Info
Submission Time
2016-08-21 21:08:13+0900
Task
B - Simplified mahjong
User
dj3500
Language
C++14 (GCC 5.4.1)
Score
400
Code Size
1775 Byte
Status
AC
Exec Time
25 ms
Memory
256 KB
Compile Error
./Main.cpp: In function ‘int main()’:
./Main.cpp:29:41: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
#define wez(n) int (n); scanf("%d",&(n));
^
./Main.cpp:38:15: note: in expansion of macro ‘wez’
#define TESTS wez(testow)while(testow--)
^
./Main.cpp:48:4: note: in expansion of macro ‘TESTS’
TESTS {
^
./Main.cpp:29:41: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
#define wez(n) int (n); scanf("%d",&(n));
^
./Main.cpp:49:7: note: in expansion of macro ‘wez’
wez(x);
^
Judge Result
Set Name
Sample
All
Score / Max Score
0 / 0
400 / 400
Status
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
AC
25 ms
256 KB
02.txt
AC
25 ms
256 KB
03.txt
AC
24 ms
256 KB
04.txt
AC
22 ms
256 KB
05.txt
AC
22 ms
256 KB
06.txt
AC
22 ms
256 KB
07.txt
AC
23 ms
256 KB
08.txt
AC
23 ms
256 KB
09.txt
AC
25 ms
256 KB
10.txt
AC
25 ms
256 KB
11.txt
AC
17 ms
256 KB
12.txt
AC
25 ms
256 KB
13.txt
AC
24 ms
256 KB
14.txt
AC
24 ms
256 KB
15.txt
AC
16 ms
256 KB
16.txt
AC
24 ms
256 KB
17.txt
AC
24 ms
256 KB
18.txt
AC
4 ms
256 KB
19.txt
AC
4 ms
256 KB
20.txt
AC
4 ms
256 KB
21.txt
AC
4 ms
256 KB
22.txt
AC
4 ms
256 KB
s1.txt
AC
4 ms
256 KB
s2.txt
AC
4 ms
256 KB