結果
| 問題 |
No.2142 Segment Zero
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-02 21:29:47 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 233 bytes |
| コンパイル時間 | 498 ms |
| コンパイル使用メモリ | 65,088 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-09 22:33:25 |
| 合計ジャッジ時間 | 1,599 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 35 |
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
5 | main()
| ^~~~
ソースコード
#include<iostream>
using namespace std;
int N;
long K;
main()
{
cin>>N>>K;
K=(long)N*(N+1)/2-K;
int L=1;
for(int R=1;R<=N;R++)
{
K-=R;
while(K<0)K+=L++;
if(K==0)
{
cout<<1<<endl;
return 0;
}
}
cout<<2<<endl;
}