제출 #572245

#제출 시각아이디문제언어결과실행 시간메모리
572245PakhridinRadio (COCI22_radio)C++14
10 / 110
1591 ms748 KiB
# include <bits/stdc++.h> # define flash ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0) # define F first # define S second # define pb push_back # define mp make_pair # define sz(s) s.size() # define all(x) x.begin(), x.end() # define allr x.rbegin(), x.rend() # define in insert # define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout) # define fore(i, l, r) for(int i = l; i <= r; i++) typedef long long ll; typedef double db; typedef long double ld; using namespace std; const int N = 2e5 + 5; const ll inf = 1e9 + 7; const ll INF = 1e18; const db pi = acos(-1.0); int n, q, cnt[N]; int main (){ //file(s); flash; cin >> n >> q; while (q--){ char c; cin >> c; if (c == 'S'){ int a; cin >> a; if (cnt[a] == 0) cnt[a] = 1; else cnt[a] = 0; } else{ int l, r; bool ans = 0; cin >> l >> r; vector <int> v; for (int i = l; i <= r; i++){ if (cnt[i] == 1){ v.pb(i); } } for (int i = 0; i < v.size(); i++){ for (int j = 0; j < v.size(); j++){ if (__gcd(v[i], v[j]) != 1 && i != j) ans = 1; } } if (ans == 1) cout << "DA\n"; else cout << "NE\n"; } } return 0; }

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

Main.cpp: In function 'int main()':
Main.cpp:49:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   49 |    for (int i = 0; i < v.size(); i++){
      |                    ~~^~~~~~~~~~
Main.cpp:50:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   50 |     for (int j = 0; j < v.size(); j++){
      |                     ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...