Submission #1277800

#TimeUsernameProblemLanguageResultExecution timeMemory
1277800dostsMensza (COI22_mensza)C++20
100 / 100
1468 ms71328 KiB
#pragma GCC optimize("O3,unroll-loops") #include <bits/stdc++.h> using namespace std; #define int long long #define ll long long #define pb push_back #define pii pair<int,int> #define sz(v) (int)v.size() #define fi first #define se second #define INF 1223372036854775807 #define INF2 122337203 #define MOD 1000000007 #define cint(x) int x;cin>>x; #define cinarr(a,n) int a[n];for (int i=0;i<n;i++) cin>>a[i]; #define coutarr(a) for (auto d:a)cout<<d<<" "; cout<<endl; #define coutarrD(a) for (auto d:a) cout<<d.fi<<","<<d.se<<" "; cout<<endl; #define BERKAY_TUP ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define endl '\n' #define ld long double #define mid (start+end)/2 #define vvi vector<vector<int>> int t=1; int interactive=1; int usaco=0; int testCase=0; void solve(){ int l; cin>>l; int q; cin>>q; while (q--){ string b; cin>>b; if (b == "alojzije") { int a; cin >> a; int x = 1; vector<int> v; for (int j = 18;j>=0;j--) { x<<=1; if (a&(1<<j)) x|=1; v.push_back(x); } cout << v.size() << ' '; for (auto it : v) cout << it << ' '; cout << endl << flush; } if (b == "benjamin") { int b; cin >> b; int x = 1; vector<int> v; for (int j = 18;j>=0;j--) { x<<=1; if (b&(1<<j)) { x|=1; } else { v.push_back(x^1); } } cout << v.size() << ' '; for (auto it : v) cout << it << ' '; cout << endl << flush; } if (b=="cecilija"){ int x; cin>>x; cinarr(zz,x); if (zz[x-1]==2){ cout<<"A"<<endl; } else{ cout<<"B"<<endl; } cout<<flush; } } } int32_t main(){ BERKAY_TUP; if (usaco){ freopen("team.in", "r", stdin); freopen("team.out", "w", stdout); } if (!interactive){ #ifdef Local freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout); //freopen("wormsort.out", "w", stdout); #endif } if (t==1) solve(); else{ cin>>t; while (t--){testCase++;solve();} } return 0; }

Compilation message (stderr)

Main.cpp: In function 'int32_t main()':
Main.cpp:105:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  105 |         freopen("team.in", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:106:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
  106 |         freopen("team.out", "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...