제출 #521483

#제출 시각아이디문제언어결과실행 시간메모리
521483Rasoul006Usmjeri (COCI17_usmjeri)C++17
0 / 140
87 ms13048 KiB
#include <bits/stdc++.h> #define endl "\n" typedef long long ll; using namespace std; const int N = 1e6+5; const int mod = 1e9+7; ll n , m , is[200009] ; pair < ll , ll > pr[300009] ; int main() { ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin >> n >> m ; for(int i = 0 ; i < n- 1 ; i++){ ll a , b ; cin >> a >> b ; } for(int i =1 ; i <= m ; i++){ ll a ,b ; cin >> pr[i].first >> pr[i].second ; is[pr[i].first] = 1 ; is[pr[i].second] = -1 ; } for(int i = 1 ; i < n ;i++){ is[i] += is[i-1] ; } bool iss = 0 ; ll ans = 1 ; for(int i = 1 ; i < n ; i++){ if(is[i] == 0){ iss = 0 ; ans = ((ans % mod) * (2 % mod)) % mod ; } else{ if(iss == 0){ ans = ((ans % mod) * (2 % mod)) % mod ; iss = 1 ; } } } cout << ans << endl ; return 0; }

컴파일 시 표준 에러 (stderr) 메시지

usmjeri.cpp: In function 'int main()':
usmjeri.cpp:22:12: warning: unused variable 'a' [-Wunused-variable]
   22 |         ll a ,b ;
      |            ^
usmjeri.cpp:22:15: warning: unused variable 'b' [-Wunused-variable]
   22 |         ll a ,b ;
      |               ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...