Submission #52435846


Source Code Expand

// LUOGU_RID: 156036151
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define eb emplace_back
//#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
const ll MOD=998244353;
// head
const int N=2e5+5;
int all[N],all1[N];
signed main() 
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int a,b;cin>>a>>b;
    if(a>b) swap(a,b);
    if(a+1==b||a==1&&b==10) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Submission Info

Submission Time
Task A - Edge Checker
User gangbengr
Language C++ 20 (gcc 12.2)
Score 100
Code Size 606 Byte
Status AC
Exec Time 1 ms
Memory 3592 KiB

Compile Error

Main.cpp: In function ‘int main()’:
Main.cpp:25:20: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
   25 |     if(a+1==b||a==1&&b==10) cout<<"Yes"<<endl;
      |                ~~~~^~~~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 16
Set Name Test Cases
Sample example0.txt, example1.txt, example2.txt
All 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, example0.txt, example1.txt, example2.txt
Case Name Status Exec Time Memory
000.txt AC 1 ms 3424 KiB
001.txt AC 1 ms 3348 KiB
002.txt AC 1 ms 3500 KiB
003.txt AC 1 ms 3396 KiB
004.txt AC 1 ms 3592 KiB
005.txt AC 1 ms 3464 KiB
006.txt AC 1 ms 3416 KiB
007.txt AC 1 ms 3416 KiB
008.txt AC 1 ms 3464 KiB
009.txt AC 1 ms 3460 KiB
010.txt AC 1 ms 3452 KiB
011.txt AC 1 ms 3468 KiB
012.txt AC 1 ms 3420 KiB
example0.txt AC 1 ms 3420 KiB
example1.txt AC 1 ms 3416 KiB
example2.txt AC 1 ms 3464 KiB