提出 #66373255


ソースコード 拡げる

#include <bits/stdc++.h>
#define ll long long
#define db double
#define vec vector
#define pll pair<ll, ll>
#define mkp make_pair
#define endl "\n"

using namespace std;

const ll mod = 998244353;

namespace fastio {
    char buf[1 << 21], *p1 = buf, *p2 = buf;
	
    const ll getc() {
        return p1 == p2 && ( p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2) ? EOF : *p1 ++;
    }
	
    const ll read() {
        ll x = 0, f = 1;
		
        char ch = getc();
		
        while (ch < '0' || ch > '9') {
            if (ch == '-') f = -1; ch = getc();
        }
		
        while (ch >= '0' && ch <= '9') {
            x = (x << 1) + (x << 3) + (ch ^ 48), ch = getc();
        }
		
        return x * f;
    }
	
    const void write(ll x) {
        if (x < 0) {
            putchar('-'), x = -x;
        }
		
        ll sta[35], top = 0;
	    
        do {
            sta[top++] = x % 10, x /= 10;
        } while (x);
	    
        while (top) putchar(sta[--top] + 48);
    }
}

#define rd fastio::read
#define wt fastio::write
#define gc fastio::getc

ll n, m, q, a[200005], b[200005], aka[1000005]; string s;

ll opt, l, r, ans = LLONG_MAX;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    
    ll i, j, k, x, y, z, res = 0, now;

	n = rd(), m = rd();

	for (i = 1; i <= m; i++) {
		a[i] = rd(), b[i] = rd(), aka[a[i]] ++, aka[b[i] + 1] --;
	}
	
	for (i = 1; i <= n; i++) {
		aka[i] += aka[i - 1];
	}
	
	for (i = 1; i <= n; i++) ans = min(ans, aka[i]);
	
	wt(ans), puts("");

    return 0;
}	

提出情報

提出日時
問題 C - Not All Covered
ユーザ Laiyiwen_01
言語 C++ 20 (gcc 12.2)
得点 300
コード長 1617 Byte
結果 AC
実行時間 18 ms
メモリ 16688 KiB

コンパイルエラー

Main.cpp:16:5: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
   16 |     const ll getc() {
      |     ^~~~~
Main.cpp:20:5: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
   20 |     const ll read() {
      |     ^~~~~
Main.cpp: In function ‘const long long int fastio::read()’:
Main.cpp:26:13: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   26 |             if (ch == '-') f = -1; ch = getc();
      |             ^~
Main.cpp:26:36: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   26 |             if (ch == '-') f = -1; ch = getc();
      |                                    ^~
Main.cpp: At global scope:
Main.cpp:36:5: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]
   36 |     const void write(ll x) {
      |     ^~~~~
Main.cpp: In function ‘int main()’:
Main.cpp:63:11: warning: unused variable ‘j’ [-Wunused-variable]
   63 |     ll i, j, k, x, y, z, res = 0, now;
      |           ^
Main.cpp:63:14: warning: unused variable ‘k’ [-Wunused-variable]
   63 |     ll i, j, k, x, y, z, res = 0, now;
      |              ^
Main.cpp:63:17: warning: unused variable ‘x’ [-Wunused-variable]
   63 |     ll i, j, k, x, y, z, res = 0, now;
      |                 ^
Main.cpp:63:20: warning: unused variable ‘y’ [-Wunused-variable]
   63 |     ll i, j, k, x, y, z, res = 0, now;
      |                    ^
Main.cpp:63:23: warning: unused variable ‘z’ [-Wunused-variable]
   63 |     ll i, j, k, x, y, z, res = 0, now;
      |                       ^
Main.cpp:63:26: warning: unused variable ‘res’ [-Wunused-variable]
   63 |     ll i, j, k, x, y, z, res = 0, now;
      |                          ^~~
Main.cpp:63:35: warning: unused variable ‘now’ [-Wunused-variable]
   63 |     ll i, j, k, x, y, z, res = 0, now;
      |                                   ^~~

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 300 / 300
結果
AC × 3
AC × 25
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_test_00.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt, 01_test_17.txt, 01_test_18.txt, 01_test_19.txt, 01_test_20.txt, 01_test_21.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 1 ms 3468 KiB
00_sample_01.txt AC 1 ms 3504 KiB
00_sample_02.txt AC 1 ms 3688 KiB
01_test_00.txt AC 7 ms 8096 KiB
01_test_01.txt AC 9 ms 8920 KiB
01_test_02.txt AC 8 ms 8208 KiB
01_test_03.txt AC 7 ms 8396 KiB
01_test_04.txt AC 8 ms 11140 KiB
01_test_05.txt AC 12 ms 12228 KiB
01_test_06.txt AC 16 ms 16024 KiB
01_test_07.txt AC 17 ms 16576 KiB
01_test_08.txt AC 8 ms 12428 KiB
01_test_09.txt AC 18 ms 16568 KiB
01_test_10.txt AC 9 ms 13108 KiB
01_test_11.txt AC 16 ms 16604 KiB
01_test_12.txt AC 16 ms 16448 KiB
01_test_13.txt AC 18 ms 16576 KiB
01_test_14.txt AC 17 ms 16688 KiB
01_test_15.txt AC 17 ms 16416 KiB
01_test_16.txt AC 16 ms 16504 KiB
01_test_17.txt AC 16 ms 16512 KiB
01_test_18.txt AC 15 ms 16532 KiB
01_test_19.txt AC 12 ms 16284 KiB
01_test_20.txt AC 13 ms 16508 KiB
01_test_21.txt AC 12 ms 16564 KiB