QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#124747#5645. Walking BoyHongzy#AC ✓1ms3672kbC++171.2kb2023-07-15 15:10:392023-07-15 15:10:48

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-15 15:10:48]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3672kb
  • [2023-07-15 15:10:39]
  • 提交

answer

#include <bits/stdc++.h>
#define LOG(FMT...) fprintf(stderr, FMT);
#define rep(i, j, k) for(int i = j; i <= k; ++ i)
#define per(i, j, k) for(int i = j; i >= k; -- i)
using namespace std;

#define fs first
#define sc second
#define pb push_back
#define mp make_pair

using db = double;
using ll = long long;
using uint = unsigned int;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

mt19937 mt(chrono::system_clock::now().time_since_epoch().count());
uniform_int_distribution<ll> ran(0, 1ll << 62);
void ucin() { ios::sync_with_stdio(0); cin.tie(0); }
// uniform_real_distribution<double> dbran;
template<class T> inline void chkmax(T &x, const T &y) { if(x < y) x = y; }
template<class T> inline void chkmin(T &x, const T &y) { if(x > y) x = y; }
inline ll sqr(ll x) { return x * x; }
inline ll cub(ll x) { return x * x * x; }

const int N = 5e5 + 10;
const int mod = 1e9 + 7;
int n, a[N];
int main() {
  int test = 1;
  scanf("%d", &test);
  rep(T, 1, test) {
    scanf("%d", &n);
    a[0] = 0; a[n+1]= 1440;
    rep(i, 1, n) scanf("%d", a + i);
    int ans = 0;
    rep(i, 1, n + 1) ans += (a[i]-a[i-1])/ 120;
    puts(ans >= 2 ? "YES" : "NO");
  }
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3672kb

input:

6
14
100 200 300 400 500 600 700 800 900 1000 1100 1200 1300 1400
12
100 200 300 400 600 700 800 900 1100 1200 1300 1400
13
100 200 300 400 500 600 700 800 900 1100 1200 1300 1400
13
101 189 272 356 463 563 659 739 979 1071 1170 1274 1358
1
42
5
0 1 2 3 4

output:

NO
YES
NO
YES
YES
YES

result:

ok 6 lines

Test #2:

score: 0
Accepted
time: 1ms
memory: 3456kb

input:

100
96
9 18 28 43 60 70 85 97 113 122 137 149 163 179 187 200 211 222 234 239 254 269 282 291 305 311 323 339 349 358 375 387 399 412 660 673 682 693 708 720 735 753 767 781 791 808 819 838 850 863 877 886 897 914 920 935 952 961 972 984 994 1011 1018 1029 1042 1060 1076 1093 1102 1112 1124 1133 114...

output:

YES
NO
NO
YES
NO
NO
YES
YES
NO
NO
NO
NO
NO
NO
NO
NO
NO
YES
NO
NO
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
YES
NO
NO
YES
YES
NO
YES
NO
YES
YES
YES
NO
YES
YES
YES
NO
YES
YES
YES
YES
YES
YES
NO
NO
NO
YES
NO
NO
YES
YES
YES
YES
NO
NO
NO
NO
NO
NO
YES
YES
YES
NO
NO
NO
YES
YES
YES
NO
NO
NO
NO
NO
NO
YES
NO
YES
NO
NO...

result:

ok 100 lines