Submission #67245277


Source Code Expand

// जय श्री कृष्णा
#include <bits/stdc++.h>
#define all(c) c.begin(), c.end()
#define sz(c) ll(c.size())
#define ll long long
#define tr(a, it) for (auto it = a.begin(); it != a.end(); it++)
#define present(c, x) (c.find(x) != c.end())
#define cpresent(c, x) (find(all(c), x) != c.end())
#define vi vector<int>
#define vll vector<ll>
#define vvi vector<vi>
#define vvll vector<vll>
#define vpii vector<pair<int, int>>
#define vpll vector<pair<ll, ll>>
#define pll pair<ll, ll>
#define inf 1e9
#define infi 1e18
#define MOD 1000000007
#define MAXN 10000
#define madar 1e18
#define moda 998244353
#define loop(i, s, e) for (ll i = s; i < e; i++)
#define revloop(i, s, e) for (ll i = s; i >= e; i--)
#define newl cout << endl
#define pb push_back
#define f first
#define s second

using namespace std;

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

ll gcd(ll a, ll b){
    if(!(a%b)) return b;
    return gcd(b, a%b);
}

ll lcm(ll a, ll b) {
    return (a*b)/gcd(a,b);
}

ll MSB(ll n)
{
    ll ans = -1;
    while (n) {
        ans++;
        n /= 2;
    }
    return ans;
}

ll power(ll a, ll b, ll mod) { // to calculate (a^b)%mod
    ll p = 1;
    while (b > 0) {
        if (b & 1)
            p = (p * a) % mod;
        a = (a * a) % mod;
        b = b >> 1;
    }
    return p;
}

ll inv_mod(ll n, ll mod) {
    return power(n, mod - 2, mod); 
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

// #ifdef LOCAL
// #include "debug.h"
// #endif
 
void solve(int tc) {
    int n; cin >> n;
    int ct = 0;
    loop(i,0,n){
        int a, b; cin >> a >> b;
        if(a < b) ct++;
    }
    cout << ct;
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    // auto start = std::chrono::high_resolution_clock::now();

    // freopen("input.txt", "r", stdin);
    // freopen("output1.txt", "w", stdout);
    int t = 1;
    // cin >> t;
    int tc = 0;
    while (t--) {
        tc++;
        solve(tc);
    }

    // newl;
    // auto end = chrono::high_resolution_clock::now();
    // auto duration = chrono::duration_cast<chrono::milliseconds>(end - start);

    // cout << "Time taken: " << duration.count() << " milliseconds" << std::endl;

    return 0;
}

Submission Info

Submission Time
Task A - Task Failed Successfully
User arikrrr77
Language C++ 20 (gcc 12.2)
Score 100
Code Size 2541 Byte
Status AC
Exec Time 1 ms
Memory 3624 KiB

Compile Error

Main.cpp: In function ‘void solve(int)’:
Main.cpp:73:16: warning: unused parameter ‘tc’ [-Wunused-parameter]
   73 | void solve(int tc) {
      |            ~~~~^~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 14
Set Name Test Cases
Sample sample00.txt, sample01.txt, sample02.txt
All sample00.txt, sample01.txt, sample02.txt, testcase00.txt, testcase01.txt, testcase02.txt, testcase03.txt, testcase04.txt, testcase05.txt, testcase06.txt, testcase07.txt, testcase08.txt, testcase09.txt, testcase10.txt
Case Name Status Exec Time Memory
sample00.txt AC 1 ms 3584 KiB
sample01.txt AC 1 ms 3504 KiB
sample02.txt AC 1 ms 3492 KiB
testcase00.txt AC 1 ms 3496 KiB
testcase01.txt AC 1 ms 3560 KiB
testcase02.txt AC 1 ms 3468 KiB
testcase03.txt AC 1 ms 3592 KiB
testcase04.txt AC 1 ms 3500 KiB
testcase05.txt AC 1 ms 3436 KiB
testcase06.txt AC 1 ms 3564 KiB
testcase07.txt AC 1 ms 3428 KiB
testcase08.txt AC 1 ms 3408 KiB
testcase09.txt AC 1 ms 3500 KiB
testcase10.txt AC 1 ms 3624 KiB