Submission #400030

# Submission time Handle Problem Language Result Execution time Memory
400030 2021-05-07T07:59:25 Z marvenlee Boat (APIO16_boat) C++14
0 / 100
2 ms 336 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> ii;
typedef pair<ll, ii> iii;
typedef string str;
typedef vector<ll>  vl;
typedef vector< vector<ll> > vvl;
typedef vector<ii> vii;
typedef vector< vector<ii> > vvii;
typedef vector<iii> viii;
typedef vector< vector<iii> > vviii;
typedef vector<str>  vs;
typedef vector< vector<str> > vvs;
typedef long double ld;
typedef priority_queue<long long> pq;
/*
Hiiden Function
__gcd()
__builtin_clz(x)
__builtin_ctz(x)
__builtin_popcount(x)

*/

//typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
// debugging Function
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}


#define LSOne(S) ( (S) & -(S))
#define elif else if
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define FOR(i,v) for(auto i:v)
#define rep(i, begin, end) for(__typeof(end) i=(begin) -((begin)>(end));i!=(end)-((begin)>(end)); i+= 1 - 2*((begin)>(end)))
#define repin(i,a,b,x) for(int i=(a);i<(b);i+=x)
#define repnin(i,a,b,x) for(int i=(a);i<=(b);i+=x)
#define MAX(a,b) a=max(a,b)
#define MIN(a,b) a=min(a,b)
#define fbo find_by_order
#define ook order_of_key
#define ALL(v) v.begin(),v.end()
#define FILL(arr,x) memset(arr,x,sizeof arr);
// if else int i = (number <0) ? 1:0 -  if (number <0) i=1 else 0
const ll MOD = 1e9 + 7;
const ll INF = 1e9;
const ld EPS = 1e-9;
 map<char,int> st;


int main()
{ 
 //ios_base::sync_with_stdio(0);
 //cin.tie(0);
 //cout.tie(0);
 //freopen("UT.txt","w",stdout);
 int n;
 cin >> n;
 int a[n+1];
 rep(i,1,n+1) cin >> a[i] >> a[i];
 a[0]=INF;
 int dp[n+1];
 int memo[n+1];

 FILL(dp,0);
 FILL(memo,0);
 
 rep(i,1,n+1){
  rep(j,0,i){
      dp[i]+=(a[j]<a[i])? dp[j]:0;
  } 
  dp[i]+=1;
 }
 int ans=1;
 rep(i,1,n+1)
  ans+=dp[i];
  cout << ans;
}
  

Compilation message

boat.cpp: In function 'int main()':
boat.cpp:45:28: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   45 | #define rep(i, begin, end) for(__typeof(end) i=(begin) -((begin)>(end));i!=(end)-((begin)>(end)); i+= 1 - 2*((begin)>(end)))
      |                            ^~~
boat.cpp:85:2: note: in expansion of macro 'rep'
   85 |  rep(i,1,n+1)
      |  ^~~
boat.cpp:87:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   87 |   cout << ans;
      |   ^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -