結果
| 問題 |
No.796 well known
|
| コンテスト | |
| ユーザー |
ugis_prog
|
| 提出日時 | 2019-03-15 21:42:33 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 433 bytes |
| コンパイル時間 | 626 ms |
| コンパイル使用メモリ | 62,712 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-01 20:37:50 |
| 合計ジャッジ時間 | 11,990 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 2 WA * 11 TLE * 2 |
ソースコード
#include<iostream>
#include<vector>
#include<queue>
#include<string>
using namespace std;
int main(){
int N;
cin >> N;
vector<int> ans(1,3);
int sum = 3;
int i=1;
while(ans.size() < N-1) {
if(i == 3) i++;
ans.push_back(i);
sum += i;
i++;
}
while((sum+i)%3 != 1 || i == 3) i++;
ans.push_back(i);
for(int i=0;i<N;i++) cout << ans[i] << " ";
cout << endl;
}
ugis_prog