Niestety, nie byliśmy w stanie w pełni poprawnie wyświetlić tego pliku, ponieważ nie jest zakodowany w UTF-8.
Możesz pobrać ten plik i spróbować otworzyć go samodzielnie.
#include <iostream>
#include <vector>
using namespace std;
int main() {
int t;
ios_base::sync_with_stdio(false);
cin >> t;
for(int k=0; k<t; ++k){
int n, m;
cin >> n >> m;
vector <int> bajtek;
vector<bool> bitek;
bajtek.resize(n, 0); //atakuje tali� i x taliami
bitek.resize(n, false); // atakuje tali� i
for(int i=0; i<m; ++i){
int a, b;
char c;
cin >> a;
cin >> c;
cin >> b;
if(c=='<') bitek[b-1]=true;
else bajtek[b-1]++;
}
bool baj=false, bit=true;
for(int i=0; i<n; ++i){
if(bajtek[i]==n) baj=true;
bit &= bitek[i];
}
if(bit) cout << "PRZEGRANA\n";
else if (baj) cout << "WYGRANA\n";
else cout << "REMIS\n";
}
return 0;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #include <iostream> #include <vector> using namespace std; int main() { int t; ios_base::sync_with_stdio(false); cin >> t; for(int k=0; k<t; ++k){ int n, m; cin >> n >> m; vector <int> bajtek; vector<bool> bitek; bajtek.resize(n, 0); //atakuje tali� i x taliami bitek.resize(n, false); // atakuje tali� i for(int i=0; i<m; ++i){ int a, b; char c; cin >> a; cin >> c; cin >> b; if(c=='<') bitek[b-1]=true; else bajtek[b-1]++; } bool baj=false, bit=true; for(int i=0; i<n; ++i){ if(bajtek[i]==n) baj=true; bit &= bitek[i]; } if(bit) cout << "PRZEGRANA\n"; else if (baj) cout << "WYGRANA\n"; else cout << "REMIS\n"; } return 0; } |
English