# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
636900 | HossamHero7 | Subway (info1cup19_subway) | C++14 | 9 ms | 808 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
void solve(){
ll k;
cin>>k;
ll ans = 0;
int l=1;
int r=1e5;
while(l<=r){
ll md = l + r >> 1;
if(md*(md-1)/2 <= k){
ans = md;
l = md+1;
}
else r = md-1;
}
ll x = k-ans*(ans-1)/2;
x --;
cout<<ans+(x>=0)<<endl;
cout<<0<<" "<<-1<<endl;
for(int i=0;i<ans-1;i++){
cout<<i+1<<" "<<i<<endl;
}
if(x>=0)cout<<ans<<' '<<x<<endl;
}
int main()
{
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |