# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
765001 | 2023-06-24T07:20:16 Z | 1075508020060209tc | Sob (COCI19_sob) | C++14 | 1000 ms | 12644 KB |
#include<bits/stdc++.h> using namespace std; #define int long long #define X first #define Y second int n;int m; int vis[1000006]; signed main(){ cin.tie(0); ios_base::sync_with_stdio(0); vector<pair<int,int>>ans; cin>>n>>m; set<int>st; for(int i=0;i<=n-1;i++){ st.insert(i+m); } for(int i=n-1;i>=0;i--){ /* for(int j=0;j<=n-1;j++){ if(vis[j]){continue;} if( ((i&(j+m))==i) ){ ans.push_back({i,j+m}); vis[j]=1; break; } }*/ for(auto it=st.begin();it!=st.end();it++){ int v=*it; if( ((v&i)==i) ){ ans.push_back({i,v}); st.erase(v); break; } } } for(int i=0;i<ans.size();i++){ cout<<ans[i].first<<" "<<ans[i].second<<endl; } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 336 KB | Output is correct |
4 | Execution timed out | 1070 ms | 12644 KB | Time limit exceeded |
5 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 17 ms | 468 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 340 KB | Output is correct |
4 | Correct | 0 ms | 328 KB | Output is correct |
5 | Correct | 2 ms | 340 KB | Output is correct |
6 | Execution timed out | 1091 ms | 12616 KB | Time limit exceeded |
7 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 340 KB | Output is correct |
3 | Correct | 1 ms | 340 KB | Output is correct |
4 | Correct | 1 ms | 340 KB | Output is correct |
5 | Correct | 1 ms | 332 KB | Output is correct |
6 | Correct | 1 ms | 340 KB | Output is correct |
7 | Correct | 2 ms | 340 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Correct | 1 ms | 336 KB | Output is correct |
4 | Execution timed out | 1070 ms | 12644 KB | Time limit exceeded |
5 | Halted | 0 ms | 0 KB | - |